October 14, 2010 at 11:30 am
I have two reports that query the same data with the same date range.
My question is, can the second report be embedded as a sub report to the first report (I think that's possible, pretty sure anyway) and use the same recordset of the first report to iterate through for it's data?
My goal is to only query the SQL DB only once instead of twice, or three times, depending on how many sub reports.
Let me know if I was unclear in my description because this is gets confusing. :hehe:
October 14, 2010 at 11:38 am
If the second subreport is not embedded in a tablix, but just in a rectangle on the report it will only be called once. If you have a dataset where lets say you had the first_date and last_date repeated as columns on every row of your report, then you could pass that data to the subreport by saying =First(Fields!Start_date.value()). However, why not just pass the parameters used in the first report to the 2nd report? in the window where you specify parameters to be used in the subreport, just say [@start_date] for what value to pass to the start_date param in the subreport and [@end_date] for the end date.
Hope that's clear, and if not let me know.
October 14, 2010 at 12:03 pm
So your saying that "If the second subreport is not embedded in a tablix" it shouldn't re-query SQL for the same recordset and the subreport will use the first reports recordset of data?
Passing over the start and stop date range isn't an issue. It's the re-querying I don't like. These were previously Crystal Reports .rpt file converted to SSRS (.rdl).
October 14, 2010 at 1:03 pm
Warren Peace (10/14/2010)
So your saying that "If the second subreport is not embedded in a tablix" it shouldn't re-query SQL for the same recordset and the subreport will use the first reports recordset of data?Passing over the start and stop date range isn't an issue. It's the re-querying I don't like. These were previously Crystal Reports .rpt file converted to SSRS (.rdl).
Ah, ok I understand you better now. To make it query the dataset a single time, you will have to somehow combine the subreport into the first report, either through a second tablix or just a rework of the original. So if you use the same data set, and the 2 reports just format/group it differently, you can still do the same behavior in one report, just use 2 tablixes to do the grouping differently. To answer how you would go about that specifically, can you describe the difference between the 2 reports? does one group differently from the other?
February 4, 2011 at 11:04 am
I believe i have the same problem....i think....for example 2 incidents occur, 2 separate reports are sent, instead of having a report sent every single time the same problem occurs, all occurrences of that same problem are contained within one report, does that make sense? anyway heres the syntax....
USE [magictsd]
SELECT * FROM [dbo].[DailyReportView]
WHERE [Subject Description]<>'ALM False Detect'
AND [Subject Description] <> 'Auto Generated Ticket'
AND [Subject Description] <> 'Intentional Silence'
AND [IncidentStartTime]>=%s
AND [IncidentStartTime]<=%e
ORDER BY [IncidentStartTime] ASC
Now what would need to be done...
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply