Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
how to use Text element in table?
yaragallamurali
<p>Hi i want to use text element in the table. I have list of students from database. If i use text element in the detail section of the table it is displaying the first student details for all the rows. Is there any possible way to use text element in the detail section of the table?</p>
Find more posts tagged with
Comments
wwilliams
<p>Make sure you select HTML from the drop down.</p><p>Your expresion;</p><p><VALUE-OF>row["value"]</VALUE-OF></p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="wwilliams" data-cid="121002" data-time="1380982237"><div><p>Make sure you select HTML from the drop down.</p><p>Your expresion;</p><p><VALUE-OF>row["value"]</VALUE-OF></p></div></blockquote><p>You mean that "value" has to be replaced by the dataset column name. If this is the case it is not working. If there are 10 records from database. It is displaying only the first record for 10 times. I mean 10 rows are being displayed in the table with the first record. so is there a way to use text element in detail section of table?</p>
wwilliams
<p>Not sure why it doesn't, I just tried it in a detail section and it worked.</p><p>Can you post the report?</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="wwilliams" data-cid="121006" data-time="1380986720"><div><p>Not sure why it doesn't, I just tried it in a detail section and it worked.</p><p>Can you post the report?</p></div></blockquote><p>To be in more detail i am using "pojo datasource" in 4.3. So the object that is returned contains another list of objects and these are mapped to text element in the detail section where the table is displaying only the values of the first object in the list and getting iterated as the size of the list. Is there anything wrong in this?</p>
yaragallamurali
<p>do any one have the same problem? If anybody have the solution please help me out,</p>
CBR
<p>If it is a list of values you need to encapsulate the text item in a table or list. Table or list are the only two elements that are able to iterate over a collection (list, resultset,...) of values. All other elements are just showing a single value. If these elements are used on a list of values they just display the very first value.</p><p>You have to use another scripted data set that is iterating over the inner collection. This dataset can then be used in a table that is nested into the existing table and is getting it's collection using a dataset parameter.</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121017" data-time="1381076100"><div><p>If it is a list of values you need to encapsulate the text item in a table or list. Table or list are the only two elements that are able to iterate over a collection (list, resultset,...) of values. All other elements are just showing a single value. If these elements are used on a list of values they just display the very first value.</p><p>You have to use another scripted data set that is iterating over the inner collection. This dataset can then be used in a table that is nested into the existing table and is getting it's collection using a dataset parameter.</p></div></blockquote><p>Hi I am already using a table and there the problem exist. when i encapsulate the text element in the table for nested collection (collection in another collection) it is displaying the first object values of the nested collection for n number of times (n=size of the collection). If i use data element everything is working fine without any problem but i want to use text element instead of data element. Is there any way to do this?</p>
CBR
<p>Are you able to share your report design file? It shouldn't make a real difference if you are using a data or a text element.</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121028" data-time="1381146982"><div><p>Are you able to share your report design file? It shouldn't make a real difference if you are using a data or a text element.</p></div></blockquote><p>The attached is my report file.</p>
yaragallamurali
<p>I have removed all the other elements except the table that is mapped to nested collection. As of now i am using data elements but before when i use text elements the problem exist. </p>
CBR
<p>Thanks. I ll look at it today in the evening</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121064" data-time="1381221186"><div><p>Thanks. I ll look at it today in the evening</p></div></blockquote><p> </p><p>Thank you so much.</p>
CBR
<p>Have a look at attached report design. I m now also able to see where your problem was: A nested table to traverse the collection is not sufficient. You also need another dataset that is delivering the data. Have a look at report attached. It was really built something meaningful because i do not have your jar files available. It might also be the</p><p>I m not sure why it worked using a data element (can't even think of a way how it could have worked)</p><p> </p><p>Your dataset contains a column named CourseSubjects. This column is of type JavaObject. Let's assume it is a java.util.Collection and contains a list of CourseSubjects. To be able to traverse this collection you have to built another dataset (i called it courseSubjectsDataSet). This dataset is a scriptedDataSet and has a query parameter called courseCollection (just double click the dataset and select the parameters tab from the list to the left in the dialog). Now have a look at the open event handler of the dataset. It basically gets the collection and stores a iterator in a variable. Switch to fetch method, it traverses the collection using the iterator and returns data.</p><p>Then i encapsulated a table beeing bound to the courseSubjectDataSet in the existing table (see third column). Now i set the parameter of the dataset using the DataSet Parameter Binding button of the table to be able to bring in the corresponding CourseSubjects that belong to the current object.</p><p> </p><p>Another and maybe a much simpler approach is to forget about the additional dataset use a text item and set expression like that</p><p> </p><p></p><pre class="_prettyXprint _linenums:0">var retValue = "";var iterator = row["CourseSubjects"].iterator();while(iterator.hasNext()) { var courseS = iterator.next(); retVal += "<br>"+courseS.getSubject(); //i m assuming that the elements of the collection have a method getSubject()}retVal</pre>
CBR
<div>Annoying but the forum does not allow files to be uploaded today</div>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121095" data-time="1381257857"><div><p> </p><p>Have a look at attached report design. I m now also able to see where your problem was: A nested table to traverse the collection is not sufficient. You also need another dataset that is delivering the data. Have a look at report attached. It was really built something meaningful because i do not have your jar files available. It might also be the</p><p>I m not sure why it worked using a data element (can't even think of a way how it could have worked)</p><p> </p><p>Your dataset contains a column named CourseSubjects. This column is of type JavaObject. Let's assume it is a java.util.Collection and contains a list of CourseSubjects. To be able to traverse this collection you have to built another dataset (i called it courseSubjectsDataSet). This dataset is a scriptedDataSet and has a query parameter called courseCollection (just double click the dataset and select the parameters tab from the list to the left in the dialog). Now have a look at the open event handler of the dataset. It basically gets the collection and stores a iterator in a variable. Switch to fetch method, it traverses the collection using the iterator and returns data.</p><p>Then i encapsulated a table beeing bound to the courseSubjectDataSet in the existing table (see third column). Now i set the parameter of the dataset using the DataSet Parameter Binding button of the table to be able to bring in the corresponding CourseSubjects that belong to the current object.</p><p> </p><p>Another and maybe a much simpler approach is to forget about the additional dataset use a text item and set expression like that</p><pre class="_prettyXprint _linenums:0">var retValue = "";var iterator = row["CourseSubjects"].iterator();while(iterator.hasNext()) { var courseS = iterator.next(); retVal += "<br>"+courseS.getSubject(); //i m assuming that the elements of the collection have a method getSubject()}retVal</pre></div></blockquote><p> </p><p>Thank you so much. Really nice of you. will try these and will let you know how it went. </p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121096" data-time="1381258062"><div><p> </p><div>Annoying but the forum does not allow files to be uploaded today</div><p> </p></div></blockquote><p>Not a problem at all.</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121095" data-time="1381257857"><div><p> </p><p>Have a look at attached report design. I m now also able to see where your problem was: A nested table to traverse the collection is not sufficient. You also need another dataset that is delivering the data. Have a look at report attached. It was really built something meaningful because i do not have your jar files available. It might also be the</p><p>I m not sure why it worked using a data element (can't even think of a way how it could have worked)</p><p> </p><p>Your dataset contains a column named CourseSubjects. This column is of type JavaObject. Let's assume it is a java.util.Collection and contains a list of CourseSubjects. To be able to traverse this collection you have to built another dataset (i called it courseSubjectsDataSet). This dataset is a scriptedDataSet and has a query parameter called courseCollection (just double click the dataset and select the parameters tab from the list to the left in the dialog). Now have a look at the open event handler of the dataset. It basically gets the collection and stores a iterator in a variable. Switch to fetch method, it traverses the collection using the iterator and returns data.</p><p>Then i encapsulated a table beeing bound to the courseSubjectDataSet in the existing table (see third column). Now i set the parameter of the dataset using the DataSet Parameter Binding button of the table to be able to bring in the corresponding CourseSubjects that belong to the current object.</p><p> </p><p>Another and maybe a much simpler approach is to forget about the additional dataset use a text item and set expression like that</p><pre class="_prettyXprint _linenums:0">var retValue = "";var iterator = row["CourseSubjects"].iterator();while(iterator.hasNext()) { var courseS = iterator.next(); retVal += "<br>"+courseS.getSubject(); //i m assuming that the elements of the collection have a method getSubject()}retVal</pre></div></blockquote><p> </p><p>One thing i can confidently say is "Text Item" is not working if we place it in the detail section of table or list. It is behaving the way i described in my above posts. </p><p> </p><p>Today I have observed a strange behavior. For my courseSubjects even without creating a separate dataset the pojo data source that came with 4.3 worked well but when i am trying add another collection for another table nothing is working out. My total report is being empty. If i create another dataset for that collection, everything is working fine. Why is this working for one collection and why not working for another collection? The behavior is too strange. It is not displaying any error and also not displaying any data. To view pdf report i am using the viewer provided by Eclipse Birt. This is strange and looks nonsense.</p><p> </p><p>The script that you asked me to put into the text element as an alternative is not working at all. I have tried keeping that script in script panel of text element and also in expression builder but nothing worked out. If there is any solution please let me know.</p>
yaragallamurali
<p>I am uploading the two rpt design files. "test.rpt" is the one which is working and before adding the "documentName" field to dataset, The "testNotWorking.rpt" is the one which is not working when i add "docName" to the dataset. This is too strange. when it is working for courseSubjects why is it not working for "documents". How to understand this behaviour? As it is not allowing me to upload the documents taht are more than 111kb i am uploading to my google drive and providing the links to download. The following are the links</p><p> </p><p><a data-ipb='nomediaparse' href='
https://docs.google.com/file/d/0B59LVhKQaKQYeFNDcnhxZ3pCWVE/edit?usp=sharing'>https://docs.google.com/file/d/0B59LVhKQaKQYeFNDcnhxZ3pCWVE/edit?usp=sharing</a></p><p> </p><p><a
data-ipb='nomediaparse' href='
https://docs.google.com/file/d/0B59LVhKQaKQYcmoyZVVpZ1RCMlk/edit?usp=sharing'>https://docs.google.com/file/d/0B59LVhKQaKQYcmoyZVVpZ1RCMlk/edit?usp=sharing</a></p>
;
yaragallamurali
<p>If anybody have faced this problem before and found solution, please help me out.</p>
CBR
<p>Would you also be able to share the jar file? It is hard to see the problem without doing a preview.</p>
yaragallamurali
<blockquote class="ipsBlockquote" data-author="cbrell" data-cid="121136" data-time="1381333621"><div><p>Would you also be able to share the jar file? It is hard to see the problem without doing a preview.</p></div></blockquote><p> </p><p>The following is the link for the jar file. I have hard coded the data for your convenience so that you will be able to see the report easily. </p><p> </p><p><a data-ipb='nomediaparse' href='
https://docs.google.com/file/d/0B59LVhKQaKQYa2RIUldGM0dfSm8/edit?usp=sharing'>https://docs.google.com/file/d/0B59LVhKQaKQYa2RIUldGM0dfSm8/edit?usp=sharing</a></p>
;
yaragallamurali
<p>Any help on this?</p>
yaragallamurali
<p>This is hitting the performance and the biggest problem that we have now. could anyone please help us.</p>
yaragallamurali
<p>hi Cbrell, have u found anything?</p>