private static void localReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e) { try { RDLReportDocument subReport = SubReportList.Find(item => item.Name == e.ReportPath); if (subReport != null) { subReport.LoadSubReportSourceDataSet(e.Parameters); ReportDataSource rdSource = null; foreach (DataTable dtTable in subReport.DsSource.Tables) { rdSource = new ReportDataSource(); rdSource.Name = dtTable.TableName; rdSource.Value = dtTable.DefaultView; e.DataSources.Add(rdSource); } } else { foreach (RDLReportDocument subSubReport in SubReportList) { SubSubreportProcessing(subSubReport, e); } } } catch (Exception ex) { throw (ex); } }
private void LoadSubReportInfo() { RDLReportDocument subRep; string reportName = string.Empty; XmlNodeList xmlItems = GetCustomNodeList("Subreport"); foreach (XmlNode nod in xmlItems) { reportName = nod["ReportName"].InnerText; if (!SubReportList.Any(x => x.Name == reportName)) { subRep = new RDLReportDocument(_reportSuiteRepository); subRep.SetFields(UserCode, reportName, ReportPathWithOutName); subRep.Load(string.Format(@"{0}\{1}.{2}", ReportPathWithOutName, reportName, "rdlc")); SubReportList.Add(subRep); } } }
private static void SubSubreportProcessing(RDLReportDocument subReport, SubreportProcessingEventArgs e) { try { RDLReportDocument objSubSubReport = subReport.SubReportList.Find(item => item.Name == e.ReportPath); if (objSubSubReport != null) { LocalReport_SubSubreportProcessing(subReport, e); } else { foreach (RDLReportDocument subSubReport in subReport.SubReportList) { SubSubreportProcessing(subSubReport, e); } } } catch (Exception ex) { throw ex; } }