Skip to Content
0

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

Jun 26, 2017 at 04:36 PM

27

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers