SSRS reports from multiple queries - reporting-services

I am trying work on a requirement using SSRS 2008 R2. The requirement is to create a detailed report which has main query(dataset1). And a column in this main query is used as a join or input to another query(dataset2).
I am trying to create a parameter and get the value for this from the main query or dataset1. How do I assign this parameter to dataset2? Also I will have similar situation to create dataset3, dataset4 etc and all this sub queries needs to be joined to dataset1.
Can you please help me what is the best way to do this?

In Dataset2, use a SQL variable in your query. SSRS will create a report parameter for you. Then go into this new report parameter and tell it that its available values should come from Dataset1.
Then repeat for the other datasets. :)

Related

Create a Report Based On a Parameter Query

I have an Access application that has been running for years now. It's a payroll system. There's a query (let's call it Query3) that pulls data from 2 crosstab queries. Everything worked fine until when I introduced a parameter in the crosstab queries. The parameter refers to a date on a form. Now I can't create a report with Query3 as its record source. When I use Report Wizard and I select Query3 as its record source the field names are not displayed. I have a sub that programmatically creates a report based on Query3 but now with the parameter this fails too. I'm really stumped. Is there any workaround? Thanks in advance for your help.
Are you using the Forms!MyForms!MyControl syntax as the parameter in the Crosstab subs? The problem seems to be related to Access not finding the control .
One thing I have done in the past is, if possible, is to remove the crosstab parameters and instead set the SQL of the crosstabs before running the report. So for example:
CurrentDB.QueryDefs("CrossTabSubName").SQL - "SELECT * FROM TABLE WHERE MyParam = 'A'"
If you have a button or something that launches the report, this may be an convenient place to do this. If the parameter is on the same form (i.e. a report filter), then this approach is simple to implement. In this example, the value of 'A' is a control on the form that allows th user to filter the report.

SSRS Pass parameter / Field value from 1 table to another

I am using SSRS 2012.
I have two datasets. I have two tables.
The first table contains a contract Id which is used as parameter in the second dataset.
I want to set the parameter as the contractId (ie Fields!ContractId.Value, or ReportItems!Contract1.Value) or something like that but nothing works because of different limitations.
If I would be using a subreport that would have been easy just pass the Field!Contract.Value from the 1st dataset as the parameter for the second and there you go. But since we want to call the report using SQL server agent, I cannot use subreport since the agent is limited and does not accept subreport.
So I believe my only option is to use two different tables, but I still need the value from the first dataset. Also, I don't think LookUp() would work for me as I do not have Ids.
Does anyone already did something like that?
Thanks for any help.
You can create report parameters in which the available values are pulled from a query.
Then just use the parameter in your second data set.

SSRS 2005 page break per report

I have a specific type report that I need to generate multiple copies of. What I want to do is pass a string of report IDs to SSRS and generate all of the individual reports (let call them subreports) with those IDs in one master report with each subreport on a new page. I've already tried making a subreport and placing it in a table with grouping. This worked the closest so far. It gave me all the pages I needed, but it generated the report for the first ID number over and over. Is there anyway to do this or am I gonna have to jump through a lot of hoops?
If you are passing the string of report IDs to a parameter on the master report, I think using a table and subreport should work. You'll need a way to split out the report IDs using a dataset on the master report and return them one per row (so you can pass each report ID individually to the subreport via the details row of the table).
I was going to recommend a table-valued parameter for this, but since they don't exist in SQL Server 2005 check out Arrays and Lists in SQL Server 2005 by Erland Sommarskog for a few other options.

Get data from a subreport into the main report

I have made one main report containing a few subreports. At the end I would like to compare some figures from the different parts of the report and also make some calculations with numbers received from the different parts.
Does anybody know a way to get values from the subreport into the main report? All calculations e.g. aggregates that will be made at the end refer only to the dataset for the main part and the other subreports have their own datasets, fetched from other tables.
I must second #JoaoLeal's comment, I think the method you propose (retrieving data from a subreport in the main report) is technically not possible.
However, there's another way to achieve what you want (show aggregate info on the data displayed in subreports). You could encapsulate your dataset queries in a way that they can be reused by the main report. There are two main/basic options:
Use a stored procedure to query the data
Use a database view for the data
Your datasets will be very simple: the subreports will select all the data. The main report can then either have a dataset query that aggregates data appropriately from the view / proc, or also retrieve all results and do the aggregation in SSRS.
I think in RDLC report there is no way for share variable between main report and subreport . So the only way is use another dataset or passing new vaiable. Hope this will help...
I have myself managed to achieve what I expected through using different datasets on the main form which also contains data for the sub reports.
But also I found this way (not tested):
[Reports]![YourReportName]![YourSubReportName]![TheValueFromTheSubReportYouWantToReference]
There is also a long discution about this on SQL Server Central.

Is nested DataSets possible in SSRS 2005?

Is it possible to have an outer table mapped to a dataset and use another table inside the outer table which maps to a second dataset,where the second dataset should take the feild value
from the first dataset(as parameter) to pull data?
Please comment
Thanks in advance,
San
You should be able to do this with a subreport. Pass in a parameter to use as a filter. If you're using a filter rather than a query parameter, it should be able to use the same Intermediate Report (ie, RDL + Data) for each subreport, thereby achieving your goal.
It's not possible. Reporting Services doesn't support multiple datasets. You'll need to get creative with your SQL to create a single dataset of all data.