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

4

0 回答 0