Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » How to avoid ReferenceError error messages?
How to avoid ReferenceError error messages? [message #879542] Thu, 31 May 2012 11:53 Go to next message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
With this report design:
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23" id="1">
    <property name="createdBy">Eclipse BIRT Designer Version 3.7.2.v20120213 Build &lt;3.7.2.v20120214-1408></property>
    <text-property name="title">Manual Data Entry</text-property>
    <property name="units">in</property>
    <property name="iconFile">/templates/blank_report.gif</property>
    <property name="bidiLayoutOrientation">ltr</property>
    <property name="imageDPI">89</property>
    <parameters>
        <cascading-parameter-group name="Parameters" id="27">
            <text-property name="promptText">Parameters</text-property>
            <property name="dataSet">InputsParameters</property>
            <property name="dataSetMode">single</property>
            <parameters>
                <scalar-parameter name="inputURL" id="28">
                    <property name="valueType">dynamic</property>
                    <property name="isRequired">false</property>
                    <property name="dataSetName">InputsParameters</property>
                    <expression name="valueExpr">row["inputURL"]</expression>
                    <expression name="labelExpr">row["displayText"]</expression>
                    <property name="dataType">string</property>
                    <simple-property-list name="defaultValue">
                        <value type="javascript">null</value>
                    </simple-property-list>
                    <property name="paramType">simple</property>
                    <property name="controlType">list-box</property>
                    <property name="mustMatch">true</property>
                    <property name="fixedOrder">true</property>
                    <structure name="format"/>
                </scalar-parameter>
                <scalar-parameter name="paramName" id="29">
                    <property name="valueType">dynamic</property>
                    <property name="isRequired">false</property>
                    <property name="dataSetName">InputsParameters</property>
                    <expression name="valueExpr">row["paramName"]</expression>
                    <expression name="labelExpr">row["paramName"]</expression>
                    <property name="dataType">string</property>
                    <simple-property-list name="defaultValue">
                        <value type="javascript">null</value>
                    </simple-property-list>
                    <property name="controlType">list-box</property>
                    <property name="fixedOrder">true</property>
                    <structure name="format"/>
                </scalar-parameter>
            </parameters>
        </cascading-parameter-group>
        <scalar-parameter name="measureTime" id="40">
            <property name="hidden">true</property>
            <text-property name="promptText">Measure Time</text-property>
            <property name="valueType">static</property>
            <property name="isRequired">false</property>
            <property name="dataType">dateTime</property>
            <property name="distinct">true</property>
            <simple-property-list name="defaultValue">
                <value type="javascript">new Date()</value>
            </simple-property-list>
            <list-property name="selectionList"/>
            <property name="paramType">simple</property>
            <property name="concealValue">true</property>
            <property name="controlType">text-box</property>
            <structure name="format">
                <property name="category">Unformatted</property>
            </structure>
        </scalar-parameter>
        <scalar-parameter name="measureValue" id="41">
            <property name="hidden">true</property>
            <text-property name="promptText">Value</text-property>
            <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="javascript">""</value>
            </simple-property-list>
            <list-property name="selectionList"/>
            <property name="paramType">simple</property>
            <property name="concealValue">true</property>
            <property name="controlType">text-box</property>
            <structure name="format">
                <property name="category">Unformatted</property>
            </structure>
        </scalar-parameter>
        <scalar-parameter name="inputParameter" id="45">
            <property name="hidden">true</property>
            <property name="valueType">dynamic</property>
            <property name="isRequired">false</property>
            <property name="dataSetName">InputsParameters</property>
            <expression name="valueExpr" type="javascript">dataSetRow.inputURL + " - " + dataSetRow.paramName</expression>
            <property name="dataType">string</property>
            <property name="distinct">true</property>
            <simple-property-list name="defaultValue">
                <value type="javascript">""</value>
            </simple-property-list>
            <list-property name="selectionList"/>
            <property name="paramType">simple</property>
            <property name="controlType">list-box</property>
            <property name="mustMatch">false</property>
            <property name="fixedOrder">true</property>
            <structure name="format">
                <property name="category">Unformatted</property>
            </structure>
        </scalar-parameter>
    </parameters>
    <data-sources>
        <script-data-source name="Main Data Source" id="30"/>
    </data-sources>
    <data-sets>
        <script-data-set name="InputsParameters" id="31">
            <list-property name="resultSetHints">
                <structure>
                    <property name="position">1</property>
                    <property name="name">inputURL</property>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="position">2</property>
                    <property name="name">displayText</property>
                    <property name="dataType">string</property>
                </structure>
                <structure>
                    <property name="position">3</property>
                    <property name="name">paramName</property>
                    <property name="dataType">string</property>
                </structure>
            </list-property>
            <list-property name="columnHints">
                <structure>
                    <property name="columnName">inputURL</property>
                    <text-property name="displayName">Input URL</text-property>
                </structure>
                <structure>
                    <property name="columnName">displayText</property>
                    <text-property name="displayName">Input</text-property>
                </structure>
                <structure>
                    <property name="columnName">paramName</property>
                    <text-property name="displayName">Parameter</text-property>
                </structure>
            </list-property>
            <structure name="cachedMetaData">
                <list-property name="resultSet">
                    <structure>
                        <property name="position">1</property>
                        <property name="name">inputURL</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">2</property>
                        <property name="name">displayText</property>
                        <property name="dataType">string</property>
                    </structure>
                    <structure>
                        <property name="position">3</property>
                        <property name="name">paramName</property>
                        <property name="dataType">string</property>
                    </structure>
                </list-property>
            </structure>
            <property name="dataSource">Main Data Source</property>
            <method name="open"><![CDATA[inputs = AWPData.GetInputs();
count = 0;
input = null;]]></method>
            <method name="fetch"><![CDATA[if (count < inputs.size()) {
  parameterNode = inputs.get(count);
  fb = parameterNode.fb();
  row.inputURL = fb.url;
  row.displayText = fb.name + " - " + fb.url;
  row.paramName = parameterNode.parameter().name;
  count++;
  return true;
}

return false;]]></method>
        </script-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>
        <label id="47">
            <property name="fontSize">x-large</property>
            <text-property name="text">Manual Data Entry</text-property>
        </label>
        <extended-item extensionName="ComboBox" name="inputParameter" id="46">
            <property name="label">Object URL - Attribute name</property>
            <expression name="bookmark">inputParameter</expression>
        </extended-item>
        <extended-item extensionName="DateTimePicker" name="measureTime" id="42">
            <property name="label">Time</property>
            <expression name="bookmark">measureTime</expression>
        </extended-item>
        <extended-item extensionName="TextBox" name="measureValue" id="43">
            <property name="label">Value</property>
            <expression name="bookmark">measureValue</expression>
        </extended-item>
        <extended-item extensionName="Button" id="44">
            <property name="text">"Submit Data"</property>
            <property name="onclick">urlAttrNameText = document.getElementById("inputParameter").value.split(' - ');
url = urlAttrNameText[0];
attrName = urlAttrNameText[1];
timeStr = document.getElementById("measureTime").value;
valueStr = document.getElementById("measureValue").value;
alert("Sending command to server: set "+attrName+" of "+url+" to "+valueStr+" at "+timeStr);
SetAttributeValue(url, attrName, timeStr, valueStr);</property>
            <property name="isrefresh">false</property>
        </extended-item>
    </body>
</report>

The report itself works fine: the proper function is called when the button is clicked, the combobox is filled correctly. But the problem is that I see error messages when the report is shown, under the report itself:
The following items have errors:

ReportDesign (id = 1):
+ There are errors evaluating script "inputParameter":
ReferenceError: "inputParameter" is not defined. (<inline>#1) (Element ID:1)
+ There are errors evaluating script "measureTime":
ReferenceError: "measureTime" is not defined. (<inline>#1) (Element ID:1)
+ There are errors evaluating script "measureValue":
ReferenceError: "measureValue" is not defined. (<inline>#1) (Element ID:1)

There is no element with id="1" in the report source, so I am not clear what the errors refer to. I've added default values for parameters, as seen above, but this didn't help. How can I avoid those error messages?

My own controls are used in the report, but I've checked that they don't throw exceptions while generating HTML.

[Updated on: Thu, 31 May 2012 12:08]

Report message to a moderator

Re: How to avoid ReferenceError error messages? [message #879789 is a reply to message #879542] Thu, 31 May 2012 21:05 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I believe this is complaining because of bookmark expressions.
For example:
<extended-item extensionName="DateTimePicker" name="measureTime"
id="42">
<property name="label">Time</property>
<expression name="bookmark">measureTime</expression>
</extended-item>

measureTime does not evaluate.

Jason

On 5/31/2012 7:53 AM, Alexey Romanov wrote:
> With this report design:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.23"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version 3.7.2.v20120213
> Build <3.7.2.v20120214-1408></property>
> <text-property name="title">Manual Data Entry</text-property>
> <property name="units">in</property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="bidiLayoutOrientation">ltr</property>
> <property name="imageDPI">89</property>
> <parameters>
> <cascading-parameter-group name="Parameters" id="27">
> <text-property name="promptText">Parameters</text-property>
> <property name="dataSet">InputsParameters</property>
> <property name="dataSetMode">single</property>
> <parameters>
> <scalar-parameter name="inputURL" id="28">
> <property name="valueType">dynamic</property>
> <property name="isRequired">false</property>
> <property name="dataSetName">InputsParameters</property>
> <expression name="valueExpr">row["inputURL"]</expression>
> <expression name="labelExpr">row["displayText"]</expression>
> <property name="dataType">string</property>
> <simple-property-list name="defaultValue">
> <value type="javascript">null</value>
> </simple-property-list>
> <property name="paramType">simple</property>
> <property name="controlType">list-box</property>
> <property name="mustMatch">true</property>
> <property name="fixedOrder">true</property>
> <structure name="format"/>
> </scalar-parameter>
> <scalar-parameter name="paramName" id="29">
> <property name="valueType">dynamic</property>
> <property name="isRequired">false</property>
> <property name="dataSetName">InputsParameters</property>
> <expression name="valueExpr">row["paramName"]</expression>
> <expression name="labelExpr">row["paramName"]</expression>
> <property name="dataType">string</property>
> <simple-property-list name="defaultValue">
> <value type="javascript">null</value>
> </simple-property-list>
> <property name="controlType">list-box</property>
> <property name="fixedOrder">true</property>
> <structure name="format"/>
> </scalar-parameter>
> </parameters>
> </cascading-parameter-group>
> <scalar-parameter name="measureTime" id="40">
> <property name="hidden">true</property>
> <text-property name="promptText">Measure Time</text-property>
> <property name="valueType">static</property>
> <property name="isRequired">false</property>
> <property name="dataType">dateTime</property>
> <property name="distinct">true</property>
> <simple-property-list name="defaultValue">
> <value type="javascript">new Date()</value>
> </simple-property-list>
> <list-property name="selectionList"/>
> <property name="paramType">simple</property>
> <property name="concealValue">true</property>
> <property name="controlType">text-box</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> <scalar-parameter name="measureValue" id="41">
> <property name="hidden">true</property>
> <text-property name="promptText">Value</text-property>
> <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="javascript">""</value>
> </simple-property-list>
> <list-property name="selectionList"/>
> <property name="paramType">simple</property>
> <property name="concealValue">true</property>
> <property name="controlType">text-box</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> <scalar-parameter name="inputParameter" id="45">
> <property name="hidden">true</property>
> <property name="valueType">dynamic</property>
> <property name="isRequired">false</property>
> <property name="dataSetName">InputsParameters</property>
> <expression name="valueExpr" type="javascript">dataSetRow.inputURL + " -
> " + dataSetRow.paramName</expression>
> <property name="dataType">string</property>
> <property name="distinct">true</property>
> <simple-property-list name="defaultValue">
> <value type="javascript">""</value>
> </simple-property-list>
> <list-property name="selectionList"/>
> <property name="paramType">simple</property>
> <property name="controlType">list-box</property>
> <property name="mustMatch">false</property>
> <property name="fixedOrder">true</property>
> <structure name="format">
> <property name="category">Unformatted</property>
> </structure>
> </scalar-parameter>
> </parameters>
> <data-sources>
> <script-data-source name="Main Data Source" id="30"/>
> </data-sources>
> <data-sets>
> <script-data-set name="InputsParameters" id="31">
> <list-property name="resultSetHints">
> <structure>
> <property name="position">1</property>
> <property name="name">inputURL</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">displayText</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">paramName</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> <list-property name="columnHints">
> <structure>
> <property name="columnName">inputURL</property>
> <text-property name="displayName">Input URL</text-property>
> </structure>
> <structure>
> <property name="columnName">displayText</property>
> <text-property name="displayName">Input</text-property>
> </structure>
> <structure>
> <property name="columnName">paramName</property>
> <text-property name="displayName">Parameter</text-property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">inputURL</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">displayText</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">paramName</property>
> <property name="dataType">string</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Main Data Source</property>
> <method name="open"><![CDATA[inputs = AWPData.GetInputs();
> count = 0;
> input = null;]]></method>
> <method name="fetch"><![CDATA[if (count < inputs.size()) {
> parameterNode = inputs.get(count);
> fb = parameterNode.fb();
> row.inputURL = fb.url;
> row.displayText = fb.name + " - " + fb.url;
> row.paramName = parameterNode.parameter().name;
> count++;
> return true;
> }
>
> return false;]]></method>
> </script-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>
> <label id="47">
> <property name="fontSize">x-large</property>
> <text-property name="text">Manual Data Entry</text-property>
> </label>
> <extended-item extensionName="ComboBox" name="inputParameter" id="46">
> <property name="label">Object URL - Attribute name</property>
> <expression name="bookmark">inputParameter</expression>
> </extended-item>
> <extended-item extensionName="DateTimePicker" name="measureTime" id="42">
> <property name="label">Time</property>
> <expression name="bookmark">measureTime</expression>
> </extended-item>
> <extended-item extensionName="TextBox" name="measureValue" id="43">
> <property name="label">Value</property>
> <expression name="bookmark">measureValue</expression>
> </extended-item>
> <extended-item extensionName="Button" id="44">
> <property name="text">"Submit Data"</property>
> <property name="onclick">urlAttrNameText =
> document.getElementById("inputParameter").value.split(' - ');
> url = urlAttrNameText[0];
> attrName = urlAttrNameText[1];
> timeStr = document.getElementById("measureTime").value;
> valueStr = document.getElementById("measureValue").value;
> alert("Sending command to server: set "+attrName+" of "+url+" to
> "+valueStr+" at "+timeStr);
> SetAttributeValue(url, attrName, timeStr, valueStr);</property>
> <property name="isrefresh">false</property>
> </extended-item>
> </body>
> </report>
>
> The report itself works fine: the proper function is called when the
> button is clicked, the combobox is filled correctly. But the problem is
> that I see error messages when the report is shown, under the report
> itself:
>
> The following items have errors:
>
> ReportDesign (id = 1):
> + There are errors evaluating script "inputParameter":
> ReferenceError: "inputParameter" is not defined. (<inline>#1) (Element
> ID:1)
> + There are errors evaluating script "measureTime":
> ReferenceError: "measureTime" is not defined. (<inline>#1) (Element ID:1)
> + There are errors evaluating script "measureValue":
> ReferenceError: "measureValue" is not defined. (<inline>#1) (Element ID:1)
>
> There is no element with id="1" in the report source, so I am not clear
> what the errors refer to. I've added default values for parameters, as
> seen above, but this didn't help. How can I avoid those error messages?
Re: How to avoid ReferenceError error messages? [message #879794 is a reply to message #879789] Thu, 31 May 2012 21:23 Go to previous message
Alexey Romanov is currently offline Alexey Romanov
Messages: 263
Registered: May 2010
Senior Member
Thank you!
Previous Topic:How to get the absolute location of a data source
Next Topic:Problem with executing Stored Proc in BIRT
Goto Forum:
  


Current Time: Mon Sep 15 04:12:58 GMT 2014

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

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