BIRT Client Side Javascript not working when Report uploaded to RTC
I am creating a report that will have collapse un-collapse feature on the table. I created a test report to check if javascript is working in RTC. I have created following report. It runs on BIRT viewer but in RTC it is saying javascript function is undefined. How can i inject this javascript function in RTC? Following is the sample report.
<?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 4.6.0.v201606072122</property>
<property name="units">in</property>
<method name="clientInitialize"><![CDATA[
function hidetable(form, rank){
var rowId = "RowNum" + rank;
alert(rowId);
//alert(document.getElementById(rowId));
document.getElementById(rowId).style.display='none';
}
]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<list-property name="libraries">
<structure>
<property name="fileName">shared/GOSIReports.rptlibrary</property>
<property name="namespace">GOSIReports</property>
</structure>
</list-property>
<parameters>
<scalar-parameter name="Project Id" id="117">
<property name="hidden">true</property>
<property name="valueType">static</property>
<property name="isRequired">false</property>
<property name="dataType">integer</property>
<property name="distinct">true</property>
<simple-property-list name="defaultValue">
<value type="constant">4</value>
</simple-property-list>
<list-property name="selectionList"/>
<property name="paramType">simple</property>
<property name="concealValue">false</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
<scalar-parameter name="Due - Start Date" id="118">
<property name="valueType">static</property>
<property name="isRequired">false</property>
<property name="dataType">date</property>
<property name="distinct">true</property>
<simple-property-list name="defaultValue">
<value type="constant">2019-01-21</value>
</simple-property-list>
<list-property name="selectionList"/>
<property name="paramType">simple</property>
<property name="concealValue">false</property>
<property name="controlType">text-box</property>
<structure name="format">
<property name="category">Unformatted</property>
</structure>
</scalar-parameter>
<scalar-parameter name="Due - End Date" id="119">
<property name="valueType">static</property>
<property name="isRequired">false</property>
<property name="dataType">date</property>
<property name="distinct">true</property>
<simple-property-list name="defaultValue">
<value type="constant">2019-01-31</value>
</simple-property-list>
<list-property name="selectionList"/>
<property name="paramType">simple</property>
<property name="concealValue">false</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="JDBC_CLM_DW" id="120"
extends="GOSIReports.JDBC_CLM_DW"/>
</data-sources>
<data-sets>
<oda-data-set extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet" name="dsAllResources" id="5">
<list-property name="computedColumns">
<structure>
<property name="name">Team</property>
<expression name="expression">row["TEAM_NAME"].split('/')[row["TEAM_NAME"].split('/').length-1];</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">Rank</property>
<property name="alias">Rank</property>
<property name="analysis">measure</property>
<text-property name="displayName">Rank</text-property>
<text-property name="heading">Rank</text-property>
</structure>
<structure>
<property name="columnName">TEAM_MEMBER</property>
<property name="alias">TEAM_MEMBER</property>
<property name="analysis">dimension</property>
<text-property name="displayName">TEAM_MEMBER</text-property>
<text-property name="heading">TEAM_MEMBER</text-property>
</structure>
<structure>
<property name="columnName">TEAM_NAME</property>
<property name="alias">TEAM_NAME</property>
<property name="analysis">dimension</property>
<text-property name="displayName">TEAM_NAME</text-property>
<text-property name="heading">TEAM_NAME</text-property>
</structure>
<structure>
<property name="columnName">AvailableHours</property>
<property name="alias">AvailableHours</property>
<property name="analysis">measure</property>
<text-property name="displayName">AvailableHours</text-property>
<text-property name="heading">AvailableHours</text-property>
</structure>
<structure>
<property name="columnName">HoursSpent</property>
<property name="alias">HoursSpent</property>
<property name="analysis">measure</property>
<text-property name="displayName">HoursSpent</text-property>
<text-property name="heading">HoursSpent</text-property>
</structure>
<structure>
<property name="columnName">Utilization</property>
<property name="alias">Utilization</property>
<property name="analysis">measure</property>
<text-property name="displayName">Utilization</text-property>
<text-property name="heading">Utilization</text-property>
</structure>
<structure>
<property name="columnName">Projects</property>
<property name="alias">Projects</property>
<property name="analysis">measure</property>
<text-property name="displayName">Projects</text-property>
<text-property name="heading">Projects</text-property>
</structure>
<structure>
<property name="columnName">Defects</property>
<property name="alias">Defects</property>
<property name="analysis">measure</property>
<text-property name="displayName">Defects</text-property>
<text-property name="heading">Defects</text-property>
</structure>
<structure>
<property name="columnName">Scripts</property>
<property name="alias">Scripts</property>
<property name="analysis">measure</property>
<text-property name="displayName">Scripts</text-property>
<text-property name="heading">Scripts</text-property>
</structure>
<structure>
<property name="columnName">Others</property>
<property name="alias">Others</property>
<property name="analysis">measure</property>
<text-property name="displayName">Others</text-property>
<text-property name="heading">Others</text-property>
</structure>
</list-property>
<list-property name="parameters">
<structure>
<property name="name">param_1</property>
<property name="paramName">Project Id</property>
<property name="nativeName"></property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
<property name="position">1</property>
<property name="isOptional">true</property>
<property name="allowNull">true</property>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
<structure>
<property name="name">param_2</property>
<property name="paramName">Due - Start Date</property>
<property name="nativeName"></property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
<property name="position">2</property>
<property name="isOptional">true</property>
<property name="allowNull">true</property>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
<structure>
<property name="name">param_3</property>
<property name="paramName">Due - End Date</property>
<property name="nativeName"></property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
<property name="position">3</property>
<property name="isOptional">true</property>
<property name="allowNull">true</property>
<property name="isInput">true</property>
<property name="isOutput">false</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">Rank</property>
<property name="dataType">decimal</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">TEAM_MEMBER</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">TEAM_NAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">AvailableHours</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">HoursSpent</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">Utilization</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">Projects</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">SIMIS Changes</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">Other Changes</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">Defects</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">Scripts</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">12</property>
<property name="name">Others</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">13</property>
<property name="name">Team</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">JDBC_CLM_DW</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">Rank</property>
<property name="nativeName">Rank</property>
<property name="dataType">decimal</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">TEAM_MEMBER</property>
<property name="nativeName">TEAM_MEMBER</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">TEAM_NAME</property>
<property name="nativeName">TEAM_NAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">AvailableHours</property>
<property name="nativeName">AvailableHours</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">HoursSpent</property>
<property name="nativeName">HoursSpent</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">Utilization</property>
<property name="nativeName">Utilization</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">Projects</property>
<property name="nativeName">Projects</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">SIMIS Changes</property>
<property name="nativeName">SIMIS Changes</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">Other Changes</property>
<property name="nativeName">Other Changes</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">Defects</property>
<property name="nativeName">Defects</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">Scripts</property>
<property name="nativeName">Scripts</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">12</property>
<property name="name">Others</property>
<property name="nativeName">Others</property>
<property name="dataType">float</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[{call CUSTOM.usp_HighestAdaptionByTimeSheet(?,?,?)}]]></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>TEAM_MEMBER</design:name>
<design:position>1</design:position>
</design:identifier>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>110</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>TEAM_MEMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>TEAM_MEMBER</design:label>
<design:formattingHints>
<design:displaySize>110</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:identifier>
<design:name>HoursSpent</design:name>
<design:position>2</design:position>
</design:identifier>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>HoursSpent</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>HoursSpent</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:identifier>
<design:name>AvailableHours</design:name>
<design:position>3</design:position>
</design:identifier>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>AvailableHours</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>AvailableHours</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:identifier>
<design:name>Utilization</design:name>
<design:position>4</design:position>
</design:identifier>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>Utilization</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>Utilization</design:label>
<design:formattingHints>
<design:displaySize>22</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>
<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>
<table id="92">
<property name="dataSet">dsAllResources</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">Rank</property>
<text-property name="displayName">Rank</text-property>
<expression name="expression" type="javascript">dataSetRow["Rank"]</expression>
<property name="dataType">decimal</property>
</structure>
<structure>
<property name="name">TEAM_MEMBER</property>
<text-property name="displayName">TEAM_MEMBER</text-property>
<expression name="expression" type="javascript">dataSetRow["TEAM_MEMBER"]</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<column id="111"/>
<column id="106"/>
<column id="107"/>
<header>
<row id="93">
<cell id="108"/>
<cell id="94">
<label id="95">
<text-property name="text">Rank</text-property>
</label>
</cell>
<cell id="96">
<label id="97">
<text-property name="text">TEAM_MEMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="98">
<expression name="bookmark" type="javascript">"RowNum" + row["Rank"]</expression>
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr" type="javascript">false</expression>
</structure>
</list-property>
<cell id="109">
<text id="80">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<form>
<INPUT Type="BUTTON"
name=<VALUE-OF>"mybutton"+row["Rank"]</VALUE-OF> Value="-"
onClick='hidetable(this.form,<VALUE-OF>row["Rank"]</VALUE-OF>);'/>
</form>]]></text-property>
</text>
</cell>
<cell id="99">
<data id="100">
<property name="resultSetColumn">Rank</property>
</data>
</cell>
<cell id="101">
<data id="102">
<property name="resultSetColumn">TEAM_MEMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="103">
<cell id="110"/>
<cell id="104"/>
<cell id="105"/>
</row>
</footer>
</table>
</body>
</report>