Few years before when i designing my access reports i have to write many lines of codes to get sums, sorting, combining table fields etc.,. once i started using Visual studio only few lines of code is enough. If you have vision you can write code anything. Crystal report is coolest reporting tool i have ever seen. I have designed many reports using crytal for my application. This article give you some ideas how to combine table fields, how to get Customfield sum, Custom sorting order.
Here first we start with combine multiple fields. Imagine your have display 3 fields from your 3different table in your database.
totext({table1.field_ID}) +":"+ totext({table3.field_Itemno})+":"+ totext({table2.field_qty
Above example output will looklike 111000:12345:15 the first one is field_id from table1, second one is field_itemno from table3 and last one is field_qty from table2. In between i have used special charector (:) for seperate from one field from another.
(Note: Field_id is name of the field in table1)
Next we are going to see how to sum custom field. Its already inbuild sum function is exist. But you cannot use that function for customize field. So you have to use formulas. Here we can see one example for total cost Imagine you have few product in your table you have to calculate cost according to custom pick qty. User have to create item by item, then total for all picked item. Here is first we can see how item cost depend on selected qty. Please add in formula
{Purchase.PickQty} * {Purchase.POUnitPrice}
Then you can calculate for page total. For that you have to use running total for the page. If you want know how to please google it.
// Prints the cumulative value of the RunningTotal variable
WhilePrintingRecords; NumberVar RunningTotal1; RunningTotal1;
|
No responses found. Be the first to respond and make money from revenue sharing program.
|