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)
Report title in footer
tkopets
Hi,<br />
<br />
I have dynamic report title based on text element and report parameters (basic styled text element for report title is stored in "common" library as "txtReportTitle").<br />
<br />
Simple example of title could look like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Report title from <value-of>rpDateFrom</value-of> to <value-of>rpDateTo</value-of></pre>
<br />
Also I have standard Master Page (also stored in "common" library as "mstrPageDefault") used by reports.<br />
<br />
My report is long and I want to repeat report title in report footer on every page.<br />
This way user having any page of report can see what report and for which date it was run (parameters).<br />
<br />
What is the best solution to solve this problem?<br />
<br />
If anyone knows, how to solve this in general way so I can easily incorporate this solution into other reports easily (using libraries, templates) it would be awesome.
Find more posts tagged with
Comments
mwilliams
I would think that if you could grab the text and the parameters that you're wanting to use, you could just assign the values how you'd like them to be to a report variable and then use the report variable auto text in the master page footer. I would think you'd be able to put a standard script into your text element that you're grabbing text from to set the variable, then the MP footer would just have to include the auto text element.
Hopefully this helps in your situation.
tkopets
Thanks for helpful hint, however I'm not able to add Variable AutoText to my MasterPage stored in library.
I don't know why, but after dropping Variable AutoText in Designer it just disappears.
Also I'm not able to add Variable in a library - "Variables" tree node is not present in Outline view when working with libraries. Why?
I'm using latest BIRT (2.6.1).
Any help, advice is highly appreciated.
mwilliams
I had forgotten that it wasn't available in the library view when I posted that. I'm not sure why that is. Maybe there is another way. I know you use parameter values in the title, but where do you get the rest of the title? Is it static text that is the same every time? Or is it text from your dataSet or something?
tkopets
Actual title text is is stored in .properties file of report for i18n.
In library this text element is created for styling purposes only.
However I want to provide general solution in library, to prevent copy-pasting script for all reports.
mwilliams
When are you grabbing the text from the .properties file? As long as it's before the onRender is called for the masterpage, I would think you could just write a script in the onRender of the text element in your MP footer to set the this.text.
tkopets
When I set text of element in onRender script I have empty space instead of report variable expression (<VALUE-OF>params["rpActualReportParam"].value</VALUE-OF> resolves to empty text instead of actual value).<br />
<br />
Is there any solution to get this text on MasterPage or maybe there is method to get evaluated content of text element?<br />
<br />
Script of text element used for reportTitle in library (onPrepare):<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>var trKey = this.contentKey;
var trContent = reportContext.getMessage(trKey, reportContext.getLocale());
reportContext.setPersistentGlobalVariable("gblStrReportTitleText", trContent);</pre>
<br />
Script for text element in footer of MasterPage, same library (onRender):<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.text = reportContext.getPersistentGlobalVariable("gblStrReportTitleText");</pre>
<br />
The problem as I understand is that MasterPage in library does not have access to actual report parameter values.
mwilliams
Can you set up a sample .rptlibrary that shows what you've done that I can attach to a report and use the masterpage in my report to test with it. You can put a grid in the mp header and in the footer with multiple cells to show me the different ways you've tried and I'll take a look at all of them. If you wanted to set up a report that uses the mp from the library for me to run too, that'd be ok too.