raulsaavedrax Posted May 25, 2007 Share Posted May 25, 2007 hi friends, my name is raulsaavedrax, i'm a new user of iReport version 1.2.8, i want know what is the subdatasets, how is using.... excuse me for the grammar of this post... i don't speak english, i'm from south american... thanks... Link to comment Share on other sites More sharing options...
Case1182 Posted May 26, 2007 Share Posted May 26, 2007 a subdataset is used like a view in SQL, used to filter a table to only the data u want. Link to comment Share on other sites More sharing options...
raulsaavedrax Posted May 26, 2007 Author Share Posted May 26, 2007 ok, thank you, but i want know how using Subdataset, i have a main report, and one subdataset in the main report, but the main report can't access to fields of the subdataset....? Link to comment Share on other sites More sharing options...
Case1182 Posted May 26, 2007 Share Posted May 26, 2007 when u create the subdataset it makes a virtual db filter the way you set it to be, you then go to the subdataset property window by click, Data > Subdatasets > highlight subdataset wishing to use > Modify, after that there will be several buttons to the left, these buttons will allow you to make fields, variables, parameters, query, just click the one desired and make the object like normal, it is a long way to sort a database though, tell me what you are trying to do, I might have a better solution for you, post you jxrml file if you want and i will look at it. Link to comment Share on other sites More sharing options...
raulsaavedrax Posted May 29, 2007 Author Share Posted May 29, 2007 ok friend, thank you very much for your help. i want know if the subdataset is using only for create Chart or Crosstab... because my main report not recognize the fields or parameters of my subdataset. can i use the fields of my subdataset in my main report? how? thank you. Link to comment Share on other sites More sharing options...
Case1182 Posted May 31, 2007 Share Posted May 31, 2007 simply no, fields in ur subdataset are just that, you can use fields from ur main in the subdataset but not the other way around, you should how ever be able to use the the subdataset data in object on the main report, just have to make sure you are pulling from the subdataset for it. Post edited by: Case1182, at: 2007/05/30 21:31 Link to comment Share on other sites More sharing options...
raulsaavedrax Posted May 31, 2007 Author Share Posted May 31, 2007 ok, CASE1182, thank you very much for your help. do you can give me a manual with examples of Scriptlet? Link to comment Share on other sites More sharing options...
zhu001 Posted July 3, 2008 Share Posted July 3, 2008 Hi Case1182, Could you please tell me how to reference subdataset filed on the main layout? I have a subdataset defined with one filed and all i want is to show the value of that field on the report, but when i go to filed properties in the ireport it doesn't let me choose the filed from the subdataset only from main query... please advice. and one more question do you know if it is possible to run multiple queries in one report? Link to comment Share on other sites More sharing options...
svenn Posted July 3, 2008 Share Posted July 3, 2008 You can not access subdatasets values in the fields of your report. You can only use subdatasets in graphs and crosstab objects. Link to comment Share on other sites More sharing options...
kazuparkslope Posted January 1, 2009 Share Posted January 1, 2009 I think the issue I have is somewhat related to this thread and apologies for digging this up;I have to execute two queries in a single report currently, and I cannot seem to type in query1;query2 in the main document's sql.So what I did is that I created a subdataset and executed the second query there.Everything looks good except that I cannot access the fields variable in the report. Say if I have the followign as my query for the subdataset:select field1 from table1 where date>$P{date}Can I not access field1 via the $F{field1} variable in my main report ? How would I go about showing the data returned by the subdataset ? Any input will be greatly appreciated. thanks! Link to comment Share on other sites More sharing options...
svenn Posted January 2, 2009 Share Posted January 2, 2009 It clearly indicated in the thread discussion but here it is again in a nutshell1. The main report's SQL can only contain one query2. The report can also contain a subdataset but this subdataset can only be use in a chart or crosstab of your report. It can not be access by the fields in your main report.If you need more than one query in you report you can create a sub-report with you query and reference it in your main report. 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