开发者

Passing parameter to Java class using scripted DS in Birt

开发者 https://www.devze.com 2023-01-14 08:45 出处:网络
I have a method RunReport( rptfile, o/p path, emp_id); which generate the report using scripted Data Source. I need to pass emp_id to the script

I have a method RunReport( rptfile, o/p path, emp_id); which generate the report using scripted Data Source. I need to pass emp_id to the script

Open():             
count = 0;

// Create instance of my class
p= new Packages.joez.sal();

//Load the List
s = p.getSal(emp_id); 

where based on emp_id, the report is generated. Please let me know how to set the valu开发者_运维百科e of emp_id in Java class from script.

Thanks in advance :)


In the script you cite above, you simply need to properly reference the parameter so it can be passed in by value.

Change you call to getSal(...) to look like this:

s = p.getSal(params["emp_id"]);

That should be the only change you need.

Good Luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消