Skip to main content



      Home
Home » Archived » BIRT » How to set text in master page header using data from report?
How to set text in master page header using data from report? [message #899270] Tue, 31 July 2012 05:42 Go to next message
Eclipse UserFriend
I want to set up a master page for related reports. Each report has a different title and includes dynamic data e.g. name and dates of a seminar (the report content will be about attendees).

How can I define a placeholder for this data? How can I set the value in each report?

[Updated on: Tue, 31 July 2012 05:43] by Moderator

Re: How to set text in master page header using data from report? [message #899279 is a reply to message #899270] Tue, 31 July 2012 06:25 Go to previous messageGo to next message
Eclipse UserFriend
Not sure if I understood but in a edit text item you can:
<VALUE-OF>params["title"].value</VALUE-OF>
<VALUE-OF>params["date"].value</VALUE-OF>

and those params you can send to the report or update in a event
Re: How to set text in master page header using data from report? [message #899282 is a reply to message #899279] Tue, 31 July 2012 06:39 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Ricardo but this is not what I need.

I pass a seminar id to the report and a query runs to get more info about the seminar. I want to put the seminar name and its' date in the report header. The body of the report will contain different data about attendees or other seminar related data.

As the query runs in the body I'm guessing I have to update the header (master page in a library) from the body somehow.

Perhaps there is a better way....

[Updated on: Tue, 31 July 2012 06:41] by Moderator

Re: How to set text in master page header using data from report? [message #899290 is a reply to message #899282] Tue, 31 July 2012 07:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Did you try a data binding? see the attach screenshot

Re: How to set text in master page header using data from report? [message #899298 is a reply to message #899290] Tue, 31 July 2012 08:10 Go to previous messageGo to next message
Eclipse UserFriend
Thanks again Ricardo.

I would like the report to decide what to put in the title area.

e.g. Resource requirements (<seminarname> <from>-<to>)
or
Attendees by country (<seminarname> <from>-<to>)

Perhaps I can do this with some kind of variable? The variable would have to be declared in the master page and set in the report after the necessary query has been executed.
Re: How to set text in master page header using data from report? [message #899319 is a reply to message #899298] Tue, 31 July 2012 09:15 Go to previous message
Eclipse UserFriend
Hi

yes I think you can use a global variable
onInitialize of the report
reportContext.setPersistentGlobalVariable("title", "test global string");
and you could update it in some event after the dataset execution
reportContext.setPersistentGlobalVariable('title',dataSetRow["seminarname"] + "-" + reportContext.getPersistentGlobalVariable('title'));

or have something like an adicional logic in the data binding:
(dataSetRow["isResource"] == 1 ? "Resource requirements " + dataSetRow["seminarname"] : "Attendees by country " + dataSetRow["seminarname"])
where isResource would be a new column in your dataset identifying in which "level" are you in. or you could use a param or whatever that suits you better.

Hope this helps you

[Updated on: Tue, 31 July 2012 09:16] by Moderator

Previous Topic:How to create functions which can be reused in different chart script
Next Topic:Report is erroring out with an error in onFetch method.
Goto Forum:
  


Current Time: Wed Mar 26 05:08:33 EDT 2025

Powered by FUDForum. Page generated in 0.05948 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top