Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Total number on Report is wrong
Message
 
 
To
19/01/2023 00:16:50
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01685844
Message ID:
01685853
Views:
42
>>>HI,
>>>
>>>I have been trying to figure out the following problem:
>>>
>>>I create a report with two bands. One band has a column EXT_PRICE. I select a small subset of records and the total (at the bottom) always show the number which is larger that the sum (calculated outside) of each item. And it looks like the difference is always by 2. I even view in the debugger that records in the cursor of the band and it shows all the numbers just like in the report. Yet, the total is different.
>>>
>>>The variable that shows the Total is set as follows:
>>>Value to store: CURPODET.EXT_PRICE
>>>Initial value: 0
>>>Calculation type: SUM
>>>
>>>Can you see what is missing?
>
>>>
>>>TIA
>>>
>>>UPDATE. I see that the difference in total is different in each case. Not always by 2.
>>
>>I believe that relying on Variables to calculate the totals in a two-band report is not a good practice. I found another report in my program, also two-band. And in that other report I was creating a Totals cursor (basically calculating the totals "manually" instead of relying on the Variables. I will do the same in this report.
>
>You can always sum on a condition. This is Value to storecould be a condition like
>
>iif(lExpression, nField, 0)
>
>
>From help:
>Value to store
>Specifies an expression that is used to determine the value of the report variable during a report run. The report engine evaluates this expression each time it moves the record pointer as it processes the records in the current scope. Clicking the ellipsis (…) button opens the Expression Builder so you can build an expression. For more information, see Expression Builder Dialog Box.
>
>I just like to tell you that too many report variables will slow down the report. Also the ORDER of the variables determine the ORDER they are processed. If you use one variable in the other. ;)

Do you see any problems with using a totals_cursor instead of the variables? I have used this method long time ago (in my app) and so far it works without a glitch.
I have tried using a Variable in the report and it did not work. I need to move on; this is why I am using the totals_cursor.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform