- private void GenerateReport()
- {
- billtype = Request.QueryString["BillType"];
- billcode = Request.QueryString["BillCode"];
- string[] codelength = billcode.Split(',');
- report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("reportRdlx//Temp3.rdlx")));// 1/2
- // 创建 Container 控件,用户加载 Subreport 控件
- GrapeCity.ActiveReports.PageReportModel.Container container = new GrapeCity.ActiveReports.PageReportModel.Container();
- container.Name = string.Format("Container{0}", 1);
- container.Width = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("1cm");
- container.Height = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("1cm");
- container.Left = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("0cm");
- container.Top = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length((1 * (1 - 1)).ToString() + "cm");
- container.PageBreakAtEnd = true;
- container.PageBreakAtStart = false;
- #region 收
- // 创建 Subreport 控件,用户加载实际报表模板 -- 收料单
- GrapeCity.ActiveReports.PageReportModel.Subreport subreport = new GrapeCity.ActiveReports.PageReportModel.Subreport();
- subreport.Name = string.Format("SubReport{0}", 1);
- subreport.Width = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("1cm");
- subreport.Height = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("1cm");
- subreport.Left = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("0cm");
- subreport.Top = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("0cm");
- GrapeCity.ActiveReports.PageReportModel.Parameter pid = new GrapeCity.ActiveReports.PageReportModel.Parameter();
- pid.Name = "billcode";
- pid.Value = codelength[0].ToString();
- subreport.Parameters.Add(pid);
- //收料单
- subreport.ReportName = "IBMTFormNew.rdlx";
- container.ReportItems.Add(subreport);
- #endregion
- #region 发
- // 创建 Subreport 控件,用户加载实际报表模板 -- 发料单
- GrapeCity.ActiveReports.PageReportModel.Subreport subreport2 = new GrapeCity.ActiveReports.PageReportModel.Subreport();
- subreport2.Name = string.Format("SubReport{0}", 2);
- subreport2.Width = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("1cm");
- subreport2.Height = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("1cm");
- subreport2.Left = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("0cm");
- subreport2.Top = new GrapeCity.ActiveReports.Extensibility.Definition.Components.Length("0cm");
- GrapeCity.ActiveReports.PageReportModel.Parameter pid2 = new GrapeCity.ActiveReports.PageReportModel.Parameter();
- pid2.Name = "billcode";
- pid2.Value = codelength[0].ToString();
- subreport2.Parameters.Add(pid2);
- //发料单
- subreport2.ReportName = "RGiveMatl.rdlx";
- container.ReportItems.Add(subreport2);
- #endregion
- report.Report.Body.ReportItems.Add(container);
- report.Document.LocateDataSource += new GrapeCity.ActiveReports.LocateDataSourceEventHandler(pageDocument_LocateDataSource);
- }
复制代码 |