Skip to Content
avatar image
Former Member

Setting numeric format for a subreport field dynamically using C# and Sap Crystal reports

Hi I've tried to change numeric format of decimal fields in subreport using information from this thread https://archive.sap.com/discussions/thread/2083873 and alter it to take it from subreport but i can't get report objects from subreport. it works correct if i try for main report but can't make it to work for subreport. Here is what I've tried:

CrystalDecisions.CrystalReports.Engine.ReportDocument doc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

doc.Load("Path to rpt file");

ISCDReportClientDocument boReportClientDocument = doc.ReportClientDocument;

ISCRSubreportClientDocument boSubreportClientDocument = boReportClientDocument.SubreportController.GetSubreport("Subreport name");

ReportObjects reportSubreportObjects = boSubreportClientDocument.ReportDefController.ReportObjectController.GetReportObjectsByKind(CrystalDecisions.ReportAppServer.ReportDefModel.CrReportObjectKindEnum.crReportObjectKindField); This is where it fails.Returns 0 objects.

Please advise, what I'm doing wrong and how to correct this.

Thanks,

Iliyan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Apr 24 at 05:27 PM

    See this sample to get all of the fields in a report:

    how-to-parameters-in-crystal-reports-for-visual-studio-net

    Add comment
    10|10000 characters needed characters exceeded