Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following is an example of the RDL for a report in Schema version RDL 2005/01. It shows the usage of the various properties of a Report. This example shows elements for describing the data: DataSources and DataSets; elements for describing the structure and layout: Report.PageHeader, Report.PageFooter, and Body; and elements for describing the ReportParameters for the report.
The following figure shows an example rendering of this report.
Figure 11: RDL schema 2005/01 report rendering
-
1 <?xml version="1.0" encoding="utf-8"?> 2 <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition"> 3 <DataSources> 4 <DataSource Name="DataSource1"> 5 <ConnectionProperties> 6 <DataProvider>SQL</DataProvider> 7 <ConnectString>data source=DataServer; initial catalog=Northwind;</ConnectString> 8 </ConnectionProperties> 9 </DataSource> 10 </DataSources> 11 <DataSets> 12 <DataSet Name="DataSet1"> 13 <Fields> 14 <Field Name="ProductID"> 15 <DataField>ProductID</DataField> 16 </Field> 17 <Field Name="ProductName"> 18 <DataField>ProductName</DataField> 19 </Field> 20 <Field Name="SupplierID"> 21 <DataField>SupplierID</DataField> 22 </Field> 23 <Field Name="CategoryID"> 24 <DataField>CategoryID</DataField> 25 </Field> 26 <Field Name="QuantityPerUnit"> 27 <DataField>QuantityPerUnit</DataField> 28 </Field> 29 <Field Name="UnitPrice"> 30 <DataField>UnitPrice</DataField> 31 </Field> 32 <Field Name="UnitsInStock"> 33 <DataField>UnitsInStock</DataField> 34 </Field> 35 <Field Name="UnitsOnOrder"> 36 <DataField>UnitsOnOrder</DataField> 37 </Field> 38 <Field Name="ReorderLevel"> 39 <DataField>ReorderLevel</DataField> 40 </Field> 41 <Field Name="Discontinued"> 42 <DataField>Discontinued</DataField> 43 </Field> 44 </Fields> 45 <Query> 46 <DataSourceName>DataSource1</DataSourceName> 47 <CommandText>Select * From Products</CommandText> 48 </Query> 49 </DataSet> 50 </DataSets> 51 <Body> 52 <ReportItems> 53 <Textbox Name="BodyTextbox"> 54 <CanGrow>true</CanGrow> 55 <Value>Body</Value> 56 <Top>0.33333in</Top> 57 <Left>0.3125in</Left> 58 <Height>1in</Height> 59 <Width>2.5in</Width> 60 <Style> 61 <BorderColor> 62 <Default>Black</Default> 63 </BorderColor> 64 <BorderStyle> 65 <Default>Solid</Default> 66 </BorderStyle> 67 <BorderWidth> 68 <Default>1pt</Default> 69 </BorderWidth> 70 <BackgroundColor>LightSteelBlue</BackgroundColor> 71 </Style> 72 </Textbox> 73 </ReportItems> 74 <Height>2.5in</Height> 75 <Style> 76 <BackgroundColor>Khaki</BackgroundColor> 77 </Style> 78 </Body> 79 <PageHeader> 80 <Height>0.5in</Height> 81 <PrintOnFirstPage>true</PrintOnFirstPage> 82 <PrintOnLastPage>true</PrintOnLastPage> 83 <ReportItems> 84 <Textbox Name="HeaderTextbox"> 85 <Value>Header</Value> 86 <Top>0.14583in</Top> 87 <Left>0.3125in</Left> 88 <Height>0.19792in</Height> 89 <Width>5in</Width> 90 <Style> 91 <BorderColor> 92 <Default>DarkBlue</Default> 93 </BorderColor> 94 <BorderStyle> 95 <Default>Solid</Default> 96 </BorderStyle> 97 <BorderWidth> 98 <Default>1pt</Default> 99 </BorderWidth> 100 <BackgroundColor>Gray</BackgroundColor> 101 <PaddingLeft>2pt</PaddingLeft> 102 <PaddingRight>2pt</PaddingRight> 103 <PaddingTop>2pt</PaddingTop> 104 <PaddingBottom>2pt</PaddingBottom> 105 </Style> 106 </Textbox> 107 </ReportItems> 108 <Style> 109 <BackgroundColor>Silver</BackgroundColor> 110 </Style> 111 </PageHeader> 112 <PageFooter> 113 <Height>0.75in</Height> 114 <PrintOnFirstPage>true</PrintOnFirstPage> 115 <PrintOnLastPage>true</PrintOnLastPage> 116 <ReportItems> 117 <Textbox Name="FooterTextbox"> 118 <CanGrow>true</CanGrow> 119 <Value>Footer</Value> 120 <Top>0.25in</Top> 121 <Left>0.3125in</Left> 122 <Height>0.17708in</Height> 123 <Width>5in</Width> 124 <Style> 125 <BorderColor> 126 <Default>DarkBlue</Default> 127 </BorderColor> 128 <BorderStyle> 129 <Default>Solid</Default> 130 </BorderStyle> 131 <BorderWidth> 132 <Default>1pt</Default> 133 </BorderWidth> 134 <BackgroundColor>LightGray</BackgroundColor> 135 </Style> 136 </Textbox> 137 </ReportItems> 138 <Style> 139 <BackgroundColor>Silver</BackgroundColor> 140 </Style> 141 </PageFooter> 142 <PageWidth>8.5in</PageWidth> 143 <PageHeight>6in</PageHeight> 144 <InteractiveWidth>8.5in</InteractiveWidth> 145 <LeftMargin>0.5in</LeftMargin> 146 <RightMargin>0.5in</RightMargin> 147 <TopMargin>0.25in</TopMargin> 148 <BottomMargin>0.25in</BottomMargin> 149 <Width>6.5in</Width> 150 <Language>=User!Language</Language> 151 <ReportParameters> 152 <ReportParameter Name="Product"> 153 <DataType>String</DataType> 154 <DefaultValue> 155 <DataSetReference> 156 <DataSetName>DataSet1</DataSetName> 157 <ValueField>ProductID</ValueField> 158 </DataSetReference> 159 </DefaultValue> 160 <Prompt>Product</Prompt> 161 <ValidValues> 162 <DataSetReference> 163 <DataSetName>DataSet1</DataSetName> 164 <ValueField>ProductID</ValueField> 165 <LabelField>ProductName</LabelField> 166 </DataSetReference> 167 </ValidValues> 168 <MultiValue>true</MultiValue> 169 </ReportParameter> 170 <ReportParameter Name="Quantity"> 171 <DataType>Integer</DataType> 172 <DefaultValue> 173 <Values> 174 <Value>0</Value> 175 </Values> 176 </DefaultValue> 177 <Prompt>Quantity</Prompt> 178 <ValidValues> 179 <ParameterValues> 180 <ParameterValue> 181 <Value>0</Value> 182 <Label>0</Label> 183 </ParameterValue> 184 <ParameterValue> 185 <Value>10</Value> 186 <Label>10</Label> 187 </ParameterValue> 188 <ParameterValue> 189 <Value>50</Value> 190 <Label>50</Label> 191 </ParameterValue> 192 </ParameterValues> 193 </ValidValues> 194 </ReportParameter> 195 </ReportParameters> 196</Report>