thegametimemachine Posted March 13, 2014 Share Posted March 13, 2014 I have a small app that handles inventory for projects. The database I am using is Mongodb. In one collection I have the following fields._idproduct_codepriceqtylocationproject <-- ObjectId(Holds a specific projects _id) The project schema has the following fields:_idproject_numproject_namemanageractiveThe report that I have now generates all of the inventory based on the first collection. Only problem now is that I would like to have the project number, name and manager on the report page header aswell.I was thinking about creating a dataset with a query to the projects collection using the projects field from the main report, but I have no where to start and I cant just use $F{project} in the query..doesnt work. If someone has some time to help me it would be greatly appreciated.. Thank you Link to comment Share on other sites More sharing options...
hishamkmr Posted March 13, 2014 Share Posted March 13, 2014 HI, You can creat a subreport and place some where in the main report and make it hidden with some label box or something.Pass the variable F{Project} to subreport and using this id retireve project_num, name and manager.Then return this three into three other varibale declared in main report. Display it in the title. I think this will work.Let me know. ThanksHisham.A Link to comment Share on other sites More sharing options...
thegametimemachine Posted March 13, 2014 Author Share Posted March 13, 2014 I cant seem to find a "how to" on passing fields(parameters) from and to subreports. I am using ireports. Could you point me to a tutorial or document with instructions on the above? Thank you Link to comment Share on other sites More sharing options...
marianol Posted March 13, 2014 Share Posted March 13, 2014 You can easily pass the parameters to the subreports from the main report and viceversa . For this you can go to the properties of the subreport and there in the end you can find Parameters. Now in here you can click add and specify the name of the parameter of the subreport which would recieve the value from the main report , basically you need to map the parameters of subreports and the main report. If you want to pass the data from the subreport to the main report then you need to specify the Return values in the properties of the subreport and do the same mapping there. Look at this tutorial http://community.jaspersoft.com/wiki/subreports-jaspersoft-studio#Creation_of_the_First_Subreport Link to comment Share on other sites More sharing options...
hishamkmr Posted March 16, 2014 Share Posted March 16, 2014 Hope ur issue is resolved with above comment form marianol Link to comment Share on other sites More sharing options...
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