richard.savage_1 Posted March 2, 2015 Share Posted March 2, 2015 HelloI'm using Jasper Studio 6 to design my reports and I have come up against problem that is driving me mad!My report contains a number of fields (contractName, contractNumber, contractDescription etc.) and a table based on a dataset containing 2 fields (contractNumber, contractDocuments).When I preview the report, the contract documents are shown on all records, not the one contract record they belong to. How do I stop that happening?e.g. contract1 table is blank, contract 2 table contains the document entries?Thanks for any help!Richard S UPDATEI have fixed the issue now, by adding the parameter to the main report and another to the dataset query, mapping them together and a fair bit of jiggery pokery!Thanks for your help and pointing me in the right direction. Link to comment Share on other sites More sharing options...
minaeimi Posted March 3, 2015 Share Posted March 3, 2015 Hi RIchard,Are you using sub-report component? Link to comment Share on other sites More sharing options...
richard.savage_1 Posted March 4, 2015 Author Share Posted March 4, 2015 Hi there,No, I am using a table element. Link to comment Share on other sites More sharing options...
AnnMary.Thomas Posted March 5, 2015 Share Posted March 5, 2015 What I understand is the query for the table will have param which takes the contract number and fetches the record. Have you defined a parameter under your dataset and passed the parameter value from the main report Link to comment Share on other sites More sharing options...
richard.savage_1 Posted March 5, 2015 Author Share Posted March 5, 2015 Yes, I created a parameter called 'contractNumber' which contains the following: $P{contractNumber}.equals($F{contractNumber}) I then created a parameter on the dataset called 'table_contractNumber' which contains the following: $P{table_contractNumber}.equals($P{contractNumber}) The dataset is an aggregate query where I unwind fields from a MongoDB array if that makes a difference? Thanks Link to comment Share on other sites More sharing options...
AnnMary.Thomas Posted March 5, 2015 Share Posted March 5, 2015 Are u doing this "$P{contractNumber}.equals($F{contractNumber})" or $P{contractNumber}=($F{contractNumber}). Your table dataset query should have a condition where contractNumber=$P{contractNumber} Link to comment Share on other sites More sharing options...
richard.savage_1 Posted March 5, 2015 Author Share Posted March 5, 2015 Hi, I have been working through a number of threads and documents around the web; so to summarise as best as possible: My main report has a param CONTRACT_NUMBER which prompts for a value. This is passed to the Mongo query and works fine. The table has a param called TABLE_CONTRACT_NUMBER whose expression is $P{CONTRACT_NUMBER}, and if I read your comment correctly, I have to add the TABLE_CONTRACT_NUMBER param to the dataset for the table? Thanks Link to comment Share on other sites More sharing options...
AnnMary.Thomas Posted March 9, 2015 Share Posted March 9, 2015 is this working now?? 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