Database Reference
In-Depth Information
Create a Shared Dataset
Along with our shared data source, we want a shared dataset as well. Let's create one now.
1.
Right-click the Shared Datasets folder in Solution Explorer and choose the Add new
Dataset option from the context menu (Figure 16-18 ).
2.
When the Shared Properties dialog window appears, type
DatasetvQuantitiesByTitleAndDate into the name textbox (Figure 16-19 ).
3.
Use the Data Source dropdown box to select the DataSourceDWPubsSales Data
Source (Figure 16-19 ).
4.
Type the SQL code found in Listing 16-3 in the Query textbox.
Listing 16-3. SQL Code for the DatasetvQuantitiesByTitleAndDateDataset
SELECT
PublisherName
, [Title]
, [TitleId]
, [OrderDate]
, [Total for that Date by Title]
FROM vQuantitiesByTitleAndDate
5.
Close the dialog window by clicking oK to complete the creation of the shared
dataset.
Important: The view that the SQL code uses was created in Chapter 13 , but if you do not have
it already in your database, you can open the SQL script file C:\_BookFiles\Chapter16Files\
ViewAndStoredProcedureForChapter16.sql and execute its code to create it.
Create a Basic report
next, we need to add a report to the project and configure it to display the report data in a tabular format.
1.
Add a new report to the project by right-clicking the Reports folder in Solution
Explorer and selecting new Item from the context menu (Figure 16-20 ).
2.
When the Add new Item dialog window appears, select the Report icon, as shown in
Figure 16-21 .
3.
Configure the name textbox with the filename of SalesByTitles.rdl . Then click the
Add button to add a new report to the project.
4.
once the Report Designer window appears, use the View menu to display both the
Report Data and Toolbox windows (Figure 16-22 ).
5.
In the Report Data window, right-click the Datasets folder and select Add Dataset
from the context menu.
6.
When the dataset Properties window appears, name the dataset
DatasetSalesQtyByTitles , select the Use a shared dataset” radio button, and
select DatasetvQuantitiesByTitleAndDate, as shown in Figure 16-23 . Finally, click oK
to close the dialog window.
Search WWH ::




Custom Search