Home
Analytics
How to display another data set values in Table
KavithaD
Hi All,
I am having one table & 5 columns mapped to 1st data set.In one of the table column i need to show some data like data present Yes or No based on 2nd data set results.I am passing 1st data set variable to 2nd data set and i need to show 2nd data set details in table format.
I have designed like table is mapped to 1st data set and in one of the column i mapped to dynamic text field which i mapped to 2nd data set.on create of dynamic text field i am building htmlTable to display 2nd data set details in table format.
Problem is 2nd data set has list of values for each 1st data set.But on create of dynamic text i am getting only single record.Please let me know which is the better way to achieve my requirement or how to get list of details from 2nd data set.
Thank you,
Kavitha
Find more posts tagged with
Comments
blub1.0
Hello Kavitha,
I?m no Birt-export and my English is bad, but I think I have a solution for you.
Don?t use an dynamic text field. Write your code in the Expression-field of the Detail-cell.
If the number of rows is the same, it must work.
If it not work, join the data sets.
KavithaD
Hi blub1.0,
Thanks for the reply.
I want to get details of other data set.I details row how can i give the expression?
Thank you,
Kavitha
KavithaD
Dear Friends,
Is there any way to have a component which is mapped to different data set in a table and get list of values from the component data set.From that list i want to build htmlTable in script.
HTMLCommentsTable = HTMLCommentsTable + "<table border= '1'><tr><th>Item No: (e.g. A2)</th><th>Comments</th></tr><tr><td WIDTH='10%'>"+temp+"</td>"+
"<td WIDTH='90%'>"+row["COMMENTS"]+"</td></tr></table>";
Thank you,
Kavitha
KavithaD
Please can any one provide me a solution
mwilliams
Hi Kavitha,
An individual element can only be attached to one dataSet. If you have multiple dataSets you need data from, you can create a joint dataSet and get your data from that dataSet. Or you can step through your dataSets and add information to a variable or variables that you can display in your HTML table. If you can explain exactly what you have and what you're trying to do, I might be able to give a more exact answer!
KavithaD
Hi Michael,
I want to display like
TABLE has
data Set 1 Column 1
data Set 1 Column 2
data Set 1 Column 3
Flag.
A single flag indicating whether any data exists in Dataset 2 for the current row of Dataset 1 (where multiple matching rows may exist in Dataset 2).I will be passing data set 1 parameter to data set2.I want to loop through multiple matching rows in Dataset 2 and build Html-table.As you suggested in one of my thread
http://www.birt-exchange.org/org/forum/index.php/topic/20173-data-component-in-table/
to build html table.I want to display data set2 details in separate table along with serial number(as you suggested in one of my thread).
Thank you,
Kavitha.
mwilliams
Kavitha,
Can you show a small, dummy sample of what data would look like in both dataSets and what you'd like to see as the end result. I'll try to make a quick example, but I'll wait for your data to make it more specific to your situation.
KavithaD
Michael,
Here i am attaching my sample report using office and employee table.In Actual scenario i am having nested Table like
Table1 ->
Table2 ->
Table3->.
The Sample report has inner Table3(Same thing i have done in Table2).
To achieve my requirement i used one more table and hiding this table.On creation of each detail row i am building my html Table.
My Problems are::
1.I don't think this is the right way.Because i mapped empdataset for both table and dynamic text so it may take longer execution time.
2.If i view the report in web viewer alignment is not good.
3.In PDF double line is coming.
Please let me know where i am going wrong ?
Thank you,
Kavitha
mwilliams
Kavitha,
Take a look at the changes I made to where you create the HTML. I made it so the table is only created once rather than for each row, a new table. I then closed the table tag in the text box in the design layout where you call the html table so that every row gets added into the table before the table tag is closed off.
Hope this helps.
KavithaD
Thank you very much Michael it solved my Problems.
I am having one doubt i have to display Employees Present Yes or No so i mapped empDataset to text.Please Take a look at the sample attached.
Will it take more execution time if i have same emp data set mapped to Text and table?
mwilliams
Kavitha,
I don't think it would because of the caching of BIRT, but you could do it like in the attached. I moved the text box into the header of the embedded table and only hid the detail row of the table and not the header. This just uses the container as the dataSet for the text box so you don't have both linked to the dataSet.
KavithaD
Michael,
I am having nested tables and i am attaching the sample rptdesign too.Problem here is if i have many child data's in Table 2 i will get double lines in the report.Attached Sample have only single data in Table2.Please let me know whats the problem i think its because of bordering.
Thank you,
Kavitha
mwilliams
Kavitha,
Is your problem with the double lines or with only having a single child under each parent? Is this your HTML table that you're showing me? If so, it looks like you're creating a table each time you have a new "parent", which is causing you to have double lines.
KavithaD
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67901" data-time="1283178997" data-date="30 August 2010 - 07:36 AM"><p>
Kavitha,<br />
<br />
Is your problem with the double lines or with only having a single child under each parent? Is this your HTML table that you're showing me? If so, it looks like you're creating a table each time you have a new "parent", which is causing you to have double lines.<br /></p></blockquote>
<br />
My Problem is double lines if Table 2 has more than 2 child's.I am not using HTML table for this nested table.Please find the attachment in my Previous Thread.
mwilliams
Kavitha,
What page in the above report does this problem occur? I don't see any double lines. From your screenshot and looking at the report design, you may have to turn off a border on the top of the "STATUS" row.
KavithaD
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="67942" data-time="1283258959" data-date="31 August 2010 - 05:49 AM"><p>
Kavitha,<br />
<br />
What page in the above report does this problem occur? I don't see any double lines. From your screenshot and looking at the report design, you may have to turn off a border on the top of the "STATUS" row.<br /></p></blockquote>
<br />
I dont know why double lines are not visible in screen shot.You can notice that lines are bit thicker than a normal line.After 1a,2a,4a lines.
mwilliams
I see the "thicker" double lines in the screenshot. I just didn't see any in the attached report design. Based on the setup, it looks like you just need to remove the top border line after the first group.
KavithaD
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="68020" data-time="1283367029" data-date="01 September 2010 - 11:50 AM"><p>
I see the "thicker" double lines in the screenshot. I just didn't see any in the attached report design. Based on the setup, it looks like you just need to remove the top border line after the first group.<br /></p></blockquote>
<br />
<br />
Its not working for me.Please can you tell me where its wrong in the set up.
mwilliams
Kavitha,
I'm not 100% sure what the problem is because I did not see the same in the report I could run above. Based on the setup, it looks like you're getting double thick lines in some spots because there is a border line on the bottom of one row and on the top of the next group. This may be as simple as removing a border line from your design or you may have to use script to remove the border line where it's not needed. If you could recreate the issue with the sample database, I could set this up for you.
KavithaD
with the sample data base i could able to display up to,
Group1 --> Sub group1 -->Item1/Item2/Item3.
If Group1 is having multiple Sub Groups then i will get double line with the set up.In sample Database i don't have such table to recreate the issue so sample report is not displaying double line.I tries with removing border then also it didn't solve my problem.Please take a Look at the attached screen shot.There is a single subgroup which starts from SL num 1.If its more than 1 i could able to recreate the issue.If this is not clear please let me know.
mwilliams
Kavitha,
You're going to have to drop the top border on the rows that count 2,3,...etc. To do this, you can do something like:
* Initialize a variable in the initialize script like removeBorder = 0;
* In your onCreate script for your row that counts 1, 2, 3, etc. you'd need to put
if(removeBorder == 0){
removeBorder = 1;
}
else{
this.getStyle().borderTopStyle = "none";
}
* Then in the footer of whatever group that is, you'll need to set the removeBorder variable back to 0 to repeat this process for each group.
Hope this helps.