Wednesday 18 February 2015

Dataset


1   2   3   4   5   6   7   8   9   10   11   12   13   14   15   16


     Dataset is necessary to create a report. In the dataset we need to write a query to fetch required data from the Database. We can create a dataset in two ways.

  • Shared Datasets
  • Datasets

Shared Datasets:
   If we create a 'Shared Dataset ', that one we can call it into the reports which are present in the same solution.

  • Go to "Solution Explorer" (In the report designer Right side).
  • Right click on the "Shared Datasets", then 'Add New Dataset' option will come.
  • Select the "Add New Dataset". Then "Shared Datase Properties" window will open.
    • Name: We can give required name for the Dataset
    • Data Source: From the drop down list we can select required data source. If you don't have data source then using 'New..' button we can create New Data source.
    • Query type: we can select required check box.
    • Query: We can write or copy past into the text box. else we can create auto generated query using "Query Designer" button.
  • Query Designer: Click on "Query Designer.." Button. Then  "Query Designer" window will open.
  • Click on Add button (Highlighted in the above screen) to add required tables.
  • 'Add Table' window open. Select the required tables and click on "Add" button, then tables will add. After adding the required tables close the "Add Table" window.
  •  Select the required columns, then after click on "OK" button.
  • Click on "OK" button.
  • Data set is created.



Datasets:
   If we create a 'Dataset' under "Datasets", that Dataset we can use it in that particular report only.
  • In the report designer Left side, select "Report Data" section.
  • Right click on "Datasets" and select "Add Data Set"
  
  • Dataset property window will open.
    • Name: We can give required name for the Dataset.
    • Use a shared dataaset: If you want to use shared Dataset then select this check box then it will display available shared Datasets. Select the required shared Dataset and click on "OK" button.
    • Use a dataset embedded in my report: If we need to create new report level dataset then we can select this check box.
  • Select "Use a dataset embedded in my report" check box.
  • Data source: we can select required data source from the dropdown list or we can create new data source using "New.." button.
  • Select the required "Query type" check box.
  • Query: We can write the query in the query text box or we can use "Query Designer.." button to generate query.
  •  Click on "OK" button.
  • Dataset is created.


No comments:

Post a Comment