Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:42 Go to next message
Paul Ramsden is currently offline Paul RamsdenFriend
Messages: 84
Registered: February 2011
Location: BW, Germany
Member
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 09:43]

Report message to a 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 10:25 Go to previous messageGo to next message
Ricardo Rodrigues is currently offline Ricardo RodriguesFriend
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
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 10:39 Go to previous messageGo to next message
Paul Ramsden is currently offline Paul RamsdenFriend
Messages: 84
Registered: February 2011
Location: BW, Germany
Member
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 10:41]

Report message to a 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 11:19 Go to previous messageGo to next message
Ricardo Rodrigues is currently offline Ricardo RodriguesFriend
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
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 12:10 Go to previous messageGo to next message
Paul Ramsden is currently offline Paul RamsdenFriend
Messages: 84
Registered: February 2011
Location: BW, Germany
Member
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 13:15 Go to previous message
Ricardo Rodrigues is currently offline Ricardo RodriguesFriend
Messages: 15
Registered: July 2012
Location: Ireland
Junior Member
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 13:16]

Report message to a 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: Thu Apr 25 16:23:07 GMT 2024

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

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

Back to the top