salhaber Posted March 16, 2017 Posted March 16, 2017 I have two reports in jaspersoft studio based on two different CSV files with different columns and both runs normally.I want to include one of them as a subreport of the other, when I drag and drop the subreport element into the detail section and choose the report as my source it creates a dataset and ask me for the dataset data source, what should be the data source in my case? I cannot set it to $P{REPORT_DATA_SOURCE} because it will take the data source of the main Report and not the Subreport which has different CSV/columns.The subreport can be linked to the main report by a common column which is a key column in the CSV.My only problem is what should be the data source of the Subreport?
Solution reportdev Posted March 16, 2017 Solution Posted March 16, 2017 When you drag the subreport, the subreport element asks for the Report Connection. Report Connection is not a dataset. its just an initiator for your subreport. Usually $P{REPORT_CONNECTION} is the report connection that works.In order to achieve your requirement.Create a subreport first by using your csv datasource in the studioPlace your csv datasource on the server repository and copy the path to itThe path should be pasted in the default data adapter section of your subreport. this way whenever the subreport get initiated it does not look for the main report jdbc connectionPublish the subreport and test if the subreport works fine with the default csv data adapterPut your subreport in the main report and pass the parameters to it.
werther_1 Posted July 27, 2018 Posted July 27, 2018 I have the same problem. I followed the instructions below, my subreport works fine with the csv as the default datasource, but when I embed it into the main report, it simply does nothing. The subreport prints no data at all. The last tip below says: Put your subreport in the main report and pass the parameters to it. I ask, what parameters?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now