0

How to create a report with DataSet object?

Hers is my existing approach,

  1. Create the connection String.
  2. Create the Query String.
  3. Write the RDL file manually using XMLWriter with the above details, like

    <DataSources>
        <DataSource Name="MyDataSource">
            <ConnectionProperties>
                <DataProvider>SQL</DataProvider>
                <ConnectString>My Connection String</ConnectString>
                <IntegratedSecurity>true</IntegratedSecurity>
            </ConnectionProperties>
            <rd:SecurityType>Integrated</rd:SecurityType>
            <rd:DataSourceID>MY Data Source ID</rd:DataSourceID>
        </DataSource>
    </DataSources>
    <DataSets>
        <DataSet Name="MyDataSet">
            <Query>
                <DataSourceName>MyDataSource</DataSourceName>
                <CommandText>My Query String</CommandText>
            </Query>
            <Fields>
                <Field Name="MyField1">
                    <DataField>MyField1</DataField>
                    <rd:TypeName>Type</rd:TypeName>
                </Field>
                <Field Name="MyField2">
                    <DataField>MyField2</DataField>
                    <rd:TypeName>Type</rd:TypeName>
                </Field>
            </Fields>
        </DataSet>
    

  4. Convert my .rdl file into a byte stream.

  5. Load the report to the Report Server using CreateReport method in the ReportingService.

    This is working fine for me, Now i need to do like the following,

    I have a DataSet object (System.Data.DataSet) i want to create the report/.rdl using this DataSet. So, there will be no connection string to this data set object, or is there any approach to do with data set object.

    Kindly help me

Thorin Oakenshield
  • 14,232
  • 33
  • 106
  • 146
  • Use RDLC report, not RDL report. RDLC stands for client and is more meant to be created in Visual Studio than RDL which is a 'hosted' report more to be created in BIDS and then hosted and consumed later. You will have much more ease using code behind to create reports based on POCO objects, ADO.NET datasets, or Entity models than trying to jerry rig something with the RDL langauge directly in XML. – djangojazz Aug 26 '13 at 16:50
  • This site may help: http://www.codeproject.com/Articles/473844/Using-Custom-Data-Source-to-create-RDLC-Reports – djangojazz Aug 26 '13 at 16:53

0 Answers0