babarincairo Posted November 8, 2006 Share Posted November 8, 2006 Hi, I made a report containing an input parameter (named numeroId). I made my main query without problem to display data in the detail band. Example : SELECT C1,C2 FROM T1 WHERE C3 = $P{numeroId} After that, in the title band , I want display an itemcorresponding to a field of the line identified by numeroId. It means, do a query like this :SELECT C4 FROM T2 WHERE numeroId = $P{numeroId} But, I don't know where to put this query. I tried to use a subdataset but I don't know how to use the result field. Can you help me ? thanks Link to comment Share on other sites More sharing options...
babarincairo Posted November 13, 2006 Author Share Posted November 13, 2006 up! Link to comment Share on other sites More sharing options...
dpinfo Posted November 13, 2006 Share Posted November 13, 2006 You could solve the problem with 2 solutions:1) you could make a query in which you put all the information you need: select c1,c2,c4 from t1,t2where....... Then you have the field C4 at your disposal and you could put the field in the title. 2) make a subreport. Let us know if this help. ByeDpinfo Link to comment Share on other sites More sharing options...
babarincairo Posted November 13, 2006 Author Share Posted November 13, 2006 dpinfo wrote:1) you could make a query in which you put all the information you need:select c1,c2,c4 from t1,t2where.......Then you have the field C4 at your disposal and you could put the field in the title. Ok, but it must be the main data source ?? Because I can't create a field or a variable with the SQL query as expression. It does'nt compile Link to comment Share on other sites More sharing options...
dpinfo Posted November 13, 2006 Share Posted November 13, 2006 From my point of view, in the main query you need to make a merge of the queries. From my point of view it seems possible.If you don't like this solution you could create a subreport. With this solution you put the second query in the data/query of the second report, with a parameter . In the subreport properties in the master report in subreport(others) you need to define to which field of the master report the parameter is linked.Byedpinfo 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