PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → [WD21] Hidden calculations in reports do not work!?!?
[WD21] Hidden calculations in reports do not work!?!?
Débuté par Ola, 20 juil. 2017 12:31 - 4 réponses
Posté le 20 juillet 2017 - 12:31
Hi all,

Using the report editor I am doing a somewhat complicated query-based report which includes both visible automatic calculations on data fields and their break sums and total sums. These work OK.

Then I am also doing some "hidden" calculations in the "before printing body" code section, adding conditionally value to variables defined in the report's beginning section, whose results are not shown on row level, but only in the "End of document block".

Everything works fine EXCEPT that the hidden calculations done before printing the last body row of the report are NOT executed or taken into consideration; the values of the last body row are excluded from the totals shown in the "End of document block"!

How can I get also the last body row included in the hidden calculation results?
Any hints/tips will be appreciated.

Best regards
Ola
Posté le 20 juillet 2017 - 12:46
Hi ola

I think this is the same problem I have had a number of times. Sometimes resolved by putting the variable 'again' in the before printing method of the control. MyControl = MyControl which forces it to refresh and this gets it to include the last calc.

Another painful bug
Posté le 20 juillet 2017 - 13:47
Thanks Mark,

Your hint saved my day!:spos:

I had trusted that PCSoft can do the calculations correctly and in the right order, so I had linked the final display fields to the report variables that were calculated in the before printing body section. The linking does not seem to work with the last body row, so I moved the calculation results to the final display fields "manually" in the body code, and removed the links.

I wonder whether this bug has been fixed in WD22?:rolleyes:

Best regards
Ola
Posté le 20 juillet 2017 - 22:24
Pleasure :cheers:
Posté le 24 juillet 2017 - 12:59
Hi all,

Just a heads-up on linking report fields to report variable.

I made some more testing with report fields linked to report variables. This bug seems to be more or less systematic. Whenever an end result field is linked to a report variable (I am not talking about file or query items but report variables defined in the report init section), the values printed in the last body row are simply skipped and consequently the end result is wrong.

The solution is not to link link report fields to report variables; they should be updated by code in the body (or break etc...) section.

And this is not nearly the worst problem in WD's report editor...

Best regards
Ola