Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Populate HTML list box with the values from a Data set
Populate HTML list box with the values from a Data set [message #736091] Thu, 13 October 2011 14:59 Go to next message
Anurag  is currently offline Anurag Friend
Messages: 47
Registered: September 2011
Member
I want to populate HTML list box with the values from a Data set. Exactly same functionality is there in attached report. But I am not able to get it working in my report.

In HTML text there is following

<select name='ordernmbr'>
<VALUE-OF format="HTML">scriptstring;</VALUE-OF>
</select>

But I am not able to get from where this scriptstring; is coming. Also I have found that there is hidden table. I have also created similar hidden table from the Data Set for which I want to create populated List Box. But what I am getting after runnin report is empty List Box. I am not able to find what I am missing to get populated HTML list box from Data Set.

Thank you,

Anurag
Re: Populate HTML list box with the values from a Data set [message #736132 is a reply to message #736091] Thu, 13 October 2011 16:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Anurag,

The hidden table's detail row has an onCreate script that creates the
options:

var colval = this.getRowData().getColumnValue(0);
scriptstring= scriptstring + "<option value='" + colval +
"'>"+colval+"</option>";

This is called for every row of the table.

Jason

On 10/13/2011 10:59 AM, Anurag wrote:
> I want to populate HTML list box with the values from a Data set. Exactly same functionality is there in attached report. But I am not able to get it working in my report.
>
> In HTML text there is following
>
> <select name='ordernmbr'>
> <VALUE-OF format="HTML">scriptstring;</VALUE-OF>
> </select>
>
> But I am not able to get from where this scriptstring; is coming. Also I have found that there is hidden table. I have also created similar hidden table from the Data Set for which I want to create populated List Box. But what I am getting after runnin report is empty List Box. I am not able to find what I am missing to get populated HTML list box from Data Set.
>
> Thank you,
>
> Anurag
Re: Populate HTML list box with the values from a Data set [message #736648 is a reply to message #736132] Fri, 14 October 2011 07:32 Go to previous messageGo to next message
Anurag  is currently offline Anurag Friend
Messages: 47
Registered: September 2011
Member
Thank you Jason for reply. I have put following in onCreate script of hidden table's detail row.

var colval = this.getRowData().getColumnValue(0);
scriptstring= scriptstring + "<option value='" + colval + 
"'>"+colval+"</option>";


It is giving errors

org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "scriptstring;":
ReferenceError: "scriptstring" is not defined. (<inline>#1) (Element ID:1)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1206)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1164)
	at org.eclipse.birt.report.engine.executor.ReportItemExecutor.evaluate(ReportItemExecutor.java:288)
	at org.eclipse.birt.report.engine.executor.TextItemExecutor.executeHtmlText(TextItemExecutor.java:115)
	at org.eclipse.birt.report.engine.executor.TextItemExecutor.execute(TextItemExecutor.java:70)
	at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
	at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
	at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
	at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
	at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
	at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
	at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
	at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
	at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:260)
	at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:85)
	at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1317)
	at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
	at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
	at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
	at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
	at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
	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.handleGetPage(BirtDocumentProcessor.java:87)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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:727)
	at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	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:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "scriptstring;":
ReferenceError: "scriptstring" is not defined. (<inline>#1)
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)
	at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:777)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:706)
	at org.eclipse.birt.report.engine.executor.ReportItemExecutor.evaluate(ReportItemExecutor.java:284)
	... 66 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "scriptstring" is not defined. (<inline>#1)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
	at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
	at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1758)
	at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1697)
	at org.mozilla.javascript.gen.c35._c0(<inline>:1)
	at org.mozilla.javascript.gen.c35.call(<inline>)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
	at org.mozilla.javascript.gen.c35.call(<inline>)
	at org.mozilla.javascript.gen.c35.exec(<inline>)
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
	... 70 more
	PopulateListBoxFromDataSet.rptdesign	/demo	line 2	BIRT Viewer Problem



org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "var colval = this.getRowData().getColumnValue(0);
scriptstring = scriptstring + "<option value='" + colval + "'>"+colval+"</option>";":
ReferenceError: "scriptstring" is not defined. (/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]#2) (Element ID:170)
	at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:158)
	at org.eclipse.birt.report.engine.script.internal.RowScriptExecutor.handleOnCreate(RowScriptExecutor.java:64)
	at org.eclipse.birt.report.engine.script.internal.OnCreateScriptVisitor.visitRow(OnCreateScriptVisitor.java:168)
	at org.eclipse.birt.report.engine.ir.RowDesign.accept(RowDesign.java:108)
	at org.eclipse.birt.report.engine.script.internal.OnCreateScriptVisitor.onCreate(OnCreateScriptVisitor.java:74)
	at org.eclipse.birt.report.engine.executor.ReportItemExecutor.handleOnCreate(ReportItemExecutor.java:911)
	at org.eclipse.birt.report.engine.executor.RowExecutor.execute(RowExecutor.java:83)
	at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
	at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
	at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
	at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
	at org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:441)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.handleVisibility(HTMLAbstractLM.java:374)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:123)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
	at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
	at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
	at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:260)
	at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:85)
	at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1317)
	at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
	at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
	at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
	at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
	at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
	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.handleGetPage(BirtDocumentProcessor.java:87)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	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:727)
	at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	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:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "var colval = this.getRowData().getColumnValue(0);
scriptstring = scriptstring + "<option value='" + colval + "'>"+colval+"</option>";":
ReferenceError: "scriptstring" is not defined. (/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]#2)
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)
	at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:777)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:706)
	at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:61)
	at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:48)
	at org.eclipse.birt.report.engine.script.internal.RowScriptExecutor.handleOnCreate(RowScriptExecutor.java:56)
	... 73 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "scriptstring" is not defined. (/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]#2)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
	at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
	at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
	at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1758)
	at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1697)
	at org.mozilla.javascript.gen.c37._c0(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]:2)
	at org.mozilla.javascript.gen.c37.call(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"])
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
	at org.mozilla.javascript.gen.c37.call(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"])
	at org.mozilla.javascript.gen.c37.exec(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"])
	at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
	... 79 more
	PopulateListBoxFromDataSet.rptdesign	/demo	line 231	BIRT Viewer Problem


This is my report

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22" id="1">
    <property name="createdBy">Eclipse BIRT Designer Version 3.7.0.v20110602 Build &lt;3.7.0.v20110607-1526></property>
    <property name="units">in</property>
    <property name="iconFile">/templates/blank_report.gif</property>
    <property name="bidiLayoutOrientation">ltr</property>
    <property name="imageDPI">96</property>
    <parameters>
        <scalar-parameter name="RP_City" id="187">
            <property name="valueType">static</property>
            <property name="isRequired">false</property>
            <property name="dataType">string</property>
            <property name="distinct">true</property>
            <simple-property-list name="defaultValue">
                <value type="constant">AHMEDABAD</value>
            </simple-property-list>
            <list-property name="selectionList"/>
            <property name="paramType">simple</property>
            <property name="controlType">text-box</property>
            <structure name="format">
                <property name="category">Unformatted</property>
            </structure>
        </scalar-parameter>
    </parameters>
    <data-sources>
        <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Claris Data Source" id="7">
            <list-property name="privateDriverProperties">
                <ex-property>
                    <name>disabledMetadataBidiFormatStr</name>
                </ex-property>
                <ex-property>
                    <name>disabledContentBidiFormatStr</name>
                </ex-property>
                <ex-property>
                    <name>contentBidiFormatStr</name>
                    <value>ILYNN</value>
                </ex-property>
                <ex-property>
                    <name>metadataBidiFormatStr</name>
                    <value>ILYNN</value>
                </ex-property>
            </list-property>
            <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
            <property name="odaURL">jdbc:mysql://172.16.0.20:3306/leosatyen_claris</property>
            <property name="odaUser">claris</property>
            <encrypted-property name="odaPassword" encryptionID="base64">Y2xhcmlzMTIz</encrypted-property>
        </oda-data-source>
    </data-sources>
    <data-sets>
        <oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="Data Set" id="156">
            <list-property name="columnHints">
                <structure>
                    <property name="columnName">name</property>
                    <property name="analysis">attribute</property>
                    <text-property name="displayName">name</text-property>
                    <text-property name="heading">name</text-property>
                </structure>
            </list-property>
            <structure name="cachedMetaData">
                <list-property name="resultSet">
                    <structure>
                        <property name="position">1</property>
                        <property name="name">name</property>
                        <property name="dataType">string</property>
                    </structure>
                </list-property>
            </structure>
            <property name="dataSource">Claris Data Source</property>
            <list-property name="resultSet">
                <structure>
                    <property name="position">1</property>
                    <property name="name">name</property>
                    <property name="nativeName">name</property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                </structure>
            </list-property>
            <xml-property name="queryText"><![CDATA[select name
 from cl_cities]]></xml-property>
            <xml-property name="designerValues"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<model:DesignValues xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design" xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
  <Version>2.0</Version>
  <design:ResultSets derivedMetaData="true">
    <design:resultSetDefinitions>
      <design:resultSetColumns>
        <design:resultColumnDefinitions>
          <design:attributes>
            <design:identifier>
              <design:name>name</design:name>
              <design:position>1</design:position>
            </design:identifier>
            <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
            <design:precision>255</design:precision>
            <design:scale>0</design:scale>
            <design:nullability>Nullable</design:nullability>
            <design:uiHints>
              <design:displayName>name</design:displayName>
            </design:uiHints>
          </design:attributes>
          <design:usageHints>
            <design:label>name</design:label>
            <design:formattingHints>
              <design:displaySize>255</design:displaySize>
            </design:formattingHints>
          </design:usageHints>
        </design:resultColumnDefinitions>
      </design:resultSetColumns>
      <design:criteria/>
    </design:resultSetDefinitions>
  </design:ResultSets>
</model:DesignValues>]]></xml-property>
        </oda-data-set>
    </data-sets>
    <styles>
        <style name="report" id="4">
            <property name="fontFamily">sans-serif</property>
            <property name="fontSize">10pt</property>
        </style>
        <style name="crosstab-cell" id="5">
            <property name="borderBottomColor">#CCCCCC</property>
            <property name="borderBottomStyle">solid</property>
            <property name="borderBottomWidth">1pt</property>
            <property name="borderLeftColor">#CCCCCC</property>
            <property name="borderLeftStyle">solid</property>
            <property name="borderLeftWidth">1pt</property>
            <property name="borderRightColor">#CCCCCC</property>
            <property name="borderRightStyle">solid</property>
            <property name="borderRightWidth">1pt</property>
            <property name="borderTopColor">#CCCCCC</property>
            <property name="borderTopStyle">solid</property>
            <property name="borderTopWidth">1pt</property>
        </style>
        <style name="crosstab" id="6">
            <property name="borderBottomColor">#CCCCCC</property>
            <property name="borderBottomStyle">solid</property>
            <property name="borderBottomWidth">1pt</property>
            <property name="borderLeftColor">#CCCCCC</property>
            <property name="borderLeftStyle">solid</property>
            <property name="borderLeftWidth">1pt</property>
            <property name="borderRightColor">#CCCCCC</property>
            <property name="borderRightStyle">solid</property>
            <property name="borderRightWidth">1pt</property>
            <property name="borderTopColor">#CCCCCC</property>
            <property name="borderTopStyle">solid</property>
            <property name="borderTopWidth">1pt</property>
        </style>
    </styles>
    <page-setup>
        <simple-master-page name="Simple MasterPage" id="2">
            <page-footer>
                <text id="3">
                    <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>
        <text id="155">
            <property name="contentType">html</property>
            <text-property name="content"><![CDATA[
<form name='frm' action="">
<script language="javascript">


function reloadPage(form) {
	var sel1 = form.RP_City;
	//alert("Reload Page");
	var temp = new String(location.href);
	var targetURL = new String();
    var xyz = -1;
    
    xyz=temp.indexOf("__overwrite=")
    
	if( xyz != -1 ){
		//alert( xyz );
		targetURL = temp.substring(0, xyz-1);
		//alert(temp.substring(0, xyz-1));
	}else{
		targetURL = temp;
	}
	
	targetURL += "&amp;__overwrite=true";
	targetURL += "&amp;RP_City=" + form.RP_City.value;

	

	//alert( targetURL );	

	//window.location.href = targetURL;
	document.location.replace(targetURL);


}
</script>


<select name='RP_City'>
<VALUE-OF format="HTML">scriptstring;</VALUE-OF>
</select>
<INPUT Type="BUTTON" name="mybutton" Value="Refresh" onClick='reloadPage(this.form)'></INPUT>
</form>]]></text-property>
        </text>
        <table id="167">
            <property name="dataSet">Data Set</property>
            <list-property name="visibility">
                <structure>
                    <property name="format">all</property>
                    <expression name="valueExpr" type="javascript">true</expression>
                </structure>
            </list-property>
            <list-property name="boundDataColumns">
                <structure>
                    <property name="name">name</property>
                    <text-property name="displayName">name</text-property>
                    <expression name="expression" type="javascript">dataSetRow["name"]</expression>
                    <property name="dataType">string</property>
                </structure>
            </list-property>
            <column id="174"/>
            <header>
                <row id="168">
                    <cell id="169">
                        <label id="175">
                            <text-property name="text">name</text-property>
                        </label>
                    </cell>
                </row>
            </header>
            <detail>
                <row id="170">
                    <method name="onCreate"><![CDATA[var colval = this.getRowData().getColumnValue(0);
scriptstring = scriptstring + "<option value='" + colval + "'>"+colval+"</option>";
]]></method>
                    <cell id="171">
                        <data id="176">
                            <property name="resultSetColumn">name</property>
                        </data>
                    </cell>
                </row>
            </detail>
            <footer>
                <row id="172">
                    <cell id="173"/>
                </row>
            </footer>
        </table>
    </body>
</report>


Thank you,

Anurag

Re: Populate HTML list box with the values from a Data set [message #736983 is a reply to message #736648] Fri, 14 October 2011 14:39 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Did you add the following to the beforeFactory?
scriptstring = "";

You could also just add this to the top of the onCreate script you have:

if( typeof scriptstring == 'undefined'){
scriptstring = "";
}

Jason


On 10/14/2011 3:32 AM, Anurag wrote:
> Thank you Jason for reply. I have put following in onCreate script of
> hidden table's detail row.
>
> var colval = this.getRowData().getColumnValue(0);
> scriptstring= scriptstring + "<option value='" + colval +
> "'>"+colval+"</option>";
>
> It is giving errors
>
> org.eclipse.birt.report.engine.api.EngineException: There are errors
> evaluating script "scriptstring;":
> ReferenceError: "scriptstring" is not defined. (<inline>#1) (Element ID:1)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1206)
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1164)
>
> at
> org.eclipse.birt.report.engine.executor.ReportItemExecutor.evaluate(ReportItemExecutor.java:288)
>
> at
> org.eclipse.birt.report.engine.executor.TextItemExecutor.executeHtmlText(TextItemExecutor.java:115)
>
> at
> org.eclipse.birt.report.engine.executor.TextItemExecutor.execute(TextItemExecutor.java:70)
>
> at
> org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
>
> at
> org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
>
> at
> org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
>
> at
> org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
>
> at
> org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:65)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
>
> at
> org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
>
> at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:260)
> at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:85)
> at
> org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1317)
>
> at
> org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
>
> at
> org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
>
> at
> org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
>
> at
> org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
>
> at
> org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
>
> 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.handleGetPage(BirtDocumentProcessor.java:87)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> 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(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> 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:727)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 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:126)
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
>
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
>
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> Caused by: org.eclipse.birt.core.exception.CoreException: There are
> errors evaluating script "scriptstring;":
> ReferenceError: "scriptstring" is not defined. (<inline>#1)
> at
> org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)
>
> at
> org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:777)
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:706)
>
> at
> org.eclipse.birt.report.engine.executor.ReportItemExecutor.evaluate(ReportItemExecutor.java:284)
>
> ... 66 more
> Caused by: org.mozilla.javascript.EcmaError: ReferenceError:
> "scriptstring" is not defined. (<inline>#1)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
>
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
>
> at
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
> at
> org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1758)
>
> at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1697)
> at org.mozilla.javascript.gen.c35._c0(<inline>:1)
> at org.mozilla.javascript.gen.c35.call(<inline>)
> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
> at org.mozilla.javascript.gen.c35.call(<inline>)
> at org.mozilla.javascript.gen.c35.exec(<inline>)
> at
> org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
>
> ... 70 more
> PopulateListBoxFromDataSet.rptdesign /demo line 2 BIRT Viewer Problem
>
>
>
> org.eclipse.birt.report.engine.api.EngineException: There are errors
> evaluating script "var colval = this.getRowData().getColumnValue(0);
> scriptstring = scriptstring + "<option value='" + colval +
> "'>"+colval+"</option>";":
> ReferenceError: "scriptstring" is not defined.
> (/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]#2)
> (Element ID:170)
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:158)
>
> at
> org.eclipse.birt.report.engine.script.internal.RowScriptExecutor.handleOnCreate(RowScriptExecutor.java:64)
>
> at
> org.eclipse.birt.report.engine.script.internal.OnCreateScriptVisitor.visitRow(OnCreateScriptVisitor.java:168)
>
> at org.eclipse.birt.report.engine.ir.RowDesign.accept(RowDesign.java:108)
> at
> org.eclipse.birt.report.engine.script.internal.OnCreateScriptVisitor.onCreate(OnCreateScriptVisitor.java:74)
>
> at
> org.eclipse.birt.report.engine.executor.ReportItemExecutor.handleOnCreate(ReportItemExecutor.java:911)
>
> at
> org.eclipse.birt.report.engine.executor.RowExecutor.execute(RowExecutor.java:83)
>
> at
> org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
>
> at
> org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:46)
>
> at
> org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:43)
>
> at
> org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:46)
>
> at
> org.eclipse.birt.report.engine.internal.executor.l18n.LocalizedReportItemExecutor.execute(LocalizedReportItemExecutor.java:34)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:441)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.traverse(HTMLAbstractLM.java:442)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.handleVisibility(HTMLAbstractLM.java:374)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:123)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:92)
>
> at
> org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:100)
>
> at
> org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:249)
>
> at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:260)
> at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:85)
> at
> org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1317)
>
> at
> org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:158)
>
> at
> org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
>
> at
> org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
>
> at
> org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
>
> at
> org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
>
> 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.handleGetPage(BirtDocumentProcessor.java:87)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> 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(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> 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:727)
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> 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:126)
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
>
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> at org.mortbay.jetty.Server.handle(Server.java:326)
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
>
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
> Caused by: org.eclipse.birt.core.exception.CoreException: There are
> errors evaluating script "var colval = this.getRowData().getColumnValue(0);
> scriptstring = scriptstring + "<option value='" + colval +
> "'>"+colval+"</option>";":
> ReferenceError: "scriptstring" is not defined.
> (/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]#2)
>
> at
> org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)
>
> at
> org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:777)
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:706)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:61)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:48)
>
> at
> org.eclipse.birt.report.engine.script.internal.RowScriptExecutor.handleOnCreate(RowScriptExecutor.java:56)
>
> ... 73 more
> Caused by: org.mozilla.javascript.EcmaError: ReferenceError:
> "scriptstring" is not defined.
> (/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]#2)
>
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3654)
>
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3632)
>
> at
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3717)
> at
> org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1758)
>
> at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1697)
> at
> org.mozilla.javascript.gen.c37._c0(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"]:2)
>
> at
> org.mozilla.javascript.gen.c37.call(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"])
>
> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
> at
> org.mozilla.javascript.gen.c37.call(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"])
>
> at
> org.mozilla.javascript.gen.c37.exec(/report/body/table[@id="167"]/detail/row[@id="170"]/method[@name="onCreate"])
>
> at
> org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
>
> ... 79 more
> PopulateListBoxFromDataSet.rptdesign /demo line 231 BIRT Viewer Problem
>
> This is my report
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.22"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version 3.7.0.v20110602
> Build <3.7.0.v20110607-1526></property>
> <property name="units">in</property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="bidiLayoutOrientation">ltr</property>
> <property name="imageDPI">96</property>
> <parameters>
> <scalar-parameter name="RP_City" id="187">
> <property name="valueType">static</property>
> <property name="isRequired">false</property>
> <property name="dataType">string</property>
> <property name="distinct">true</property>
> <simple-property-list name="defaultValue">
> <value type="constant">AHMEDABAD</value>
> </simple-property-list>
> <list-property name="selectionList"/>
> <property name="paramType">simple</property>
> <property name="controlType">text-box</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <data-sources>
> <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc"
> name="Claris Data Source" id="7">
> <list-property name="privateDriverProperties">
> <ex-property>
> <name>disabledMetadataBidiFormatStr</name>
> </ex-property>
> <ex-property>
> <name>disabledContentBidiFormatStr</name>
> </ex-property>
> <ex-property>
> <name>contentBidiFormatStr</name>
> <value>ILYNN</value>
> </ex-property>
> <ex-property>
> <name>metadataBidiFormatStr</name>
> <value>ILYNN</value>
> </ex-property>
> </list-property>
> <property name="odaDriverClass">com.mysql.jdbc.Driver</property>
> <property
> name="odaURL">jdbc:mysql://172.16.0.20:3306/leosatyen_claris</property>
> <property name="odaUser">claris</property>
> <encrypted-property name="odaPassword"
> encryptionID="base64">Y2xhcmlzMTIz</encrypted-property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet"
> name="Data Set" id="156">
> <list-property name="columnHints">
> <structure>
> <property name="columnName">name</property>
> <property name="analysis">attribute</property>
> <text-property name="displayName">name</text-property>
> <text-property name="heading">name</text-property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">name</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Claris Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">name</property>
> <property name="nativeName">name</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> </list-property>
> <xml-property name="queryText"><![CDATA[select name
> from cl_cities]]></xml-property>
> <xml-property name="designerValues"><![CDATA[<?xml version="1.0"
> encoding="UTF-8"?>
> <model:DesignValues
> xmlns:design="http://www.eclipse.org/datatools/connectivity/oda/design"
> xmlns:model="http://www.eclipse.org/birt/report/model/adapter/odaModel">
> <Version>2.0</Version>
> <design:ResultSets derivedMetaData="true">
> <design:resultSetDefinitions>
> <design:resultSetColumns>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:identifier>
> <design:name>name</design:name>
> <design:position>1</design:position>
> </design:identifier>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>255</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>name</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>name</design:label>
> <design:formattingHints>
> <design:displaySize>255</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> </design:resultSetColumns>
> <design:criteria/>
> </design:resultSetDefinitions>
> </design:ResultSets>
> </model:DesignValues>]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="report" id="4">
> <property name="fontFamily">sans-serif</property>
> <property name="fontSize">10pt</property>
> </style>
> <style name="crosstab-cell" id="5">
> <property name="borderBottomColor">#CCCCCC</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">1pt</property>
> <property name="borderLeftColor">#CCCCCC</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">1pt</property>
> <property name="borderRightColor">#CCCCCC</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">1pt</property>
> <property name="borderTopColor">#CCCCCC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">1pt</property>
> </style>
> <style name="crosstab" id="6">
> <property name="borderBottomColor">#CCCCCC</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">1pt</property>
> <property name="borderLeftColor">#CCCCCC</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">1pt</property>
> <property name="borderRightColor">#CCCCCC</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">1pt</property>
> <property name="borderTopColor">#CCCCCC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">1pt</property>
> </style>
> </styles>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2">
> <page-footer>
> <text id="3">
> <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>
> <text id="155">
> <property name="contentType">html</property>
> <text-property name="content"><![CDATA[
> <form name='frm' action="">
> <script language="javascript">
>
>
> function reloadPage(form) {
> var sel1 = form.RP_City;
> //alert("Reload Page");
> var temp = new String(location.href);
> var targetURL = new String();
> var xyz = -1;
> xyz=temp.indexOf("__overwrite=")
> if( xyz != -1 ){
> //alert( xyz );
> targetURL = temp.substring(0, xyz-1);
> //alert(temp.substring(0, xyz-1));
> }else{
> targetURL = temp;
> }
>
> targetURL += "&__overwrite=true";
> targetURL += "&RP_City=" + form.RP_City.value;
>
>
>
> //alert( targetURL );
>
> //window.location.href = targetURL;
> document.location.replace(targetURL);
>
>
> }
> </script>
>
>
> <select name='RP_City'>
> <VALUE-OF format="HTML">scriptstring;</VALUE-OF>
> </select>
> <INPUT Type="BUTTON" name="mybutton" Value="Refresh"
> onClick='reloadPage(this.form)'></INPUT>
> </form>]]></text-property>
> </text>
> <table id="167">
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">name</property>
> <text-property name="displayName">name</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["name"]</expression>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> <column id="174"/>
> <header>
> <row id="168">
> <cell id="169">
> <label id="175">
> <text-property name="text">name</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="170">
> <method name="onCreate"><![CDATA[var colval =
> this.getRowData().getColumnValue(0);
> scriptstring = scriptstring + "<option value='" + colval +
> "'>"+colval+"</option>";
> ]]></method>
> <cell id="171">
> <data id="176">
> <property name="resultSetColumn">name</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="172">
> <cell id="173"/>
> </row>
> </footer>
> </table>
> </body>
> </report>
>
>
> Thank you,
>
> Anurag
>
>
Re: Populate HTML list box with the values from a Data set [message #737530 is a reply to message #736983] Sat, 15 October 2011 05:15 Go to previous message
Anurag  is currently offline Anurag Friend
Messages: 47
Registered: September 2011
Member
Thanks Jason for reply.

My problem is solved now. The problem was my 'Dynamic Text' in which script was written was before hidden table in report layout.

As you told I also added following to the beforeFactory

scriptstring = "";


and following to the top of the onCreate script.

if( typeof scriptstring == 'undefined'){ scriptstring = ""; }


And it resolved my issue.

Thanks again,

Anurag

[Updated on: Sat, 15 October 2011 05:22]

Report message to a moderator

Previous Topic:Setting report width to 100% of page
Next Topic:Custom emitter: Get Data Types & startTable Event
Goto Forum:
  


Current Time: Thu Dec 18 08:33:08 GMT 2014

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

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