Home » Archived » BIRT » Passing java object to scripted data source
|
Re: Passing java object to scripted data source [message #234603 is a reply to message #234538] |
Fri, 13 April 2007 20:40 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Nisha,
Can you turn on logging in the viewer plugin web.xml and post the log?
Set the level to FINE.
Jason
Nisha Agarwal wrote:
> Hi,
>
> I am using a scripted data source (with a scripted dataset). I am using
> Java program to create a POJO, that I pass to the scripted dataset (in
> the "open" event handler. In the "fetch" event handler I iterate over
> the POJO to create the rows.
>
> The Java program uses JDBC and puts the SQL results in the POJO.
> Everything works fine as long as I use a single SQL query to generate
> the POJO. However, my application requires iterating over the results of
> the first query and doing other queries in the iteration. As soon as I
> add more than one query to my java program, the report stops working.
> When I click on the "Preview" button, it takes a very long time and I
> get an error that says "Internet Explorer cannot display the webpage..."
>
> Does anyone knows how to get around this problem?
>
> Regards,
> Nisha
>
|
|
|
Re: Passing java object to scripted data source [message #234636 is a reply to message #234603] |
Fri, 13 April 2007 22:13 |
Nisha Messages: 97 Registered: July 2009 |
Member |
|
|
Jason Weathersby wrote:
> Nisha,
> Can you turn on logging in the viewer plugin web.xml and post the log?
> Set the level to FINE.
> Jason
> Nisha Agarwal wrote:
>> Hi,
>>
>> I am using a scripted data source (with a scripted dataset). I am using
>> Java program to create a POJO, that I pass to the scripted dataset (in
>> the "open" event handler. In the "fetch" event handler I iterate over
>> the POJO to create the rows.
>>
>> The Java program uses JDBC and puts the SQL results in the POJO.
>> Everything works fine as long as I use a single SQL query to generate
>> the POJO. However, my application requires iterating over the results of
>> the first query and doing other queries in the iteration. As soon as I
>> add more than one query to my java program, the report stops working.
>> When I click on the "Preview" button, it takes a very long time and I
>> get an error that says "Internet Explorer cannot display the webpage..."
>>
>> Does anyone knows how to get around this problem?
>>
>> Regards,
>> Nisha
>>
The logfile is huge...
Here is the part of the log that has the error:
Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.QueryResults
getResultIterator
FINE: finished
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startTable
FINE: [HTMLTableEmitter] Start table
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
FINE: [HTMLReportEmitter] Start text
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
FINE: [HTMLReportEmitter] Start text
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
FINE: [HTMLReportEmitter] Start text
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
FINE: [HTMLReportEmitter] Start text
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
FINE: [HTMLReportEmitter] Start text
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
FINE: [HTMLReportEmitter] Start text
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
..
..
..
..
..
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endTable
FINE: [HTMLTableEmitter] End table
Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.ResultIterator
close
FINE: a ResultIterator is closed
Apr 13, 2007 3:07:23 PM org.eclipse.birt.report.data.oda.jdbc.Statement
close
FINE: Statement.close( )
Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.QueryResults
close
FINE: QueryResults is closed
Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.ResultIterator
close
FINE: a ResultIterator is closed
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:07:23 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
FINE: [HTMLTableEmitter] Start cell.
..
..
..
..
..
..
Apr 13, 2007 3:08:06 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startImage
FINE: [HTMLImageEmitter] Start image
Apr 13, 2007 3:08:06 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
FINE: [HTMLReportEmitter] End cell.
Apr 13, 2007 3:08:06 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endTable
FINE: [HTMLTableEmitter] End table
Apr 13, 2007 3:08:06 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r end
FINE: [HTMLReportEmitter] End body.
Apr 13, 2007 3:08:06 PM
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r end
WARNING: null
ClientAbortException: java.net.SocketException: Software caused
connection abort: socket write error
at
org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(Output Buffer.java:410)
at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.j ava:436)
at org.apache.coyote.tomcat4.OutputBuffer.doFlush(OutputBuffer. java:357)
at org.apache.coyote.tomcat4.OutputBuffer.close(OutputBuffer.ja va:321)
at
org.apache.coyote.tomcat4.CoyoteOutputStream.close(CoyoteOut putStream.java:123)
at
org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r.end(HTMLReportEmitter.java:770)
at
org.eclipse.birt.report.engine.emitter.CompositeContentEmitt er.end(CompositeContentEmitter.java:64)
at
org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:93)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:205)
at
org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:142)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source)
at
org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
Source)
at
org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
Source)
at
org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
Source)
at
org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
Source)
at
org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
Source)
at
org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
Source)
at org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known
Source)
at org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.CertificatesValve.invoke(Certific atesValve.java:246)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardCont ext.java:2422)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(Error DispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:641)
at
org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(E clipseErrorReportValve.java:153)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapte r.java:199)
at
org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:828)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.processConnection(Http11Protocol.java:700)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndp oint.java:584)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
Apr 13, 2007 3:08:06 PM org.eclipse.birt.report.data.oda.jdbc.Connection
close
FINE: Connection closed.
Apr 13, 2007 3:08:06 PM org.eclipse.birt.data.engine.impl.DataEngineImpl
shutdown
INFO: Data engine shuts down
|
|
|
Re: Passing java object to scripted data source [message #234655 is a reply to message #234636] |
Fri, 13 April 2007 22:46 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Nisha,
Does your code work fine if ran in a standalone Java app?
Jason
Nisha Agarwal wrote:
> Jason Weathersby wrote:
>
>> Nisha,
>
>> Can you turn on logging in the viewer plugin web.xml and post the log?
>> Set the level to FINE.
>
>> Jason
>
>> Nisha Agarwal wrote:
>>> Hi,
>>>
>>> I am using a scripted data source (with a scripted dataset). I am
>>> using Java program to create a POJO, that I pass to the scripted
>>> dataset (in the "open" event handler. In the "fetch" event handler I
>>> iterate over the POJO to create the rows.
>>>
>>> The Java program uses JDBC and puts the SQL results in the POJO.
>>> Everything works fine as long as I use a single SQL query to generate
>>> the POJO. However, my application requires iterating over the results
>>> of the first query and doing other queries in the iteration. As soon
>>> as I add more than one query to my java program, the report stops
>>> working. When I click on the "Preview" button, it takes a very long
>>> time and I get an error that says "Internet Explorer cannot display
>>> the webpage..."
>>>
>>> Does anyone knows how to get around this problem?
>>>
>>> Regards,
>>> Nisha
>>>
> The logfile is huge...
>
> Here is the part of the log that has the error:
>
> Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.QueryResults
> getResultIterator
> FINE: finished
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startTable
> FINE: [HTMLTableEmitter] Start table
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
> FINE: [HTMLReportEmitter] Start text
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
> FINE: [HTMLReportEmitter] Start text
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
> FINE: [HTMLReportEmitter] Start text
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
> FINE: [HTMLReportEmitter] Start text
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
> FINE: [HTMLReportEmitter] Start text
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startText
> FINE: [HTMLReportEmitter] Start text
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
>
> .
> .
> .
> .
> .
>
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endTable
> FINE: [HTMLTableEmitter] End table
> Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.ResultIterator
> close
> FINE: a ResultIterator is closed
> Apr 13, 2007 3:07:23 PM org.eclipse.birt.report.data.oda.jdbc.Statement
> close
> FINE: Statement.close( )
> Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.QueryResults
> close
> FINE: QueryResults is closed
> Apr 13, 2007 3:07:23 PM org.eclipse.birt.data.engine.impl.ResultIterator
> close
> FINE: a ResultIterator is closed
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:07:23 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startCell
> FINE: [HTMLTableEmitter] Start cell.
> .
> .
> .
> .
> .
> .
> Apr 13, 2007 3:08:06 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r startImage
> FINE: [HTMLImageEmitter] Start image
> Apr 13, 2007 3:08:06 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endCell
> FINE: [HTMLReportEmitter] End cell.
> Apr 13, 2007 3:08:06 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r endTable
> FINE: [HTMLTableEmitter] End table
> Apr 13, 2007 3:08:06 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r end
> FINE: [HTMLReportEmitter] End body.
> Apr 13, 2007 3:08:06 PM
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r end
> WARNING: null
> ClientAbortException: java.net.SocketException: Software caused
> connection abort: socket write error
> at
> org.apache.coyote.tomcat4.OutputBuffer.realWriteBytes(Output Buffer.java:410)
>
> at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.j ava:436)
> at
> org.apache.coyote.tomcat4.OutputBuffer.doFlush(OutputBuffer. java:357)
> at org.apache.coyote.tomcat4.OutputBuffer.close(OutputBuffer.ja va:321)
> at
> org.apache.coyote.tomcat4.CoyoteOutputStream.close(CoyoteOut putStream.java:123)
>
> at
> org.eclipse.birt.report.engine.emitter.html.HTMLReportEmitte r.end(HTMLReportEmitter.java:770)
>
> at
> org.eclipse.birt.report.engine.emitter.CompositeContentEmitt er.end(CompositeContentEmitter.java:64)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutE ngine.layout(HTMLReportLayoutEngine.java:93)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:205)
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:142)
>
> at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source)
> at
> org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(Unknown
> Source)
> at
> org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(Unknown
> Source)
> at
> org.eclipse.birt.report.service.actionhandler.BirtRunAndRend erActionHandler.__execute(Unknown
> Source)
> at
> org.eclipse.birt.report.service.actionhandler.AbstractBaseAc tionHandler.execute(Unknown
> Source)
> at
> org.eclipse.birt.report.presentation.aggregation.layout.Engi neFragment.doService(Unknown
> Source)
> at
> org.eclipse.birt.report.presentation.aggregation.AbstractBas eFragment.service(Unknown
> Source)
> at org.eclipse.birt.report.servlet.BirtEngineServlet.__doGet(Un known
> Source)
> at
> org.eclipse.birt.report.servlet.BaseReportEngineServlet.doGe t(Unknown
> Source)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisS ervletBase.java:327)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFi lter(ApplicationFilterChain.java:247)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(App licationFilterChain.java:193)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:256)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
> at
> org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:191)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
>
> at
> org.apache.catalina.valves.CertificatesValve.invoke(Certific atesValve.java:246)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:641)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardCont ext.java:2422)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:180)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
>
> at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(Error DispatcherValve.java:171)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:641)
>
> at
> org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(E clipseErrorReportValve.java:153)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:641)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:174)
>
> at
> org.apache.catalina.core.StandardPipeline$StandardPipelineVa lveContext.invokeNext(StandardPipeline.java:643)
>
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:480)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:995)
> at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapte r.java:199)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Proce ssor.java:828)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHand ler.processConnection(Http11Protocol.java:700)
>
> at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndp oint.java:584)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.ru n(ThreadPool.java:683)
>
> at java.lang.Thread.run(Unknown Source)
> Apr 13, 2007 3:08:06 PM org.eclipse.birt.report.data.oda.jdbc.Connection
> close
> FINE: Connection closed.
> Apr 13, 2007 3:08:06 PM org.eclipse.birt.data.engine.impl.DataEngineImpl
> shutdown
> INFO: Data engine shuts down
>
>
>
>
|
|
| | |
Re: Passing java object to scripted data source [message #234838 is a reply to message #234787] |
Mon, 16 April 2007 16:14 |
Nisha Messages: 97 Registered: July 2009 |
Member |
|
|
Thanks for your effort...I have tried to simplify the report. The XML
source of the report is attached here, followed by the java code that
creates the list.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Written by Eclipse BIRT 2.0 -->
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.6"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.1.2.v20070205-1728 Build <20070205-1728></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2006 <<Your Company Name
here>></property>
<property name="theme">Theme.defaultTheme</property>
<parameters>
<scalar-parameter name="Account" id="158">
<property name="valueType">static</property>
<property name="dataType">string</property>
<text-property name="promptText">Enter Account</text-property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
<scalar-parameter name="StartDate" id="159">
<property name="valueType">static</property>
<property name="dataType">string</property>
<text-property name="promptText">Enter start
date</text-property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
<scalar-parameter name="EndDate" id="160">
<property name="valueType">static</property>
<property name="dataType">string</property>
<text-property name="promptText">Enter End Date</text-property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
</parameters>
<data-sources>
<script-data-source name="ScripedReportsDS" id="619"/>
</data-sources>
<data-sets>
<script-data-set name="ScriptedDisenrollmentDS" id="620">
<list-property name="resultSetHints">
<structure>
<property name="position">1</property>
<property name="name">FullName</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">CareManager</property>
<property name="dataType">string</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">FullName</property>
</structure>
<structure>
<property name="columnName">CareManager</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">FullName</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">CareManager</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">ScripedReportsDS</property>
<list-property name="parameters">
<structure>
<property name="name">Account</property>
<property name="dataType">string</property>
<property name="position">1</property>
<expression
name="defaultValue">params["Account"]</expression>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
<structure>
<property name="name">StartDate</property>
<property name="dataType">string</property>
<property name="position">2</property>
<expression
name="defaultValue">params["StartDate"]</expression>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
<structure>
<property name="name">EndDate</property>
<property name="dataType">string</property>
<property name="position">3</property>
<expression
name="defaultValue">params["EndDate"]</expression>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
<structure>
<property name="name">CareManager</property>
<property name="dataType">string</property>
<property name="position">4</property>
<expression
name="defaultValue">"NishaAgarwal"</expression>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
</list-property>
<method
name="open">< ![CDATA[importPackage(Packages.com.hhn.reports.disenrollment );
var acnt = inputParams["Account"];
var startDate = inputParams["StartDate"];
var endDate = inputParams["EndDate"];
DisenrollmentBug.setReportParameters(acnt,startDate,endDate) ;
var disenrollmentDetails = DisenrollmentBug.getDetails();
iterator = disenrollmentDetails.iterator();]]></method>
<method name="fetch"><![CDATA[if (!iterator.hasNext())
{
return false;
}
else
{
var node = (DisenrollmentDetail) (iterator.next());
row["FullName"] = node.getFullName();
row["CareManager"] = node.getCareManager();
return true;
}]]></method>
</script-data-set>
</data-sets>
<styles>
<style name="MainText" id="212">
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="masterPage">HHN</property>
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new
Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<grid id="413">
<property name="width">100%</property>
<column id="414"/>
<row id="415">
<cell id="416">
<property name="colSpan">1</property>
<property name="rowSpan">1</property>
<label id="419">
<property name="style">MainText</property>
<property name="fontWeight">bold</property>
<property name="textUnderline">underline</property>
<property name="textAlign">left</property>
<text-property name="text">Disenrollment
Details</text-property>
</label>
</cell>
</row>
<row id="420">
<property name="height">0.1in</property>
<cell id="421">
<table id="781">
<property name="width">100%</property>
<property
name="dataSet">ScriptedDisenrollmentDS</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">FullName</property>
<expression
name="expression">dataSetRow["FullName"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">Program</property>
<expression
name="expression">dataSetRow["Program"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">DisenrollmentDate</property>
<expression
name="expression">dataSetRow["DisenrollmentDate"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">DisenrollmentReason</property>
<expression
name="expression">dataSetRow["DisenrollmentReason"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">Birthdate</property>
<expression
name="expression">dataSetRow["Birthdate"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">RecentResponseDate</property>
<expression
name="expression">dataSetRow["RecentResponseDate"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">CareManager</property>
<expression
name="expression">dataSetRow["CareManager"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">PrimaryPhysician</property>
<expression
name="expression">dataSetRow["PrimaryPhysician"]</expression >
<property name="dataType">string</property>
</structure>
</list-property>
<column id="825"/>
<column id="838"/>
<header>
<row id="782">
<cell id="783">
<label id="784">
<text-property
name="text">FullName</text-property>
</label>
</cell>
<cell id="835">
<label id="843">
<text-property
name="text">CareManager</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="799">
<cell id="800">
<data id="801">
<property
name="resultSetColumn">FullName</property>
</data>
</cell>
<cell id="836">
<data id="844">
<property
name="resultSetColumn">CareManager</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="816">
<cell id="817"/>
<cell id="837"/>
</row>
</footer>
</table>
</cell>
</row>
<row id="417">
<cell id="418"/>
</row>
<row id="558">
<cell id="559"/>
</row>
</grid>
</body>
</report>
***********Java Script in DataSet's open method:*****************
importPackage(Packages.com.hhn.reports.disenrollment);
var acnt = inputParams["Account"];
var startDate = inputParams["StartDate"];
var endDate = inputParams["EndDate"];
DisenrollmentBug.setReportParameters(acnt,startDate,endDate) ;
var disenrollmentDetails = DisenrollmentBug.getDetails();
iterator = disenrollmentDetails.iterator();
***********Java Script in DataSet's fetch method:*****************
if (!iterator.hasNext())
{
return false;
}
else
{
var node = (DisenrollmentDetail) (iterator.next());
row["FullName"] = node.getFullName();
row["CareManager"] = node.getCareManager();
return true;
}
***********Java Code that generates the list************
package com.hhn.reports.disenrollment;
import hhn.DataExtract;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
public class DisenrollmentBug {
private static DisenrollmentReportParameters parameters = null;
private static List disenrollmentDetails = null;
public static void setReportParameters(String acntID,String
startDate,String endDate)
{
if (parameters == null)
parameters = new DisenrollmentReportParameters();
if (acntID != null)
parameters.setAcntID(acntID);
if (startDate != null)
parameters.setStartDate(startDate);
if (endDate != null)
parameters.setEndDate(endDate);
}
public static List getDetails()
{
generateDetails();
generateEntityData(disenrollmentDetails);
return disenrollmentDetails;
}
private static void generateDetails()
{
disenrollmentDetails = new ArrayList();
String dateFormat = "mm/DD/YYYY";
DataExtract dataExtract = new
DataExtract("jdbc:oracle:thin:@216.243.75.156:1521:hhnprd",
"hhnselect", "s3l3ct0nly!");
String detailsQuery = getDetailsQuery(dateFormat);
try
{
ResultSet rs = dataExtract.connectAndQuery(detailsQuery);
while (rs.next())
{
DisenrollmentDetail detailRow = new DisenrollmentDetail();
String patId = rs.getString("pat_id");
String fName = rs.getString("pat_1st_name");
String lName = rs.getString("pat_last_name");
String fullName = constructFullNameAndID(lName, fName);
detailRow.setFullName(fullName);
disenrollmentDetails.add(detailRow);
}
dataExtract.closeDBConnection(rs);
}
catch (ClassNotFoundException cnf) {
cnf.printStackTrace();
}
catch (SQLException sql) {
sql.printStackTrace();
}
//return disenrollmentDetails;
}
private static void generateEntityData(List details)
{
DataExtract dataExtract = new
DataExtract("jdbc:oracle:thin:@216.243.75.156:1521:hhnprd",
"hhnselect", "s3l3ct0nly!");
for (int i = 0; i < details.size(); i++)
{
DisenrollmentDetail row = (DisenrollmentDetail)details.get(i);
String patId = row.getPatId();
String cmName = null;
String physicianName = null;
if (patId != null)
{
try {
String entQuery = getEntityData(patId);
ResultSet rs2 = dataExtract.connectAndQuery(entQuery);
while (rs2.next())
{
int entRoleCd = rs2.getInt("acnt_ent_role_cd");
String entName = rs2.getString("acnt_ent_name");
if (entRoleCd == 1)
{
// Care Manager
cmName = entName;
row.setCareManager(cmName);
}
}
dataExtract.closeDBConnection(rs2);
}
catch (ClassNotFoundException cnf) {
cnf.printStackTrace();
}
catch (SQLException sql) {
sql.printStackTrace();
}
}
}
}
private static String getDetailsQuery(String dateFormat)
{
String query = null;
query = "select distinct p.pat_id, p.pat_last_name,p.pat_1st_name " +
"from hhero.pat p, " +
"HHERO.CONNECT_ERA_SUMMARY ces " +
"where p.acnt_id = '" + parameters.getAcntID() + "' and " +
"ces.disenrollment_date is not null and " +
"ces.acnt_id = p.acnt_id and ces.pat_id = p.pat_id and " +
"ces.disenrollment_date between to_date('" + parameters.getStartDate() +
"', '" + dateFormat + "') and " +
"to_date('" + parameters.getEndDate() + "', '" + dateFormat + "')";
return query;
}
private static String getEntityData(String patId)
{
String query = null;
query = "select pe.acnt_ent_role_cd, ae.acnt_ent_name " +
"from pat_ent pe, acnt_ent ae " +
"where pe.pat_id = '" + patId + "' and " +
"ae.acnt_id = '" + parameters.getAcntID() + "' and " +
"pe.acnt_id = ae.acnt_id and pe.ent_id = ae.ent_id";
return query;
}
private static String constructFullNameAndID(String lName, String fName)
{
String fullName = "";
if (lName != null)
fullName += lName;
if (fName != null)
{
fullName += ", ";
fullName += fName;
}
return fullName;
}
public static void main(String args[])
{
DisenrollmentBug.setReportParameters("10050", "01/01/2000",
"01/01/2007");
DisenrollmentBug.generateDetails();
}
}
**********Java Code******************
|
|
|
Re: Passing java object to scripted data source [message #235017 is a reply to message #234838] |
Tue, 17 April 2007 15:56 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Nisha,
Can try moving this
dataExtract.closeDBConnection(rs2);
to the bottom of this if
for (int i = 0; i < details.size(); i++)
Also in your test main
add
generateEntityData(disenrollmentDetails);
and run again.
Jason
Nisha Agarwal wrote:
> Thanks for your effort...I have tried to simplify the report. The XML
> source of the report is attached here, followed by the java code that
> creates the list.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- Written by Eclipse BIRT 2.0 -->
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.6"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.1.2.v20070205-1728 Build <20070205-1728></property>
> <property name="units">in</property>
> <property name="comments">Copyright (c) 2006 <<Your Company
> Name here>></property>
> <property name="theme">Theme.defaultTheme</property>
> <parameters>
> <scalar-parameter name="Account" id="158">
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <text-property name="promptText">Enter Account</text-property>
> <property name="controlType">text-box</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> <scalar-parameter name="StartDate" id="159">
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <text-property name="promptText">Enter start
> date</text-property>
> <property name="controlType">text-box</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> <scalar-parameter name="EndDate" id="160">
> <property name="valueType">static</property>
> <property name="dataType">string</property>
> <text-property name="promptText">Enter End Date</text-property>
> <property name="controlType">text-box</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <data-sources>
> <script-data-source name="ScripedReportsDS" id="619"/>
> </data-sources>
> <data-sets>
> <script-data-set name="ScriptedDisenrollmentDS" id="620">
> <list-property name="resultSetHints">
> <structure>
> <property name="position">1</property>
> <property name="name">FullName</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">CareManager</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> <list-property name="columnHints">
> <structure>
> <property name="columnName">FullName</property>
> </structure>
> <structure>
> <property name="columnName">CareManager</property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">FullName</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">CareManager</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">ScripedReportsDS</property>
> <list-property name="parameters">
> <structure>
> <property name="name">Account</property>
> <property name="dataType">string</property>
> <property name="position">1</property>
> <expression
> name="defaultValue">params["Account"]</expression>
> <property name="isInput">true</property>
> <property name="isOutput">false</property>
> </structure>
> <structure>
> <property name="name">StartDate</property>
> <property name="dataType">string</property>
> <property name="position">2</property>
> <expression
> name="defaultValue">params["StartDate"]</expression>
> <property name="isInput">true</property>
> <property name="isOutput">false</property>
> </structure>
> <structure>
> <property name="name">EndDate</property>
> <property name="dataType">string</property>
> <property name="position">3</property>
> <expression
> name="defaultValue">params["EndDate"]</expression>
> <property name="isInput">true</property>
> <property name="isOutput">false</property>
> </structure>
> <structure>
> <property name="name">CareManager</property>
> <property name="dataType">string</property>
> <property name="position">4</property>
> <expression
> name="defaultValue">"NishaAgarwal"</expression>
> <property name="isInput">true</property>
> <property name="isOutput">false</property>
> </structure>
> </list-property>
> <method
> name="open">< ![CDATA[importPackage(Packages.com.hhn.reports.disenrollment );
>
> var acnt = inputParams["Account"];
> var startDate = inputParams["StartDate"];
> var endDate = inputParams["EndDate"];
>
>
> DisenrollmentBug.setReportParameters(acnt,startDate,endDate) ;
>
> var disenrollmentDetails = DisenrollmentBug.getDetails();
> iterator = disenrollmentDetails.iterator();]]></method>
> <method name="fetch"><![CDATA[if (!iterator.hasNext())
> {
> return false;
> }
> else
> {
> var node = (DisenrollmentDetail) (iterator.next());
>
> row["FullName"] = node.getFullName();
> row["CareManager"] = node.getCareManager();
> return true;
>
> }]]></method>
> </script-data-set>
> </data-sets>
> <styles>
> <style name="MainText" id="212">
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> </style>
> </styles>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2">
> <page-footer>
> <text id="3">
> <property name="masterPage">HHN</property>
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[<value-of>new
> Date()</value-of>]]></text-property>
> </text>
> </page-footer>
> </simple-master-page>
> </page-setup>
> <body>
> <grid id="413">
> <property name="width">100%</property>
> <column id="414"/>
> <row id="415">
> <cell id="416">
> <property name="colSpan">1</property>
> <property name="rowSpan">1</property>
> <label id="419">
> <property name="style">MainText</property>
> <property name="fontWeight">bold</property>
> <property name="textUnderline">underline</property>
> <property name="textAlign">left</property>
> <text-property name="text">Disenrollment
> Details</text-property>
> </label>
> </cell>
> </row>
> <row id="420">
> <property name="height">0.1in</property>
> <cell id="421">
> <table id="781">
> <property name="width">100%</property>
> <property
> name="dataSet">ScriptedDisenrollmentDS</property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">FullName</property>
> <expression
> name="expression">dataSetRow["FullName"]</expression>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">Program</property>
> <expression
> name="expression">dataSetRow["Program"]</expression>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property
> name="name">DisenrollmentDate</property>
> <expression
> name="expression">dataSetRow["DisenrollmentDate"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property
> name="name">DisenrollmentReason</property>
> <expression
> name="expression">dataSetRow["DisenrollmentReason"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">Birthdate</property>
> <expression
> name="expression">dataSetRow["Birthdate"]</expression>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property
> name="name">RecentResponseDate</property>
> <expression
> name="expression">dataSetRow["RecentResponseDate"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">CareManager</property>
> <expression
> name="expression">dataSetRow["CareManager"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property
> name="name">PrimaryPhysician</property>
> <expression
> name="expression">dataSetRow["PrimaryPhysician"]</expression >
> <property name="dataType">string</property>
> </structure>
> </list-property>
> <column id="825"/>
> <column id="838"/>
> <header>
> <row id="782">
> <cell id="783">
> <label id="784">
> <text-property
> name="text">FullName</text-property>
> </label>
> </cell>
> <cell id="835">
> <label id="843">
> <text-property
> name="text">CareManager</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="799">
> <cell id="800">
> <data id="801">
> <property
> name="resultSetColumn">FullName</property>
> </data>
> </cell>
> <cell id="836">
> <data id="844">
> <property
> name="resultSetColumn">CareManager</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="816">
> <cell id="817"/>
> <cell id="837"/>
> </row>
> </footer>
> </table>
> </cell>
> </row>
> <row id="417">
> <cell id="418"/>
> </row>
> <row id="558">
> <cell id="559"/>
> </row>
> </grid>
> </body>
> </report>
>
> ***********Java Script in DataSet's open method:*****************
> importPackage(Packages.com.hhn.reports.disenrollment);
>
> var acnt = inputParams["Account"];
> var startDate = inputParams["StartDate"];
> var endDate = inputParams["EndDate"];
>
>
> DisenrollmentBug.setReportParameters(acnt,startDate,endDate) ;
>
> var disenrollmentDetails = DisenrollmentBug.getDetails();
> iterator = disenrollmentDetails.iterator();
>
> ***********Java Script in DataSet's fetch method:*****************
>
> if (!iterator.hasNext())
> {
> return false;
> }
> else
> {
> var node = (DisenrollmentDetail) (iterator.next());
>
> row["FullName"] = node.getFullName();
> row["CareManager"] = node.getCareManager();
> return true;
>
> }
>
> ***********Java Code that generates the list************
> package com.hhn.reports.disenrollment;
>
> import hhn.DataExtract;
>
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.util.ArrayList;
> import java.util.List;
>
> public class DisenrollmentBug {
>
> private static DisenrollmentReportParameters parameters = null;
> private static List disenrollmentDetails = null;
>
> public static void setReportParameters(String acntID,String
> startDate,String endDate)
> {
> if (parameters == null)
> parameters = new DisenrollmentReportParameters();
>
> if (acntID != null)
> parameters.setAcntID(acntID);
> if (startDate != null)
> parameters.setStartDate(startDate);
> if (endDate != null)
> parameters.setEndDate(endDate);
> }
>
> public static List getDetails()
> {
> generateDetails();
> generateEntityData(disenrollmentDetails);
> return disenrollmentDetails;
> }
>
> private static void generateDetails()
> {
> disenrollmentDetails = new ArrayList();
> String dateFormat = "mm/DD/YYYY";
> DataExtract dataExtract = new
> DataExtract("jdbc:oracle:thin:@216.243.75.156:1521:hhnprd",
> "hhnselect", "s3l3ct0nly!");
> String detailsQuery = getDetailsQuery(dateFormat);
>
> try {
> ResultSet rs = dataExtract.connectAndQuery(detailsQuery);
>
> while (rs.next())
> {
> DisenrollmentDetail detailRow = new DisenrollmentDetail();
>
> String patId = rs.getString("pat_id");
> String fName = rs.getString("pat_1st_name");
> String lName = rs.getString("pat_last_name");
> String fullName = constructFullNameAndID(lName, fName);
>
> detailRow.setFullName(fullName);
>
> disenrollmentDetails.add(detailRow);
> }
> dataExtract.closeDBConnection(rs);
> }
> catch (ClassNotFoundException cnf) {
> cnf.printStackTrace();
> }
> catch (SQLException sql) {
> sql.printStackTrace();
> }
> //return disenrollmentDetails;
> }
>
> private static void generateEntityData(List details)
> {
> DataExtract dataExtract = new
> DataExtract("jdbc:oracle:thin:@216.243.75.156:1521:hhnprd",
> "hhnselect", "s3l3ct0nly!");
> for (int i = 0; i < details.size(); i++)
> {
> DisenrollmentDetail row = (DisenrollmentDetail)details.get(i);
> String patId = row.getPatId();
>
> String cmName = null;
> String physicianName = null;
>
> if (patId != null)
> {
>
> try {
> String entQuery = getEntityData(patId);
> ResultSet rs2 = dataExtract.connectAndQuery(entQuery);
>
> while (rs2.next())
> {
> int entRoleCd = rs2.getInt("acnt_ent_role_cd");
> String entName = rs2.getString("acnt_ent_name");
> if (entRoleCd == 1)
> {
> // Care Manager
> cmName = entName;
> row.setCareManager(cmName);
> }
> }
> dataExtract.closeDBConnection(rs2);
> } catch (ClassNotFoundException cnf) {
> cnf.printStackTrace();
> }
> catch (SQLException sql) {
> sql.printStackTrace();
> }
> }
> }
>
> }
>
> private static String getDetailsQuery(String dateFormat)
> {
> String query = null;
> query = "select distinct p.pat_id,
> p.pat_last_name,p.pat_1st_name " +
> "from hhero.pat p, " +
> "HHERO.CONNECT_ERA_SUMMARY ces " +
> "where p.acnt_id = '" + parameters.getAcntID() + "' and " +
> "ces.disenrollment_date is not null and " +
> "ces.acnt_id = p.acnt_id and ces.pat_id = p.pat_id and " +
> "ces.disenrollment_date between to_date('" +
> parameters.getStartDate() + "', '" + dateFormat + "') and " +
> "to_date('" + parameters.getEndDate() + "', '" + dateFormat + "')";
>
> return query;
> }
>
> private static String getEntityData(String patId)
> {
> String query = null;
> query = "select pe.acnt_ent_role_cd, ae.acnt_ent_name " +
> "from pat_ent pe, acnt_ent ae " +
> "where pe.pat_id = '" + patId + "' and " +
> "ae.acnt_id = '" + parameters.getAcntID() + "' and " +
> "pe.acnt_id = ae.acnt_id and pe.ent_id = ae.ent_id";
>
> return query;
> }
>
> private static String constructFullNameAndID(String lName, String
> fName)
> {
> String fullName = "";
> if (lName != null)
> fullName += lName;
>
> if (fName != null)
> {
> fullName += ", ";
> fullName += fName;
> }
>
> return fullName;
> }
> public static void main(String args[])
> {
> DisenrollmentBug.setReportParameters("10050", "01/01/2000",
> "01/01/2007");
> DisenrollmentBug.generateDetails();
> }
>
> }
>
>
>
> **********Java Code******************
>
>
>
|
|
| | | | | | | |
Re: Passing java object to scripted data source [message #235540 is a reply to message #235241] |
Thu, 19 April 2007 14:55 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Nisha,
Could you try making both connections static?
This may have to do with how the scripted data source handles class
instances.
Jason
Nisha Agarwal wrote:
> No, when I run it standalone, it works flawlessly.
>
> Nisha
>
|
|
| | | | | | |
Goto Forum:
Current Time: Thu Apr 18 07:20:40 GMT 2024
Powered by FUDForum. Page generated in 0.03745 seconds
|