Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » EventHandler for report item?
EventHandler for report item? [message #250510] Tue, 31 July 2007 09:12 Go to next message
Eclipse UserFriend
Originally posted by: john.spangenberg.geodan.com

Hi,

My report design has an input report parameter named 'xmlFile' with data
type String.
I do not want to pass 'xmlFile' into a data set. Instead, I want to
parse the value of 'xmlFile' first, and then I want to pass the result
of the parsing (could be a value of a node for example) to a data set.

I was thinking about writing an EventHandler class on a report
parameter. In this case 'xmlFile'.

Question:

Which EventHandler interface do I have to implement and which event in
particular?

I would appreciate your help.

Many thanks in advance.

Regards,

John
Re: EventHandler for report item? [message #250634 is a reply to message #250510] Tue, 31 July 2007 20:25 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

John,

There is not an event handler for the parameters.
You could do this in the beforeOpen script of a scripted data set like this:

importPackage(Packages.javax.xml.parsers);


importPackage(Packages.java.io);


importPackage(Packages.org.w3c.dom);




var filename = "C:\\src\\ref.xml";
var factory = DocumentBuilderFactory.newInstance();
var builder = factory.newDocumentBuilder();
var document = builder.parse(new File(filename));


function getTagValue(tagName) {
var nlist = document.getElementsByTagName(tagName);
return nlist.item(0).getFirstChild().getNodeValue();
}

Then call getTagValue on what you need.

or use the ScriptedDataSetEventAdapter

Jason


John Spangenberg wrote:
> Hi,
>
> My report design has an input report parameter named 'xmlFile' with data
> type String.
> I do not want to pass 'xmlFile' into a data set. Instead, I want to
> parse the value of 'xmlFile' first, and then I want to pass the result
> of the parsing (could be a value of a node for example) to a data set.
>
> I was thinking about writing an EventHandler class on a report
> parameter. In this case 'xmlFile'.
>
> Question:
>
> Which EventHandler interface do I have to implement and which event in
> particular?
>
> I would appreciate your help.
>
> Many thanks in advance.
>
> Regards,
>
> John
>
>
>
>
>
Previous Topic:API code/documentation quality
Next Topic:Mailing lables
Goto Forum:
  


Current Time: Sat Jul 27 16:37:04 GMT 2024

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

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

Back to the top