您好
您问的是页面报表如何构造LayoutBuilder类是吧
如果是这样可参考下面代码:- public static void BuildPageReportLayout(Design.Designer designer)
- {
- PageReport report = new PageReport();
- report.Load(new StringReader(
- @"<Report xmlns=""http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition"">
- <Body>
- <Height>27.9cm</Height>
- <ReportItems>
- <FixedPage Name=""FixedPage1"">
- <Pages>
- <Page />
- </Pages>
- </FixedPage>
- </ReportItems>
- </Body>
- <BottomMargin>2.5cm</BottomMargin>
- <LeftMargin>2.5cm</LeftMargin>
- <PageHeight>27.9cm</PageHeight>
- <PageWidth>21.6cm</PageWidth>
- <RightMargin>2.5cm</RightMargin>
- <TopMargin>2.5cm</TopMargin>
- <Width>21.6cm</Width>
- </Report>"));
- report = LayoutBuilder.AddDataSetDataSource(report);//Adding DataSources to the PageReport object
- MemoryStream reportStream = LayoutBuilder.LoadReportToStream(report);//Loading the PageReport object to a stream
- reportStream.Position = 0;
- designer.LoadReport(XmlReader.Create(reportStream), DesignerReportType.Page);
- }
复制代码 具体内容可参考下面博客:
http://blog.gcpowertools.com.cn/post/enduserdesigner.aspx
|