Database Reference
In-Depth Information
Figure 8-10. Solution Property Page
Creating a Subreport
Your report is called Documents, but it displays users—and that's why you're going to add a subreport.
You want to display all documents for the related users (one user can have multiple documents). To do
this, you need to create another report and, along with it, a new data source and dataset. This time,
however, you want to pull the documents from your on-premises database. Thus, the users come from
SQL Azure, and the related documents from your on-premises database. Follow these steps:
1.
You need to create the subreport to display the documents. Using the steps outlined
earlier in this chapter, create a new report and an associated data source and dataset.
For this exercise, the name of this new report doesn't matter. The data source should
be pointed to the local, on-premises copy of the database, and the dataset should be
the same as the dataset for the Azure-based report.
2.
With the new report open in Design mode, create a new data source that points to
your local (on-premises) copy of the TechBio database. This new data source can use
a different authentication method if you like, such as Windows Authentication
(integrated security).
3.
Create a new dataset based on this new data source. On the Query page in the
Dataset Properties dialog, select the data source you just created, and use the Text
query type. Enter the query shown in Figure 8-11: it pulls from the Docs table, and
you need to apply a filter so that it gives you only the documents for the associated
user. You want this to be dynamic, so your filter uses a parameter that you define
shortly.
Search WWH ::




Custom Search