Page tree
Skip to end of metadata
Go to start of metadata

!MISSING PHRASE 'Show All'! !MISSING PHRASE 'Hide All'!
C1PrintDocument可以导入并生成C1Report定义。
使用ImportC1Report方法导入一个C1Report至C1PrintDocument。例如,以下代码可以用作导入并预览包含在同
Reportsfor WinForms发布的ReportBrowser示例下的AlphabeticalListofProducts报表: Visual Basic

Visual Basic

Dim doc As C1PrintDocument = New C1PrintDocument()
doc.ImportC1Report("NWind.xml", "Alphabetical List of Products") Dim pdlg As C1PrintPreviewDialog = New C1PrintPreviewDialog() pdlg.Document = doc pdlg.ShowDialog()

C#

C#

C1PrintDocument doc = new C1PrintDocument();
doc.ImportC1Report("NWind.xml", "Alphabetical List of Products"); C1PrintPreviewDialog pdlg = new C1PrintPreviewDialog(); pdlg.Document = doc; pdlg.ShowDialog();

在C1Report导入到C1PrintDocument之后,文档具有以下结构:对于不包含分组的报表:
页脚由RenderSection对象表示,并设置给文档的PageLayouts.Default.PageFooter属性。
对于报表的每一个报表节部分,将创建一个RenderSection对象,并添加至文档的Body属性,按照以下顺序:
Header(报表页眉,SectionTypeEnum.Header)
PageHeader(页眉,SectionTypeEnum.PageHeader)
Detail(数据区域,SectionTypeEnum.Detail)
Footer(报表页脚,SectionTypeEnum.Footer)
同时会将PageHeader的一份复制设置给PageHeader.LayoutChangeAfter.PageLayout.PageHeader。我们需要这种复杂的结构,因为在C1Report中,第一页的页眉将在报表页眉之前打印。对于包含分组的报表:
对于每一个分组,将创建一个RenderArea,以下对象树将放置在页眉和页脚区域(对于两级分组的情况):
RenderArea 表示最上层的分组
RenderSection表示GroupHeader1
RenderArea 表示内嵌分组
RenderSection表示GroupHeader2
内容
RenderSection表示GroupFooter2
RenderSection表示GroupFooter1

  • No labels