I would like to create a header file that can be used on several reports in Jasper that are loaded on the JasperServer. In turn I would like to update this header file in one location which inturn will update all the reports in Jasper without having to manually go into each report to update it.
Here are things I have tried: create a header file and load it to the repository as a jrxml file. On my report reference the jrxml file as a subreport in the subreport expression.
Create a header file and load it to the repository as a report. On my report reference the report as a subreport in the subreport expression. I get net.sf.jasperreports.engine.JRException: Error opening input stream from URL in both cases.
Must the header file to referenced within the report and loaded to the resource folder or can the header file be referenced outside the report but still in the same location on the repository as where the report resides? Most information I have found says it must be loaded as a resouce under the report. I would like to use this header file on several reports and be able to update the header file once and the reports using this file will also get updated. If I have to load the header file as a resource under each report then this defeats the purpose of updating the file in one location.
For any that are wanting a solution, this is what I ended up doing. I created the header file first and saved it on my local machine. I also loaded the file as a jrxml file to the repository. On my report I add the header file as a subreport. Load the report to the repository and it creates a resource with the subreport. Then I log into Jasper server, search for the report in the repository, right click and edit. I go to control & resources, click on the name of the subreport, this brings me to another page where I can select a file from the repository. I search in the repository for the .jrxml file that I had loaded, save and submit. This replaces the subreport in the resources under the report to the file that is stored directly on the repository and creates a linked file. If I go back into iReports and look at the subreport under the reports resource folder there is an icon with a chain link next to the name of the subreport. Now when I make a change to the file, it will update in my report.