private int SubreportTotelPage(CrystalReportViewer CrvViewer) { int TotalPage = 0; ReportDocument reportDocument = ((ReportDocument)CrvViewer.ReportSource); Sections sections = reportDocument.ReportDefinition.Sections; foreach (Section section in sections) { ReportObjects reportObjects = section.ReportObjects; foreach (ReportObject reportObject in reportObjects) { if (reportObject.Kind == ReportObjectKind.SubreportObject) { SubreportObject subreportObject = (SubreportObject)reportObject; if (subreportObject.SubreportName == "Sub_Memorandum.rpt") { CrystalDecisions.CrystalReports.Engine.TextObject rptTxtGroup = subReportDocument.ReportDefinition.ReportObjects["Text9"] as CrystalDecisions.CrystalReports.Engine.TextObject; if (rptTxtGroup != null) return TotalPage = Convert.ToInt16 (rptTxtGroup.Text.ToString()); /* CrystalDecisions.CrystalReports.Engine.FieldObject rptFieldGroup = (subReportDocument.ReportDefinition.ReportObjects["{@NoofPageinSubReport}"] as CrystalDecisions.CrystalReports.Engine.FieldObject); if (rptFieldGroup != null) return TotalPage = Convert.ToInt16(rptFieldGroup.ToString()); */ else return TotalPage; }
"@NoofPageinSubReport"
Shared numberVar TotalPageSubreport;
TotalPageSubreport:=PageNumber
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)