I have deployed a report ("Mainreport") with subreports on Jasper Server 6. It works. Now I have another report ("SecondReport") which has Mainreport as subreport. I don't want to deploy Mainreport a second time with SecondReport. Instead I want SecondReport to find Mainreport at its original location. I tried several variants of repo:\pathtoreport\Mainreport.jrxml and repo:\pattoreport\Mainreport_files\Mainreport.jrxml. It doesn't work, I always get "Repository file resource ... could not be loaded". Who can help?
You cannot reference a deployed report unit in your report design as a sub report. A deployed report unit is a JRS repository resource which consists of report design (JRXML) and report resources and controls. The subreport is represented by an external Jasper file reflecting the report design JRXML, not the deployed JRS resource unit.
If you want to share the same report design for different deployed report units, you will need to first deploy the report design as a JRXML file resource into JRS, then reference this resource as the main or subreport JRXML design templates for each report unit deployment.