Home
Analytics
Repeating Header Label for Cross Tab
junaidm
Hello everyone,
I want to repeat the title label for a cross tab whenever the cross tab gets pushed to the next page.
I have achieved this feature for a table by simply adding the label to the header section of the table and enabling repeat header. But for a cross tab it is difficult since it does not have a header section.
I have attached an illustration of what I am trying to achieve.
I want the title label to repeat on the next page as well.
I have explored multiple master pages, but it seems that it might be tedious to create a separate master page for each separate cross tab in the report just for a header title. Also if there is a way to embed a master page into another master page, then I might lean toward this solution.
Can any one please help or give any guidance?
Regards,
Junaid
Find more posts tagged with
Comments
mwilliams
Are you using an outer table to cause the crosstab to repeat multiple rows on a page? If so, could you just put it in the outer table's header?
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78623" data-time="1308241393" data-date="16 June 2011 - 09:23 AM"><p>
Are you using an outer table to cause the crosstab to repeat multiple rows on a page? If so, could you just put it in the outer table's header?<br /></p></blockquote>
<br />
Sorry yeah in that specific case I can.<br />
But in the case of a cross tab without being embedded in a outer table, how would I repeat the header title? <br />
<br />
I was thinking to embed the single standing cross tab into a outer table since that is simple. But then the outer table would not have a data set assigned to it and it would cause an error. (red x on the table). If there is another way please let me know.<br />
<br />
Junaid
mwilliams
Can you put your header in the top left header cell of the crosstab? Or do you not repeat the headers on page break?
If you had to settle with putting it in a table, you could simply create a dataSet that returns a single value and you can embed your crosstab in it and have no issues.
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78637" data-time="1308250318" data-date="16 June 2011 - 11:51 AM"><p>
Can you put your header in the top left header cell of the crosstab? Or do you not repeat the headers on page break?<br />
<br />
If you had to settle with putting it in a table, you could simply create a dataSet that returns a single value and you can embed your crosstab in it and have no issues.<br /></p></blockquote>
<br />
Yeah my backup option is the outer table setup, but I do not want the over head (extra data set) when generating the reports.<br />
<br />
I tried applying a master page to the cross tab in order to get the title label to repeat every page, but then I would also have to insert the main master page content (logo, footer) into each and every cross tab in the report. Is there a way for the cross tab to inherit the content of the main master page?<br />
<br />
And for some reason the cross tab would start on a fresh page when a master page is applied to it. I tried setting the page break to Avoid for before, after, inside, but it did not work. I am still experimenting around. <br />
<br />
Let me know. Thanks<br />
<br />
Junaid
mwilliams
What is your BIRT version? If using 2.5 or above, you might be able to use page variables to change the label on the masterpage depending on what crosstab is on the page.
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78643" data-time="1308254468" data-date="16 June 2011 - 01:01 PM"><p>
What is your BIRT version? If using 2.5 or above, you might be able to use page variables to change the label on the masterpage depending on what crosstab is on the page.<br /></p></blockquote>
<br />
I am using 2.6.x.<br />
<br />
Yeah I was thinking there might be a dynamic way to map the labels with the cross tabs, so then I would only have to create one master page that server the purpose of repeating the headers. Ok thanks, I will look into page variables.<br />
<br />
Also I just realized why the cross tab starts off fresh on a new page. I think it is because the main master page on the previous page cannot merge with the master page of the cross tab, since they are different and hence why it goes to the next page as opposed to continuing the flow with the previous data content. For now I am just going to copy over the main master page content and add the label. <br />
<br />
Thanks for the clarification, I will let you know if the requirements change.<br />
<br />
-Junaid
mwilliams
Yes, you'll have to have a new page for each crosstab if using separate master pages.
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78647" data-time="1308254881" data-date="16 June 2011 - 01:08 PM"><p>
Yes, you'll have to have a new page for each crosstab if using separate master pages.<br /></p></blockquote>
<br />
Is there no other way to repeat a label along with a cross tab when it page breaks?<br />
<br />
although the outer table is a simple solution, the extra data set for it is a big problem for us.
mwilliams
The default value is to repeat the row and column headers when a crosstab page breaks. So, if you include a title label in the upper left header cell, it should repeat when you have a page break. Is this not the case?
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78723" data-time="1308339068" data-date="17 June 2011 - 12:31 PM"><p>
The default value is to repeat the row and column headers when a crosstab page breaks. So, if you include a title label in the upper left header cell, it should repeat when you have a page break. Is this not the case?<br /></p></blockquote>
<br />
I am willing to consider this as long as it does not repeat for every single row and the other problem is that the I need to have the title on its own separate row from the column dimension headers (so like the cross tab title needs to be above the cross tab).<br />
<br />
<br />
Junaid
mwilliams
It seems as if the extra dataSet or the masterpage for each individual crosstab is going to be the way you have to go then. I can't think of another way around one of those two at this time.
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78728" data-time="1308340732" data-date="17 June 2011 - 12:58 PM"><p>
It seems as if the extra dataSet or the masterpage for each individual crosstab is going to be the way you have to go then. I can't think of another way around one of those two at this time.<br /></p></blockquote>
<br />
ok thanks
junaidm
I am about to try the page variables for the master page to dynamically show the title of the cross tab.
Do I just set a global variable in the dynamic text and for each cross tab change that variable to the title of the cross tab on page break or something?
Thanks,
Junaid
junaidm
<blockquote class='ipsBlockquote' data-author="'junaidm'" data-cid="78773" data-time="1308582946" data-date="20 June 2011 - 08:15 AM"><p>
I am about to try the page variables for the master page to dynamically show the title of the cross tab.<br />
<br />
Do I just set a global variable in the dynamic text and for each cross tab change that variable to the title of the cross tab on page break or something?<br />
<br />
Thanks,<br />
Junaid<br /></p></blockquote>
<br />
Ok, I found the page variables in the outline section. <br />
<br />
I created a page variable from the outline section, Then I put this reportContext.setPageVariable("HEADER_TITLE", "testing!!"); in the on prepare part of the cross tab.<br />
<br />
And then I put this ""+reportContext.getPageVariable("HEADER_TITLE"); in a dynamic text of the master page and when I created the report I got <strong class='bbc'>null</strong>.<br />
<br />
<br />
What am I missing?<br />
<br />
Thanks, <br />
Junaid
mwilliams
When setting the value, use the onCreate of the crosstab. When recalling the page variable, use the variables auto-text instead of a dynamic textbox.
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78785" data-time="1308588208" data-date="20 June 2011 - 09:43 AM"><p>
When setting the value, use the onCreate of the crosstab. When recalling the page variable, use the variables auto-text instead of a dynamic textbox.<br /></p></blockquote>
<br />
Ok, I did that now, but the autotext isn't showing anything anymore when the report is generated, not even null.
mwilliams
Look at this report. It is a start to doing what I was talking about with the variable. I set a variable initialized in the initialize, then set it to the page variable in the OnPageStart script method. Then display it in the masterpage with the auto-text. Let me know if you have questions. You'll probably need to fine tune this to work exactly right, but this is a start.
junaidm
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="78792" data-time="1308592764" data-date="20 June 2011 - 10:59 AM"><p>
Look at this report. It is a start to doing what I was talking about with the variable. I set a variable initialized in the initialize, then set it to the page variable in the OnPageStart script method. Then display it in the masterpage with the auto-text. Let me know if you have questions. You'll probably need to fine tune this to work exactly right, but this is a start.<br /></p></blockquote>
<br />
ok thanks. I will take a look.
mwilliams
Ok, let me know.