Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Birt report viewer source: where are GET report parameters set/initialized in source code ?
Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989284] Wed, 05 December 2012 14:22 Go to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
Hi,

im working on my company's birt-application.

ive just downloaded the repository with package "org.eclipse.birt.report.viewer" and the corresponding packages.

Im trying to figure out where the GET report parameters are set in the source code.

Reason beeing is that i know its possible to set report-parameters through the report url. like this: myreport.rptdesign&myparam=1

I want to put in my custom code that says that if i have set the parametervalue in the session, set this value on the corresponding birt report parameter.

the reason behind changing the source code, is that it seems that its not possible to set report parameters in script. I know its possible to set parametervalue in each "parameter-script", but i want a generic way of setting parameters.

I greatly appreciate all help.

Thanks.
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989367 is a reply to message #989284] Wed, 05 December 2012 20:54 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Can you explain more about what you're trying to do with the parameters? Maybe there's something we can figure out so that you don't have to change the source.

Michael

Developer Evangelist, Silanis
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989378 is a reply to message #989367] Wed, 05 December 2012 22:21 Go to previous messageGo to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
Thanks for your reply williams.

My aim is that in my web-application give the user the choice of "saving a report". With saving the report i mean:

-the user "saves the report" to a database-table with a custom name, and with report-parameters he choose when he ran the report.
-so when the user later chooses to run the "saved" report, the application gets his pre-set parameters and then runs the report (preferably without showing the report paramater-page)

i know its possible to run the reports with GET-parameters like:myreport.rptdesign&myparam=1 and it works greatly when there are few parameters. But i have some reports with a lot of parameters (some of them multi-value selects) that can give huge urls, if i use GET-parameters. And i know that the browsers have limitations with GET-parameters.

The best solution for running a "saved report" is:
-run query, get "saved report" and its report-parameters with values.
-iterate through the pre-set report-parameters and set the birt report parameters.
-show report result.

Thanks.

[Updated on: Wed, 05 December 2012 22:23]

Report message to a moderator

Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989576 is a reply to message #989378] Thu, 06 December 2012 19:52 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You could save your parameters back to your database or out to a text file or something. Then, when the user wants to run the "saved report", you could pass the parameter values back in, through the session. Then, just hide the parameter screen and set your parameter values in the beforeFactory.

Another option could be to write a "saved report" name back to your database, along with user name, and any other necessary info. Then, when your user info is passed to a report, you could check for "saved reports" and prompt the user if they'd like to load one. The values would be written to text files named by the "saved report" name, so you'd just need to recall the text file, hide the parameter screen, and set the parameters, in the report.

Hope one of these helps.


Michael

Developer Evangelist, Silanis
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989587 is a reply to message #989576] Thu, 06 December 2012 21:01 Go to previous messageGo to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
thanks for your reply, michael.

i think i agree with your suggestions. But the real problem is setting the parameter values, they will not be set in the report.

I have made an easy example-report to illustrate the problem.
I have made a report parameter called "testparam". i try in "beforeFactory" to set the testparam value in 2 ways:
params["testparam"].value = "testvalue2";
reportContext.setParameterValue("testparam","testvalue");


But the testparam value is still empty when the report parameter window is shown.

i have attached the example-report in the post.

Hope you can have a look.

Thanks.
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989593 is a reply to message #989587] Thu, 06 December 2012 22:10 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

No, they won't show in the parameter page, this way. In your last response, you said you wanted the report to run, "preferably without showing the report parameter-page." I think this is where my confusion comes in. So, you want to load the report, including the parameter page, only also load the past values into the parameter page?

Michael

Developer Evangelist, Silanis
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989672 is a reply to message #989593] Fri, 07 December 2012 09:17 Go to previous messageGo to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
Thanks again for your reply Michael.

Im no good in explaining Razz so i have attached screenshots from my application with the sequence of what i am looking to do. Please have a look, it will explain what i am looking for.

if i run the report with <server>/frameset?=report=rpt/report2.design?car=TOYOTA all the functionality in the attached screenshot works.

But i as earlier explained, i want to avoid setting the values in the url, thats the reason i wanted to find a way to set/override the parameter values in birt.

Thanks for looking at my problem.



index.php/fa/12633/0/

[Updated on: Fri, 07 December 2012 09:17]

Report message to a moderator

Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989826 is a reply to message #989672] Sat, 08 December 2012 04:16 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Ok, so if the user has already ran the report, you'd like it to just load the report with the value chosen, but still allow them to open the parameter page and change the parameter? Am I getting it, now? Smile

Michael

Developer Evangelist, Silanis
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989839 is a reply to message #989826] Sat, 08 December 2012 09:27 Go to previous messageGo to next message
nari noori is currently offline nari nooriFriend
Messages: 33
Registered: November 2012
Member
Yes michael thats right
Re: Birt report viewer source: where are GET report parameters set/initialized in source code ? [message #989858 is a reply to message #989839] Sat, 08 December 2012 15:12 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You could probably modify the parameter js pages and use a cookie to remember the chosen value, or something like that. I haven't done it, myself, but it seems that it should be possible.

Michael

Developer Evangelist, Silanis
Previous Topic:How to clean 'Border' in web browser using frameset way?
Next Topic:Web Service Data Source not working in Webviewer
Goto Forum:
  


Current Time: Fri Apr 19 16:41:52 GMT 2024

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

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

Back to the top