Steve,

Here's how ...

01. When working with variables (sub-totals and totals), the best approach is to ALWAYS initialize all variables to NULL or 0, as report "Before Generate EEP".

    Report Designer > Main Menu > Report > Actions > Before Generate
    -- Example
    SET VAR vTot1 CURRENCY = 0.00
    RETURN

This will always start the variable as 0.00 before the actual report is generated.

02. Make sure to check the option for "Cache Pages".

    Report Designer > Main Menu > Report > [x] Cache Pages

That's all there is to it!

You may take a look at the sample report "SubTotalsAndTotals" included with RRBYW19 database to understand the use of both techniques.

Hope that helps!

Very Best R:egards,

Razzak


At 12:57 AM 10/4/2017, Steve Johnson wrote:

I have a very simple report that prints out a list of checks with their corresponding totals. The check amounts are totaled with the result stored in a variable and that variable is subtracted from another variable to arrive at a balance. When the report is printed to screen, the results are correct. But when the same report is printed to a printer using the print options in the screen version, the check total amount is doubled. This has worked literally for years, but at some point, this error started. I am using XE.

This is the print code in an eep, where the screen total is correct but which results in a doubling of the check total when the report is printed from the screen:
PRINT ledger1 ORDER BY checno OPTION SCREEN|WINDOW_STATE MAXIMIZED

If I substitute the following in the same eep, ie., printing directly to the printer, the results are correct:
OUTPUT printer
PRINT ledger1 ORDER BY checno
OUT scrn
The variable in the report is:  1  : CURRENCY  : D : VTOT1 = SUM OF CHECTOT
So the question is what is happening between printing to screen (essentially a print preview) and then printing to printer from the screen that is causing a doubling VTOT1? The OPTION SCREEN provides the printer icon in the toolbar that essentially provides for many print options. It is a convenient print option from a report generated to screen as a preview.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to