Selecting multiple parameters for a report, how to create multiple pages per item in parameter list? - reporting-services

I have a report that is a form per order number selected prior to running report. I want to make it so that you can select multiple order_nos from a list (populated by a query that runs first). Right now, it throws an error saying ANY or ALL must be used. I think it is trying to use both order_nos as the parameter for the report. I want it to create the report using just one of the order_nos at a time, and just replicate the report several times. Is this possible?
The attached photo shows what I tried to do and the error thrown.
Error

If you want to create completely separate outputs then you will need to do this by creating a data driven subscription for your report.
The subscription will execute your report iteratively for each record produced in a preset master query that you create.
Each record in your master query should return all the order no's you wish to execute the report for.
However, if the report needs to remain interactive, and the order no's is only decided at runtime. Then i suggest you keep your report as is. Put a grouping on your tablix based on order no then apply a page break per group instance.
This will produce a single report output with each order no appearing on a different page.
As said above if you want a completely separate output (multiple excel/pdf file outputs) then you will need to use a data driven subscription.
If you need detailed steps on how to do either of the above then just let me know here and i can include steps.

Related

Is it possible to run a single record report on Multiple records from a view?

I have a report that pulls in a sub report and is run from within a single record on Dynamics CRM 2011. The report is built in SSRS 2008. It uses a parameter to find the id of the current record. The report runs fine from within each record which is what we need it to do.
There is now a requirement to also run the same report for multiple records, in essence printing out the results 1 record per page for multiple records.
I have tried to copy the report and sub report (making the relevant changes), find the multiple records list in an advanced find view, and then run the report on all the selected records in the view but instead of pulling the details for each record onto a single page and then the next record onto the next page, this method pulls all results for each field from all records and then all the results from all records into the next field.
I am assuming that the parameter that is in the original version single report to find the current record, when used with the advanced find list is pulling all of the id's for all of the records and then producing all of the results per field.
I have gone around in circles trying multiple ways of ending up with a report per record per page but I now need some help. If I remove the current id parameter I cannot work out how the report would pull the correct information together for each single record and the matching sub-report before moving onto the next record.
Is it possible to batch print a single report on multiple records selected from an advanced find view? and if so please could someone point me in the right direction.
I'm not sure how you're report is set up but you'll probably want to use a list to separate each instance of the report. Set it to Group by your ID field.
Then you put your current report items that you want generated for each item inside the list. The list will generate an instance for each ID.
It's a bit complicated sounding at first but not too difficult once you get the idea.
MSDN - Lists
SSRS generate same report for multiple values accepted as parameters
The list is like a rectangle that repeats.

SSRS - SubReport

I have a subreport I am trying to link into my main report. The main report pulls back information from one database and the subreport pulls from another. I could use lookup, but I lose the ability to format so I was hoping to achieve this with a subreport.
I enter a date range via my parameters, and let's say I get 30 client/matter codes back. It page breaks at the end of each row, so the data for each client/matter ends up on its own report. The goal is for me to output a large number of reports based on date ranges. The subreport pulls in folder names, and just like the other information, the folders for only that client/matter should be on that report.
What's currently happening is on each report, it just lists ALL of the folders for ALL of the client matters on each and every report.
I've tried making the subreport an adjacent group (which you can see in the screenshot) and grouping on Client code and then matter code. I've tried making the client code and matter codes internal parameters in both reports in the hope that it help filtered. I also tried just inserting the subreport into a cell inside the matter_code group but not as a group itself.
I apologize in advance if my explanation doesn't make sense. I'm having a hard time trying to put this into words.
From your explanation I would assume that you have a subreport in a group but you are not passing anything through to it. Have you tried passing through parameters to the subreport that uniquely define the customer and the customer folders?

Access - Modular reusable subreport

I would like to create a report which I can use as a sub-report multiple times on the same parent report. However, each occurrence of the subreport should have different values.
For instance, there is a table called DailyReport.
Records in this table contain:
Date, member, team, description
The sub reports should be for each team within a certain date range. However, the date range per subreport/team will not be the same.
So, if the date range for all teams was consistent, then I could create a single subreport, and do some Ordering on the resulting records to separate things out into teams.
However, with inconsistent date ranges, I can't utilize a single query, so the most straight forward solution I see is to create separate subreports and queries for each range of each team.
The problem with this solution is that if I decide to change the format of the subreports I must do so in each specific subreport--a lot of duplicate work.
I would like to create a generic query and subreport. The query and sub report would call VB functions which would return the relevant value.
This means my parent report has the same generic report on it multiple times. As each subreport is rendered, I would like to increment a value behind the scenes so that the functions which the generic query and subreport call know to return a different value.
However, it seems that's not how things work in Access. The subreports on a report are not rendered linearly. A subreport is created, and then "stamped" onto a report where ever required. This means that all of my generic subreports have the same data.
How can I define a generic report and query? Then plug in different values into the report and query while the report is being reused multiple times on the same parent report.
You need to look into the LinkMasterFields and LinkChildFields property of reports. They are designed for exactly this purpose -- to filter a subreport based on current data in the main report, without needing any code or even queries.
You are correct that LMF/LCF do not work on date ranges, only values. So use LMF/LCF for the team filter.
For the date range filtering, you can use an unbound form that launches the report as two parameters defined in the base query. Create frmLaunch, and add two text boxes minDate and maxDate. Set their Format property to Short Date so Access with interpret them correctly and provide the date pickers. Now modify the base query, adding two Date/Time parameters [Forms]![frmLaunch]![minDate] and [Forms]![frmLaunch]![maxDate]. Now, find your date field and set its criterion to Between [Forms]![frmLaunch]![minDate] and [Forms]![frmLaunch]![maxDate]. Add a button to frmLaunch that runs the code DoCmd.OpenReport "YourReportName", acViewPreview.
So, the goal was to make it possible to re-use the same sub-report multiple times on the same parent report, with full flexibility on how the subreport retrieves data.
I placed multiple instances of the same subreport on a parent report. On the subreports Open event I placed a line like
Me.Report.RecordSource = "SELECT * FROM someTable WHERE " & getCriteria()
nextCriteria()
Maybe its possible to pass a value that identifies which instance of the subreport is opening to the getCriteria function. Probably like a getCriteria(Me.Report.Name). But in this case I kept track of how many subreports had been produced in vb.
Unfortunately, if your subreport has controls which have a data source which is a vb function, all reports will show the same value for that control. To get around this I added something like getSomeValue() & "As [Some Value]" into the SELECT of the SQL statement above. Don't forget to add single quotes or hashes around getSomeValue() if you are passing a String or date.
That's basically it, it's a pain. But I couldn't find a more elegant way to do it.
Edit:
One major caveat I experience with doing this, is that although the print preview works correctly, when actually printing or exporting to PDF, some subreports would not be included. Maybe there is something else causing this...

How load the subreport data in a single database hit in SSRS?

I am using SSRS, the situation is that I am loading users in the Main report and I have created a sub-report to display the user addresses (there can be multiple addresses per user).
Now after adding the sub-report the report becomes considerable slow. My guess is that this is due to the fact that the Main report needs to fetch data for sub-report for each user in the list.
What I want to achieve is to load all the data for the sub-report in a single database hit and then just filter the records in the application. Is there a way to do this in SSRS reports?
If any other information is required then please let me know.
Thanks for your time.
If you want to do that then you should use grouping to achieve it. For example, have as your dataset query some Sql like:
SELECT User.Name, Address.StreetNumber, Address.Street, Address.City
FROM User
INNER JOIN Address ON User.Id = Address.UserId
ORDER BY User.Name
Then on your tablix add a Group (right-click on the handles on the right of the tablix to add a group) to have a row showing the user details then in the Detail group add the addresses (you can add more detail rows if needed to format it nicely again by using the tablix handles).
This will show the user then show all the addresses for the user, then show the next user and so forth.
you could consider using a shared dataset and enable caching on the properties (to be done on the SSRS itself)

SSRS - filter existing dataset

I have a report that uses parameters. The default parameters are defaulted to contain all available values, so by default the report the contains all possible data.
I want the user to then be able to deselect some of the values in the parameters, and to refresh the charts in the report, so they can drill down to the data that interests them.
But each time the report is refreshed, it runs the query again, slowing down the process.
Is there a way to allow the user to filter the data in the charts, without re-running the query?
I did find this, but it seems that he also didn't get a solution, or I didn't understand how the solution would work.
http://social.msdn.microsoft.com/Forums/en-US/0f905bdb-b8f2-4d9d-ac5b-e85d2f94f0cf/textbox-action-to-filter-existing-dataset-rather-than-rerun-query
To keep the query from running again, two high level steps must happen:
1) Make sure that your filters(parameters) are not included in the query. The query needs to be identical, no matter what the user has selected for a filter. This is done by moving the filters into the report. You can set them up as the filter on the tablix or on the row groups that are displaying the data.
2) Set up caching for the dataset. The easiest way to do this is by pulling the data set out of the report and create a "Shared Dataset." when you upload that to SSRS, define the dataset caching: maybe set it to last an hour. Connect the report to the shared dataset as well.
The full details of this can fill an article, such as http://www.mssqltips.com/sqlservertip/1919/how-to-enable-caching-in-sql-server-reporting-services-ssrs/ (for an old version of SSRS, but these concepts haven't changed much.)