Report Definition Language
From Wikipedia, the free encyclopedia
Report Definition Language is a standard used for defining reports.
.RDL or "Report Definition Language" files are composed of specifically structured XML. This format is primarilly used with Microsoft SQL Server Reporting Services. Typically they can be written using Visual Studio although third party proprietary tools exist. Optionally, the XML files may be created or edited by hand in a text editor. Microsoft Reporting Services or other 3rd party reporting frameworks are capable of rendering charts, graphs, calculations, text, images (through links) and other "pretty" reporting objects by interpreting an RDL file.
There are 3 high level sections in a typical RDL file:
1. Page style - Definition of all the objects that shall be displayed including fields, images, graphs, tables.
2. Field definitions - Defines the extended attributes of fields which are populated with formulas, dynamic data, or Database derived data.
3. Parameters and Database connections - Defines parameters that maybe asked of the user or programmatically passed in from another application as well as database connections and queries for pulling data into the report.
References:
Microsoft's official reporting services site: LINK
3rd party open source reporting framework that uses RDLs: LINK
Example of RDL file contents (abbriviated, non-working):
<?xml version="1.0" encoding="utf-8"?> <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> <RightMargin>1in</RightMargin> <Body> <ReportItems> <List Name="list1"> <Height>1.375in</Height> <ZIndex>1</ZIndex> <Style /> <DataSetName>Customer</DataSetName> <Width>8.625in</Width> <ReportItems> <Textbox Name="textbox1"> <Style> <PaddingLeft>2pt</PaddingLeft> <FontSize>14pt</FontSize> <TextAlign>Left</TextAlign> <PaddingBottom>2pt</PaddingBottom> <PaddingTop>2pt</PaddingTop> <PaddingRight>2pt</PaddingRight> <FontWeight>700</FontWeight> </Style> <ZIndex>10</ZIndex> <rd:DefaultName>textbox1</rd:DefaultName> <Height>0.25in</Height> <Width>6.375in</Width> <CanGrow>true</CanGrow> <Value>Report Execution Statistics</Value> </Textbox> </ReportItems> </List> <Style /> <Height>2.75in</Height> </Body> <TopMargin>1in</TopMargin> <DataSources> <DataSource Name="ReportServer"> <rd:DataSourceID>e2cb25ce-e80d-4d1d-b23d-1b62762f2c9a</rd:DataSourceID> <ConnectionProperties> <DataProvider>SQL</DataProvider> <ConnectString>data source=SQLDB;initial catalog=ReportServer</ConnectString> </ConnectionProperties> </DataSource> </DataSources> <Width>17.625in</Width> <DataSets> <DataSet Name="Data"> <Fields> <Field Name="account"> <DataField>account</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="name"> <DataField>name</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="description"> <DataField>description</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="instanceName"> <DataField>instanceName</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="UserName"> <DataField>UserName</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="format"> <DataField>format</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="parameters"> <DataField>parameters</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="timestart"> <DataField>timestart</DataField> <rd:TypeName>System.DateTime</rd:TypeName> </Field> <Field Name="TimeDataRetrieval"> <DataField>TimeDataRetrieval</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="TimeProcessing"> <DataField>TimeProcessing</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="TimeRendering"> <DataField>TimeRendering</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="TimeTotal"> <DataField>TimeTotal</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="status"> <DataField>status</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="ByteCount"> <DataField>ByteCount</DataField> <rd:TypeName>System.Int64</rd:TypeName> </Field> </Fields> <Query> <DataSourceName>ReportServer</DataSourceName> <CommandText>select * from executionlog with (NOLOCK) join catalog on catalog.itemid=executionlog.reportid where (replace(left(Path,charindex('/',Path,2)-1),'/','')=@account or @account='All') and (format=@format or @format='All' )and timestart between @DateFrom and @DateTo and (status=@status or @status='All') order by status,TimeTotal desc</CommandText> <QueryParameters> <QueryParameter Name="@account"> <Value>=Parameters!account.Value</Value> </QueryParameter> <QueryParameter Name="@format"> <Value>=Parameters!format.Value</Value> </QueryParameter> <QueryParameter Name="@DateFrom"> <Value>=Parameters!DateFrom.Value</Value> </QueryParameter> <QueryParameter Name="@DateTo"> <Value>=Parameters!DateTo.Value</Value> </QueryParameter> <QueryParameter Name="@status"> <Value>=Parameters!status.Value</Value> </QueryParameter> </QueryParameters> <rd:UseGenericDesigner>true</rd:UseGenericDesigner> </Query> </DataSet> </DataSets> <LeftMargin>1in</LeftMargin> <rd:SnapToGrid>true</rd:SnapToGrid> <rd:DrawGrid>true</rd:DrawGrid> <rd:ReportID>cf94cfb4-46a3-444e-b7fd-8565325f54ab</rd:ReportID> <PageFooter> <ReportItems> <Textbox Name="textbox18"> <Style> <PaddingLeft>2pt</PaddingLeft> <FontSize>8pt</FontSize> <FontStyle>Italic</FontStyle> <PaddingBottom>2pt</PaddingBottom> <PaddingTop>2pt</PaddingTop> <PaddingRight>2pt</PaddingRight> </Style> <ZIndex>2</ZIndex> <Width>2.75in</Width> <CanGrow>true</CanGrow> <Value>ReportExecutionStatistics</Value> </Textbox> </ReportItems> <PrintOnLastPage>true</PrintOnLastPage> <PrintOnFirstPage>true</PrintOnFirstPage> <Style /> <Height>0.25in</Height> </PageFooter> <BottomMargin>1in</BottomMargin> <ReportParameters> <ReportParameter Name="status"> <DataType>String</DataType> <Prompt>select Status:</Prompt> <ValidValues> <DataSetReference> <DataSetName>StatusParm</DataSetName> <ValueField>id</ValueField> <LabelField>label</LabelField> </DataSetReference> </ValidValues> </ReportParameter> </ReportParameters> <Language>en-US</Language> </Report>
Table Sytle Syntax:
<Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style>
Table Cell Colspan Syntax:
<TableCell> .... </ReportItems> <ColSpan>2</ColSpan> </TableCell>
Text Box Syntax:
<Textbox Name="HeaderApprovedBy"> <Style> <TextDecoration>Underline</TextDecoration> <FontSize>12pt</FontSize> <BackgroundColor>Red</BackgroundColor> </Style> <Top>0in</Top> <Left>0in</Left> <Height>.5in</Height> <Width>1.5in</Width> <Value>Field Name Here</Value> </Textbox>
Parts of RDL or RDLC files include the following: Report
ReportItems Table TableItems