Home Subreports

Global variables in multiple sub-reports

edited August 2011 in Subreports
Hi,

Using the end-user mode, I have a requirement to have a line number printed
on a report which comprises a 'Main' report and 2 x sub-reports. Using
global variables I have the report successfully passing the line number from
'Main' to the 1st sub-report & incrementing from there. I am having trouble
passing the cumulative line number from the 2nd sub-report to the 3rd as I
end up back at 1 again. How do I pass the value of a global variable from
sub-report 1 through to sub report 2 ?

eg; Main
1
2
3
4
5
Sub Report 1
6
7
8
9
Sub Report 2
getting want
1 10
2 11
3 12

Comments

  • edited August 2011
    Edit: fixed incorrect name in account settings.

  • edited August 2011
    Hi Rick,

    Sorry about the delay in this response.

    In my testing I was able to successfully use a global variable in the
    main report and multiple subreports to define the line number. Below is
    how I approached the task.

    My report consisted of a main report and two shiftrelative subreports
    (in the summary band). All connected to the same dataset for testing
    purposes.

    Created a global integer RAP variable to hold the line number.

    Next to the DBText in each detail band I place a TppVariable of type
    Integer.

    In the OnCalc event of each TppVariable I placed the following RAP code.

    Value := GLineNo;
    GLineNo := GLineNo + 1;



    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.