Skip to Content

how can i take a sub report value to the main report.

I have created a sub report and I want to know two things. Can I bring that value to the main report and if so how?
Second, Can I use that value as part of the select formula?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Aug 14, 2017 at 07:39 AM

    You need to use a Shared Variable.

    Declare in formula with this structure


    Shared Numbervar X;

    Can be string boolean or date.To carry data from Subreport to main report the main report formula must be in a section below the subreport.

    Subreports are evaluated after main report that is while you use whileprintingrecords. Such formula can not be used in Select filters.

    If you want to use variable you will need to to convert data source to a Stored Procedure and then do all work including Subreport data in SQL.


    Add comment
    10|10000 characters needed characters exceeded

    • Shared vars can be strings to

      Data from Shared Vars can only be shown after the SR has excecuted.

      If you want a summary at top of report you can load subreports twice, hide version generating vars in Report header.

      and then place again in lower part of report to display details.

      Hidden SRs must be in an open section otherwise they will not execute, simply suppress all SR sections and make them as thin as possible so they do not take up much space, you can also set section to underlay following sections. This way they will not affect layout but they will use DB resource as you will be running twice.