Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SRS Subreport Question - Converting Crystal to SRS

Status
Not open for further replies.

OLAPMike

MIS
Aug 10, 2010
2
US
I am new to SRS and I am converting some Crystal reports over to SRS. In Crystal it is easy to create with reports with subreports that have a Header/Detail layout, in other words, for each record in the main report (header) the subreport detail lines display directly underneath. When I am creating subreports in SRS, I am getting all of the header records together and below that I get all of the subreport records together. How can I get SRS to to process the subreport like Crystal?

Example
Crystal Format:

Header Record 1
Detail Record 1
Detail Record 2
Detail Record 3

Header Record 2
Detail Record 4
Detail Record 5

SRS Format I am getting;

Header Record 1
Header Record 2
Detail Record 1
Detail Record 2
Detail Record 3
Detail Record 4
Detail Record 5

I am sure it something simple but extensive google searching yielded no hits. Thx.
 
You don't need a subreport for that. Just add a group to your tablix with a group header.
 
I don't think that would work. The header records and detail records come from separate tables. The detail records must be queried based on the data in the header record. I cant get all the records (both header and detail) in one query without resorting to a convoluted union query or crosstab.
 
One thing I liked about Crystal Reports was the On-Demand subreports -- running a subreport within the same page at runtime. SSRS does not have the same functionality, although it is possible to link over to other reports. Because of this, I have tended to stay away from subreports within SSRS. It's simply more convenient to either bring all of the data into one DatSet for a particular tablix, or link over to another report.

That being said, if you need to use a subreport, it looks like you are embedding your subreports into the incorrect section. Based on your example, it looks like you are showing your main rows first, and then your subreport. It's difficult to offer specific advice without seeing the RDL, but you should probably add a new line within the same context of your Header rows -- whether that's in a group or details. Then, in this new line, embed your subreport, while being sure to link the parameters of your subreport to your DataSet fields.

Assuming your Tablix has no groupings, and your Header records are coming through in the Details section of the Tablix, your design-time layout would look like this:

Code:
[Details Section Row 1]  =Fields!SomeFieldFromHeader.Value
[Details Section Row 2]  {Embed subreport here}
[Total Row]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top