Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » How to pass the value of one data set into the another dataset?
How to pass the value of one data set into the another dataset? [message #997418] Mon, 07 January 2013 12:13 Go to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Hi,
I am new to BIRT.I have created a report having the fields Name(a combo box),StartTime(textfield) and End time (Textfield).

on entering the repective values in this fields I should be able to see a report containing the details against that particular name.

How do I pass the outputs or values of the parameters used in the first dataset in to the second dataset to get the required details?

Any help would be greatly appreciated.
Thanks in advance!!!!
Re: How to pass the value of one data set into the another dataset? [message #997510 is a reply to message #997418] Mon, 07 January 2013 21:53 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

If you're setting up a report parameter for the combo box for the name, you can use the value of this report parameter to limit any dataSet. In SQL, you could use a dataSet parameter marker '?' in your query to mark where you want to use the parameter, in your where statement and link the dataSet parameter to your report parameter in the dataSet editor. Otherwise, you can use the parameter in a filter to limit your dataSet. Let me know if I'm misunderstanding something.



Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #997976 is a reply to message #997510] Wed, 09 January 2013 05:23 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Thanks for the help but I need to do something like I will have three fields name,startdate and enddate.
On selection of these three parameters/values I will generate a report of the particular details of my selected values of name(from combo box)and the respective dates.
Am attaching a screen shot of how it might look after I have done the selection from the combo box and textfeilds.
In addition to this when am using a report parameter I get "pop-ups" for the combo-box and dates which I don't want.
I simply want togive the values in the report page itself and not through any pop-ups.
Re: How to pass the value of one data set into the another dataset? [message #998493 is a reply to message #997976] Thu, 10 January 2013 05:22 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You could either create a form, in an HTML text box, in your report, then call your report by URL when the button is pressed. Or, you could look into using the tag library to embed your parameters and report into a JSP page to keep the parameter selection and report on a single page.

Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #998605 is a reply to message #998493] Thu, 10 January 2013 10:38 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Hi,
Thanks for the help.If I follow the first method the report will be opened in another page right?
Could you please elaborate a bit about the second method you have suggested.
It will be of great help.
Re: How to pass the value of one data set into the another dataset? [message #998634 is a reply to message #998605] Thu, 10 January 2013 11:49 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Hi,
Is there any way we can avoid/hide the pop up that appears in adding "Report parameter"?
Re: How to pass the value of one data set into the another dataset? [message #998936 is a reply to message #998634] Fri, 11 January 2013 02:11 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

The first option can be loaded in the same window. Here's more about the tag library, for the second one:

http://www.eclipse.org/birt/phoenix/deploy/viewerUsage2.2.php#tags

To avoid the pop up, for the parameters, you can make the parameters hidden. There is also a URL parameter that can be used to decide to show or not show the parameter page.


Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #999008 is a reply to message #998936] Fri, 11 January 2013 06:28 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
I had used the hidden option but that makes the selection criteria non-functional then.By implementing "hidden" how can we select the parameters?
Basically I have made these dropdown and textboxes using html text.Now how do I pass these parameters (which I have selected i.e a particular set of name,start date and end date) and generate the deatiled report of that "particular" equipment(as I have selected from the html dropdown and text boxes.
I need to know how shall I pass these 3 parameters to call the actual report.
Using report parameters solves the problem but it brings the pop-ups and I need to do the selection through html dropdown and textboxes.
Hope I could clear where I am stuck.
Re: How to pass the value of one data set into the another dataset? [message #999346 is a reply to message #999008] Fri, 11 January 2013 21:58 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

What's your BIRT version, I'll make a simple example of the first option, including hiding the default parameter page, using the parameterpage=false url parameter.

Michael

Developer Evangelist, Silanis

[Updated on: Fri, 11 January 2013 21:59]

Report message to a moderator

Re: How to pass the value of one data set into the another dataset? [message #1000141 is a reply to message #999346] Mon, 14 January 2013 05:15 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
My BIRT version is 3.7.2
If you kindly make one example of the first example and shareit, it will be of great great help.
Am really clueless.
Thanks a lot!!!
Re: How to pass the value of one data set into the another dataset? [message #1000958 is a reply to message #997418] Tue, 15 January 2013 19:25 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

This can probably be cleaned up some, but take a look at this example. It fills a select list box using the values from a parameter ds. I use a computed column in that dataSet to concatenate the values for use in the html list box. The current parameter value is always the default, in the list box. All is the report parameter default, so All starts out selected. If the value changes, the report is ran again by calling a javascript function you can see in the text box at the top of the report. Hope this helps. Let me know if you have questions. Again, this is a quick, messy example, so you could probably clean it up some. Smile

Michael

Developer Evangelist, Silanis

[Updated on: Tue, 15 January 2013 19:26]

Report message to a moderator

Re: How to pass the value of one data set into the another dataset? [message #1001182 is a reply to message #1000958] Wed, 16 January 2013 08:01 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Thanks a lot for the help.
It helped to clear some concept.
But in the script "beforeOpen" I need to call a "stored procedure" and pass three parameters.
This is creating a problem for me.
I have written in these two ways:

this.queryText = " {call dbo.SP_RPT_EquipementSummary (Filler1,11/12/2012,12/12/2012)} ";
In the above way I have hardcoded the values.
this.queryText = " {call dbo.SP_RPT_EquipementSummary ('"+ params["Equipname"]+"',"+params["StartDate"]+","+params["EndDate"]+")} ";
In the above way,have given startdate and enddate default values

But none of these are working and hence query execution is not taking place.

Need your help.
Thanks a lot in advance!!!
Re: How to pass the value of one data set into the another dataset? [message #1001758 is a reply to message #1001182] Thu, 17 January 2013 10:33 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Hi
Michael,

Looking forward for your help regarding how to call a "stored procedure" instead of a "select query" in the "beforeOpen" method.
I need to pass three Parameters.
Re: How to pass the value of one data set into the another dataset? [message #1004182 is a reply to message #1001758] Tue, 22 January 2013 18:47 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Sorry for the delayed response. So, you're not even able to pass the stored procedure query statically? Are you getting any errors?

Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #1004415 is a reply to message #1004182] Wed, 23 January 2013 07:32 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
No I can't pass the stored procedure query.
In layout I am writing the following script:
window.location = window.location + '&EquipName=Filler1&StartDate=12/15/12&EndDate=12/16/12';

and in "beforeOpen" method
this.setInputParameterValue("@eqName", params["EquipName"]);
this.setInputParameterValue("@StartTimeUTC", params["StartDate"]);
this.setInputParameterValue("@EndTimeUTC", params["EndDate"]);

The error I am getting :
The following items have errors:


ReportDesign (id = 1):
+ There are errors evaluating script "
this.setInputParameterValue("@eqName", params["EquipName"]);
this.setInputParameterValue("@StartTimeUTC", params["StartDate"]);
this.setInputParameterValue("@EndTimeUTC", params["EndDate"]);
null. (Element ID:1)
Re: How to pass the value of one data set into the another dataset? [message #1004418 is a reply to message #1004415] Wed, 23 January 2013 07:36 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
I am attaching my code.
Really looking forward for your help..
Re: How to pass the value of one data set into the another dataset? [message #1004915 is a reply to message #1004418] Thu, 24 January 2013 05:48 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

I tested this a little bit. I just replaced the this.queryText in the beforeOpen. When doing this, I got errors until I removed the parameter markers '?' from the query in the dataset editor. After removing those, a script like the following allowed me to pass my parameters as expected, where cnum, startDate, and endDate are my correctly formatted parameter strings:

this.queryText = "{call getPaymentsByCustomerAndDate('" + cnum + "','" + startDate + "','" + endDate + "')}";


Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #1005039 is a reply to message #1004915] Thu, 24 January 2013 11:13 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
I tried implementing what you said but I still cant get the result.
Re: How to pass the value of one data set into the another dataset? [message #1005047 is a reply to message #1005039] Thu, 24 January 2013 11:28 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Could you please share the code?
Re: How to pass the value of one data set into the another dataset? [message #1005209 is a reply to message #1005047] Thu, 24 January 2013 16:37 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

In the example I provided earlier, the only reason I passed the parameters in the beforeOpen was because I used an SQL query with no where statement for the original run of the report and then only limited the returns based on what was selected in the html form in the report. If you limit the initial query results to certain values, which you'd likely have to do with a stored procedure, there should be no real reason for you to use the beforeOpen script. You should just be able to link your report parameters to your dataSet parameters in the dataSet editor.

Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #1005738 is a reply to message #1005209] Mon, 28 January 2013 13:36 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Thanks a lot..your help solved my problem..it worked.
I have a few more questions.
1>When I run the report in "webviewer" or "html" format I get to see the result covering only half of the screen where as i need it to cover the full screen.
2>Secondly even after importing a css file the changes do not get reflected.
For e.g it considers "Text" as wherever "Text" has been used and not the particular portion I want .
Re: How to pass the value of one data set into the another dataset? [message #1005741 is a reply to message #1005738] Mon, 28 January 2013 13:44 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
I am attching the code..It show all the "text" red where as I want only the "Text" of the topmost html code red.
Re: How to pass the value of one data set into the another dataset? [message #1005815 is a reply to message #1005741] Mon, 28 January 2013 20:26 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

When you say you want it to cover the whole screen, do you mean you want to spread the report out to cover the screen? Or do you want to wrap the table in a newspaper like layout?

As for the text color, can you attach a css file and a .rptdesign file that I can run to see the issue you're having? Thanks.


Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #1005860 is a reply to message #1005815] Tue, 29 January 2013 06:11 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Hi,
I am attaching the screen shot of how the report is looking when I am viewing it in "webviewer" mode.
I have applied some black arrow marks to make you understand what is the exact problem of not covering the whole screen.
Re: How to pass the value of one data set into the another dataset? [message #1005864 is a reply to message #1005860] Tue, 29 January 2013 06:16 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Now I am attaching the rpt file and css files.
This rpt file after running show the problem of all "text" portion taking red color whereas I want only the portions related to "startdate","end date" and dropdown to use the attributes of the css file named "example.css"
More over css file "view.css" sets the attributes to the table having showing the report.Anyhow the other tables never get any attribute even giving specific names.
Re: How to pass the value of one data set into the another dataset? [message #1006032 is a reply to message #1005864] Tue, 29 January 2013 15:35 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

For the not filling the page issue, you might try the auto layout. You can change this by selecting an empty spot in the report, then scrolling to the bottom of the general tab in the property editor.

I'll take a look at the other issue and let you know if I have troubles seeing it.


Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #1006220 is a reply to message #1006032] Wed, 30 January 2013 13:45 Go to previous messageGo to next message
Soumita Das is currently offline Soumita DasFriend
Messages: 19
Registered: January 2013
Junior Member
Hi Michael,
There is a new problem with the report.
When I am running it on the server for the first time it gives me correct result set passing all the three parameters.
But in the second run when I change the values of the parameters at runtime, only "equipment name" gets changed while start date and end date retains the old value.
Hence the results comes for the new equipment but with old values of start and end dates
I am attaching the file.
Need your help
Re: How to pass the value of one data set into the another dataset? [message #1006259 is a reply to message #1006220] Wed, 30 January 2013 15:39 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

With your multiple parameters, it might be easier to just build the URL, instead of trying to replace them. Just set the new location to the URL to the report, like localhost:8080/birt/frameset?__report=yourReport.rptdesign&param1=blah&param2=blah&param3=blah

Michael

Developer Evangelist, Silanis
Re: How to pass the value of one data set into the another dataset? [message #1718567 is a reply to message #1006259] Sun, 27 December 2015 12:27 Go to previous message
Yogesh Patil is currently offline Yogesh PatilFriend
Messages: 1
Registered: April 2014
Junior Member
Hi William

I am getting following error when i try to reproduce the sample for my report.

org.eclipse.birt.report.service.api.ReportServiceException: Required parameter Country is not set.
at org.eclipse.birt.report.service.ReportEngineService.throwDummyException(ReportEngineService.java:1115)
at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:943)
at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973)
at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:131)
at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:386)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:368)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.eclipse.birt.report.engine.api.impl.ParameterValidationException: Required parameter Country is not set.
at org.eclipse.birt.report.engine.api.impl.EngineTask.validateAbstractScalarParameter(EngineTask.java:803)
at org.eclipse.birt.report.engine.api.impl.EngineTask.access$0(EngineTask.java:789)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterValidationVisitor.visitScalarParameter(EngineTask.java:706)
at org.eclipse.birt.report.engine.api.impl.EngineTask$ParameterVisitor.visit(EngineTask.java:1531)
at org.eclipse.birt.report.engine.api.impl.EngineTask.doValidateParameters(EngineTask.java:692)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:95)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:937)
... 57 more
Previous Topic:How to use Spudsoft emitter and its Userproperties to export formula in birt report exporting?
Next Topic:POJO Data Set and HttpClient
Goto Forum:
  


Current Time: Thu Mar 28 19:42:18 GMT 2024

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

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

Back to the top