SSRS report: "Error: Subreport could not be shown"

I have 2 reports that run. When I try to add the 2nd report into the 1st report as a subreport, I get an error “Error: Subreport could not be shown.” when the report is run. I have been able to create a report with a subreport in the the past. Does anyone have instructions or a workshop or link to a recording of how to add an SSRS subreport so that I can review the basics again.

I can run reports TimePhase2 and TimePhase3 separately. When I try to add TimePhase3 as a subreport on TimePhase2 with parameters: TableGuid and PartNum the report fails.

TimePhase3 000300.pdf (9.6 KB)

TimePhase2 000300.pdf (32.6 KB)

I’ve found that the path to the subreport gets fouled sometimes. Sometimes it needs the full path to its locaction, and other times it needs to be relative to parent reports location.

2 Likes

Try looking at your SSRS Report Server log file. I have found they are pretty descriptive and have pointed me in the right direction.

Usually located on your SQL server at C:\Program Files\Microsoft SQL Server\MSRS13.YOURSQLServer\Reporting Services\LogFiles

Epicor Support’s response:
BAQ Report Designer reports cannot have a subreport

I didn’t know this! Did anyone else know this?
~Gina

2 Likes

I dont believe thats entirely correct. Maybe a BAQ only creates a single dataset, but you definitely able to have subreports (with their own embedded datasource and dataset) in the RDL of a BAQ Report.

1 Like

Calvin is correct, you should be able to have no problems with a subreport from a BAQ. Remember unlike Crystal where a sub-report is embedded in the main report in SSRS a subreport is nothing more than another SSRS Report being referenced during run time in a set location.

3 Likes

Thanks for the encouraging feedback, Calvin and Alex. Anyone of you have an example to share?
Thanks,
Gina

First make the subreport in SSRS.

  1. In SSRS Builder, File → New, blank report

  2. Add New Datasource
    image

  3. In Data Source Props
    image

  4. In Connection Props:


    (Note that #2 is the DB of the source data, not a report DB)

  5. Back in Datasource Props, Test Connection , then OK.

  6. Add Dataset
    image

  7. In Dataset props:

  8. In Query Designer build the query to get the data of your subreport. Here’s an example to query the Part table, with PartNum being a paramter (which will be passed from the main report)

I’m guessing you could even copy the Query phrase from BAQ Designer, and paste it right into the query phrase expression.

  1. make the rest of your subreport

Now in your main report, reference that subreport you created, and set the relationships/links.

3 Likes

This is great! Also, since you are on Premise may i suggest using Data Tools instead of Report Builder, it will allow you to see all your objects in one solution and test them as you are developing.

1 Like

You are awesome! Thanks for detailed instructions. I’ll give it a try.
Mahalo!
~Gina