RDLC XML Code for Design:
<?xml version="1.0" encoding="utf-8"?>
<Report xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition">
<DataSources>
<DataSource Name="LMSDataSet">
<ConnectionProperties>
<DataProvider>System.Data.DataSet</DataProvider>
<ConnectString>/* Local Connection */</ConnectString>
</ConnectionProperties>
<rd:DataSourceID>dc9db719-e783-439b-8a6a-21c2d68ef8d9</rd:DataSourceID>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="LabelDataSet">
<Fields>
<Field Name="SlNo">
<DataField>SlNo</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="TITLE">
<DataField>TITLE</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="MEMBNO">
<DataField>MEMBNO</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="NAME">
<DataField>NAME</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ADDR1">
<DataField>ADDR1</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ADDR2">
<DataField>ADDR2</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="CITY">
<DataField>CITY</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="ROAD">
<DataField>ROAD</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="PHONE">
<DataField>PHONE</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="PIN">
<DataField>PIN</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>LMSDataSet</DataSourceName>
<CommandText>/* Local Query */</CommandText>
</Query>
<rd:DataSetInfo>
<rd:DataSetName>LabelManagementSystem</rd:DataSetName>
<rd:TableName>AddressDetailsDataTable</rd:TableName>
<rd:ObjectDataSourceType>LabelManagementSystem.LMSDataSet+AddressDetailsDataTable, LMSDataSet.Designer.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</rd:ObjectDataSourceType>
</rd:DataSetInfo>
</DataSet>
</DataSets>
<Body>
<ReportItems>
<Tablix Name="Tablix2">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>2.67717in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>1.3061in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Rectangle Name="Rectangle1">
<ReportItems>
<Tablix Name="Tablix1">
<TablixBody>
<TablixColumns>
<TablixColumn>
<Width>2.67717in</Width>
</TablixColumn>
</TablixColumns>
<TablixRows>
<TablixRow>
<Height>1.1811in</Height>
<TablixCells>
<TablixCell>
<CellContents>
<Textbox Name="Name">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>=System.Environment.NewLine+System.Environment.NewLine+ trim(IIF(Fields!MEMBNO.Value="","",Fields!MEMBNO.Value)) +UCase(trim(IIF(Fields!NAME.Value="","",System.Environment.NewLine+Fields!TITLE.Value+". "+Fields!NAME.Value)) +Trim(IIF(Fields!ADDR1.Value="","",System.Environment.NewLine+ Fields!ADDR1.Value))+Trim(IIF(Fields!ADDR2.Value="","",System.Environment.NewLine+ Fields!ADDR2.Value))+Trim(IIF(Fields!ROAD.Value="","",System.Environment.NewLine+ Replace(Fields!ROAD.Value,",",""))) +Trim(IIF(Fields!CITY.Value="","",System.Environment.NewLine+ Replace(Fields!CITY.Value,",","")))+Trim(IIF(Fields!PIN.Value="","","-"+Replace(Fields!PIN.Value,",",""))))</Value>
<Style>
<FontFamily>Times New Roman</FontFamily>
<FontSize>9pt</FontSize>
</Style>
</TextRun>
</TextRuns>
<Style />
</Paragraph>
</Paragraphs>
<rd:DefaultName>Name</rd:DefaultName>
<Style>
<Border>
<Color>White</Color>
<Style>Solid</Style>
</Border>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="ColumnGroup">
<GroupExpressions>
<GroupExpression>=RowNumber("list1_Details_Group")</GroupExpression>
</GroupExpressions>
</Group>
</TablixMember>
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<TablixMembers>
<TablixMember />
</TablixMembers>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<KeepTogether>true</KeepTogether>
<DataSetName>ListDS</DataSetName>
<Height>2.99999cm</Height>
<Width>6.80001cm</Width>
<Style>
<Border>
<Color>White</Color>
<Style>Solid</Style>
</Border>
<Color>White</Color>
</Style>
</Tablix>
</ReportItems>
<KeepTogether>true</KeepTogether>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Rectangle>
</CellContents>
</TablixCell>
</TablixCells>
</TablixRow>
</TablixRows>
</TablixBody>
<TablixColumnHierarchy>
<TablixMembers>
<TablixMember />
</TablixMembers>
</TablixColumnHierarchy>
<TablixRowHierarchy>
<TablixMembers>
<TablixMember>
<Group Name="list1_Details_Group">
<GroupExpressions>
<GroupExpression>=Ceiling(RowNumber(Nothing)/3)</GroupExpression>
</GroupExpressions>
</Group>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
<KeepTogether>true</KeepTogether>
<DataSetName>LabelDataSet</DataSetName>
<Left>1.28796cm</Left>
<Height>3.31749cm</Height>
<Width>6.80001cm</Width>
<Style>
<Border>
<Style>None</Style>
</Border>
</Style>
</Tablix>
</ReportItems>
<Height>33.91957cm</Height>
<Style />
</Body>
<Width>8.08797cm</Width>
<Page>
<PageHeight>29.7cm</PageHeight>
<PageWidth>21cm</PageWidth>
<LeftMargin>2.54cm</LeftMargin>
<RightMargin>2.54cm</RightMargin>
<TopMargin>1.27cm</TopMargin>
<BottomMargin>1.27cm</BottomMargin>
<Columns>3</Columns>
<ColumnSpacing>0.3cm</ColumnSpacing>
<Style />
</Page>
<rd:ReportID>a4333754-f838-4002-9f3b-41e041186bf6</rd:ReportID>
<rd:ReportUnitType>Cm</rd:ReportUnitType>
</Report>
Codebehind C#:
private void FillReport(DataTable dt)
{
reportViewer1.ProcessingMode = ProcessingMode.Local;
reportViewer1.LocalReport.ReportPath = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\Sowhridam.rdlc";
reportViewer1.LocalReport.DataSources.Add(new ReportDataSource(reportViewer1.LocalReport.GetDataSourceNames()[0], dt));
this.reportViewer1.RefreshReport();
}
No comments:
Post a Comment