Through the first two documents [SSRs] entry (1) -- create an SSRs project and [SSRs] entry (2) -- after creating a data source,
We have created an SSRs project and obtained the data source. The next step is to know what data is to be displayed in the report. This step can be achieved by creating a dataset.
1. Solution Explorer-> right-click shared dataset-> Add new dataset:
2. In the shared dataset Properties window, enter the dataset name adventureworksdataset. Select adventureworks2012 created before the data source. Query type: text. In the query file box, enter:
Select soh. orderdate as [date],
Soh. salesordernumber as [order],
PPS. Name as subcat,
Pp. Name as product,
Sum (SD. orderqty) as qty,
Sum (SD. linetotal) as linetotal
From sales. SALESPERSON sp
Inner join sales. salesorderheader as Soh on sp. businessentityid = soh. salespersonid
Inner join sales. salesorderdetail as SD on SD. salesorderid = soh. salesorderid
Inner join production. Product as PP on SD. productid = pp. productid
Inner join production. productsubcategory as PPS on pp. productsubcategoryid = PPS. productsubcategoryid
Inner join production. productcategory as PPC on PPC. productcategoryid = PPS. productcategoryid
Group by PPC. Name,
Soh. orderdate,
Soh. salesordernumber,
PPS. Name,
Pp. Name,
Soh. salespersonid
Having PPC. Name = 'cloth'
PS: You can use the "query designer" to select a table for design:
You can also write SQL query statements in SSMs (this method is preferred ):
3. Database: adventureworksdataset is created.
Next section describes how to display table data to a report. Original article from: [http://msdn.microsoft.com/zh-cn/library/ms170625.aspx]