Monday, October 7, 2013

SSRS:Creating SSRS Subreports

------------------------------------------------------------------------------------------------------------------------


Refer the Source Video: Creating SSRS Subreports

------------------------------------------------------------------------------------------------------------------------

Summary:

Create one report. Then to that report drag "Sub Report" control , right click and in the 
properties specify which report you want to show. Here choose "Parameter" section and 
pick the "parameter" , say the parameter of first report "@region" and the sub report also
need to filter data based on that.

------------------------------------------------------------------------------------------------------------------------


Main report – Sub Report:( allow to pass parameters)

1.DataSet:change sql :where countryregioncode=@CRC , also choose Parameter.,but no value their.Then under Parameter- see CRC then check in DataSet , the Parameter value , it will show now @CRC.
2.Solution Explorer->Report->New Item->Report

Report Data
----------------
Built-in Fields ,Parameters,Images,Data Sources,Data Sets

Data Source:create a new connection string.Edit button
Data source:Microsoft SQL Server (SqlClient) Server name:
-Use Windows Authentication – Use SQL Server Authentication
Connect to database

After creating the conection – go to DataSet ,in “Options” specify the Data Source.
Click on Query Designer from the above screen window, choose Table, here the
sql shows like Select TOP 10 ….

In the Datasets , choose parameters and in WHERE clause introduce the parameters
CountryREgionCode=@CRC

3.Design of Report- View Toolbox – Drag a Table – From DataSet which shows the
Fields , Just drag & drop as Table fields.

4.Call another Report.From the same View-Toolbox , just drag the “SubReport”
control to the Report Design View.Right click on sub report and choose 'Sub Report
Properties”, From the dropdown choose which report to use as subreport.
Choose “Paramer” ,choose @CRC, so from main report the parameter is passed to

the subreport.

No comments:

Post a Comment