Get report invoice in report in Crystal Reports

How can I get the number of entries in a subreport from the main report?

+4
source share
3 answers

I think this is a hoax, but I will answer anyway. :)

You can create a formula field in the subtitle that contains a shared variable. In the formula, you set the shared variable to the value of the rowcount field in the subtitle.

Then, in your main report, you will need to create a formula with a shared variable that has the same name as the sub-register, and then returns the value of the shared variable.

Here are some links that might help. http://www.datamanagementgroup.com/Resources/TrainersTalk/trainerstalk_howto_share_subreport_data_with_main_report.asp http://www.ozgrid.com/forum/showthread.php?t=19034

+8
source
  • Put this formula in your report. You can suppress it from the screen if you want.

    WhilePrintingRecords;
    Total numbervar SubRecordCount: = (however you want to count the entries in the report);

  • Put this in your main report. Again, this can also be suppressed.

    WhilePrintingRecords;
    shared numbervar SubRecordCount;
    SubRecordCount

  • Use the formula name for # 2 for any calculations you need.
    IMPORTANT: Due to the fundamental logic of the Crystal, you can use this field only if it NEVER is reported.
    In addition, regarding the counting of entries in the subtitle, I recommend the total amount at the bottom.

0
source

here you can restore the counting of a sub-report from the code side

=============================

CrystalDecisions.CrystalReports.Engine.ReportDocument RepDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); RepDoc.Load(ReportName); int IntRepCount = RepDoc.Subreports.Count; 

=============================

transfer this account to the report

-1
source

All Articles