Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Problem with page header
Birt_Manu
Hi,
I want to create a report which will show a set of SAME information in the starting of each page,so the best way would be to include that information in the MASTER PAGE header,this information will be obtained through a query,for which I have created corresponding DATASET.
Now the problem is that in MASTER PAGE header only grid is allowed and when trying to obtain the information through the dataSetRow["column name"] in grid, it is showing only first row of the result generated through the query.I have to show the entire result obtained,but couldnot find any solution.
Please let me know the solution.
Find more posts tagged with
Comments
mwilliams
Hi Birt_Manu,
Tables and lists are the only items that will iterate through your dataSet to display all results, so if those aren't allowed, this can't be done with data elements. I haven't tried this, but you might try building an HTML table in your dataSet script as you access the rows of the database and use it in the header. As long as the dataSet is called prior to the masterpage being created, you should be able to do this.
Birt_Manu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="69870" data-time="1288361778" data-date="29 October 2010 - 07:16 AM"><p>
Hi Birt_Manu,<br />
<br />
Tables and lists are the only items that will iterate through your dataSet to display all results, so if those aren't allowed, this can't be done with data elements. I haven't tried this, but you might try building an HTML table in your dataSet script as you access the rows of the database and use it in the header. As long as the dataSet is called prior to the masterpage being created, you should be able to do this.<br /></p></blockquote>
<br />
Thanks ,But if you could just explain with an example how to build an HTML table in dataset,and how the data set can be called prior to the master page.<br />
<br />
I am new to birt,so unaware of these things.Please help me out with this.
Birt_Manu
Please if anyone knows any solution of this problem,kindly share that with me.
I am stuck on this.
mwilliams
Birt_Manu,
You'd build the HTML table as a string of HTML as the data is retrieved from the database by the dataSet in the onFetch method. You would then recall the variable that you stored the HTML table string into in a text element of type HTML in the masterpage header. Again, I'm not sure if this is possible in the MP header, but it's worth a shot. If you need help testing this idea, let me know.
Birt_Manu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="69905" data-time="1288626181" data-date="01 November 2010 - 08:43 AM"><p>
Birt_Manu,<br />
<br />
You'd build the HTML table as a string of HTML as the data is retrieved from the database by the dataSet in the onFetch method. You would then recall the variable that you stored the HTML table string into in a text element of type HTML in the masterpage header. Again, I'm not sure if this is possible in the MP header, but it's worth a shot. If you need help testing this idea, let me know.<br /></p></blockquote>
<br />
Thanks Williams,<br />
<br />
Could you please help me out with a small example as I am still not sure how to proceed with this . <br />
<br />
many thanks in advance!!
Birt_Start
<blockquote class='ipsBlockquote' data-author="'Birt_Manu'" data-cid="69929" data-time="1288683004" data-date="02 November 2010 - 12:30 AM"><p>
Thanks Williams,<br />
<br />
Could you please help me out with a small example as I am still not sure how to proceed with this . <br />
<br />
many thanks in advance!!<br /></p></blockquote>
<br />
Hi everyone,<br />
<br />
I too have a similar problem with my reports.Its frustating not to be allowed to add table in the masterpage header,it would have saved a lot of trouble.If anyone know any possible solution,please share it.
Birt_Start
<blockquote class='ipsBlockquote' data-author="'Birt_Start'" data-cid="69975" data-time="1288779955" data-date="03 November 2010 - 03:25 AM"><p>
Hi everyone,<br />
<br />
I too have a similar problem with my reports.Its frustating not to be allowed to add table in the masterpage header,it would have saved a lot of trouble.If anyone know any possible solution,please share it.<br /></p></blockquote>
<br />
Hi All,<br />
<br />
Please share if you have any solution for this,I am not able to find any solution.<br />
<br />
Need your help guys.<br />
<br />
Many Thanks
mwilliams
Sorry for the delay, I was out of town all last week at Actuate Customer Days in San Francisco. What is your BIRT version? I will make an attempt to see if it can be done with the HTML table made out of the dataSet.
Birt_Manu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70127" data-time="1289320240" data-date="09 November 2010 - 09:30 AM"><p>
Sorry for the delay, I was out of town all last week at Actuate Customer Days in San Francisco. What is your BIRT version? I will make an attempt to see if it can be done with the HTML table made out of the dataSet.<br /></p></blockquote>
<br />
Hi Mwilliams,<br />
<br />
I am using Birt 2.1.2<br />
<br />
Thanks for all your help.
mwilliams
Ok, my version of 2.1.2 isn't working correctly too see if this works, but I tried this in 2.6.1 and it works correctly. I'm attaching my 2.1.2 report in case it works for you, but below is what I did.<br />
<br />
In the initialize method of the report, I put:<br />
<br />
htmlTable = "";<br />
<br />
In the onFetch of the dataSet, I put:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (htmlTable == ""){
htmlTable = "<table border=\"1\"><tr><th>Order Number</th><th>Order Date</th></tr>" +
"<tr><td>" + row["ORDERNUMBER"] + "</td><td>" + row["ORDERDATE"] + "</td></tr>";
}
else{
htmlTable = htmlTable + "<tr><td>" + row["ORDERNUMBER"] + "</td><td>" + row["ORDERDATE"] + "</td></tr>";
}
</pre>
<br />
Then, in my master page header, I put a text box that I bound to my dataSet with the following contents:<br />
<br />
<VALUE-OF format="HTML">htmlTable + "</table>";</VALUE-OF><br />
<br />
Let me know.
Birt_Manu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70206" data-time="1289418673" data-date="10 November 2010 - 12:51 PM"><p>
Ok, my version of 2.1.2 isn't working correctly too see if this works, but I tried this in 2.6.1 and it works correctly. I'm attaching my 2.1.2 report in case it works for you, but below is what I did.<br />
<br />
In the initialize method of the report, I put:<br />
<br />
htmlTable = "";<br />
<br />
In the onFetch of the dataSet, I put:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
if (htmlTable == ""){
htmlTable = "<table border=\"1\"><tr><th>Order Number</th><th>Order Date</th></tr>" +
"<tr><td>" + row["ORDERNUMBER"] + "</td><td>" + row["ORDERDATE"] + "</td></tr>";
}
else{
htmlTable = htmlTable + "<tr><td>" + row["ORDERNUMBER"] + "</td><td>" + row["ORDERDATE"] + "</td></tr>";
}
</pre>
<br />
Then, in my master page header, I put a text box that I bound to my dataSet with the following contents:<br />
<br />
<VALUE-OF format="HTML">htmlTable + "</table>";</VALUE-OF><br />
<br />
Let me know.<br /></p></blockquote>
<br />
<br />
<br />
Hi Mwilliams,<br />
<br />
Thanks a lot for your reply,<br />
<br />
The report is showing the data in the header in the Birt Preview but not in the pdf,when trying to generate the report through the application.Please let me know what is needed to be done.<br />
<br />
Once again thanks for your help.
mwilliams
Like I said, I wasn't able to test it in 2.1.2, but it does show up in PDF in 2.6.1. There must have been a change that allowed the HTML table to show somewhere between there. Obviously there have been many improvements to the PDF emitter, but I don't know what version this changed in. I'm also guessing that if the table won't show, that a list probably wouldn't either. I'm guessing you're not able to upgrade?
Birt_Manu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70223" data-time="1289486798" data-date="11 November 2010 - 07:46 AM"><p>
Like I said, I wasn't able to test it in 2.1.2, but it does show up in PDF in 2.6.1. There must have been a change that allowed the HTML table to show somewhere between there. Obviously there have been many improvements to the PDF emitter, but I don't know what version this changed in. I'm also guessing that if the table won't show, that a list probably wouldn't either. I'm guessing you're not able to upgrade?<br /></p></blockquote>
<br />
Hi Mwilliams,<br />
<br />
You guessed it right,I am not allowed to upgrade.Also I tried it in 2.6.1 its giving invalid input stream error.Is their any way to obtain the solution in 2.1.2?<br />
<br />
once again thanks for your replies
mwilliams
I created a new report in 2.6.1 to do this. I didn't try to use the same file. Updates from 2.1.2 to 2.6.1 are probably the cause of this, I would guess. It for sure works in 2.6.1 in PDF as long as the masterpage header height is set to fit the height of the table. I think I'll have to download an old version of Java for me to get 2.1.2 to work, so I'll have to do that before I can test anything out in it.
Birt_Manu
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70250" data-time="1289543939" data-date="11 November 2010 - 11:38 PM"><p>
I created a new report in 2.6.1 to do this. I didn't try to use the same file. Updates from 2.1.2 to 2.6.1 are probably the cause of this, I would guess. It for sure works in 2.6.1 in PDF as long as the masterpage header height is set to fit the height of the table. I think I'll have to download an old version of Java for me to get 2.1.2 to work, so I'll have to do that before I can test anything out in it.<br /></p></blockquote>
<br />
Thanks a lot Williams,<br />
<br />
I tried to generate this with a new report in 2.6.1 it still gives the same error,this may be because the application is compatible with 2.1.2,Can you please check it with 2.1.2 as in any case I will have to do it with 2.1.2.<br />
<br />
Thanks for all your help.
mwilliams
I tried to download Java 1.4, which is what I think I need for 2.1.2 and it told me that my platform was unsupported for 1.4. I am running Windows 7. Without that, I won't be able to test in 2.1.2.