Skip to main content



      Home
Home » Archived » BIRT » including checkboxes in a column of a table
including checkboxes in a column of a table [message #222024] Thu, 01 March 2007 13:34 Go to next message
Eclipse UserFriend
Originally posted by: ajay.fsc.gmail.com

I have a requirement where I have to display checkbox in each cell of
the column of report table. The intension is to to display the details
of the user in a chart( which is also part of the report ) depending on
which user checkbox is selected. How would I display a check box in a
cell.? Any ideas?
Re: including checkboxes in a column of a table [message #222108 is a reply to message #222024] Fri, 02 March 2007 11:32 Go to previous messageGo to next message
Eclipse UserFriend
I do not know if this will help but here is an example that uses a checkbox
in the report to hide a column.
It requires that the report re execute though.
It was done with the feb 28, 2007 build.

Jason



<?xml version="1.0" encoding="UTF-8"?>

<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.10"
id="1">

<property name="createdBy">Eclipse BIRT Designer Version 2.2.0.v20070205
Build &lt;2.2.0.v20070209-0630></property>

<property name="units">in</property>

<property name="comments">Copyright (c) 2006 &lt;&lt;Your Company Name
here>></property>

<html-property name="description">Creates a blank report with no predefined
content.</html-property>

<text-property name="displayName">Blank Report</text-property>

<property name="iconFile">/templates/blank_report.gif</property>

<parameters>

<scalar-parameter name="hideOfficeCodeLabel" id="78">

<property name="valueType">static</property>

<property name="dataType">boolean</property>

<property name="controlType">check-box</property>

<property name="defaultValue">false</property>

<structure name="format"/>

</scalar-parameter>

</parameters>

<data-sources>

<oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc"
name="Data Source" id="17">

<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>

<property name="odaURL">jdbc:classicmodels:sampledb</property>

<property name="odaUser">ClassicModels</property>

</oda-data-source>

</data-sources>

<data-sets>

<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="18">

<structure name="cachedMetaData">

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">OFFICECODE</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">2</property>

<property name="name">CITY</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">3</property>

<property name="name">PHONE</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">4</property>

<property name="name">ADDRESSLINE1</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">5</property>

<property name="name">ADDRESSLINE2</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">6</property>

<property name="name">STATE</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">7</property>

<property name="name">COUNTRY</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">8</property>

<property name="name">POSTALCODE</property>

<property name="dataType">string</property>

</structure>

<structure>

<property name="position">9</property>

<property name="name">TERRITORY</property>

<property name="dataType">string</property>

</structure>

</list-property>

</structure>

<property name="dataSource">Data Source</property>

<list-property name="resultSet">

<structure>

<property name="position">1</property>

<property name="name">OFFICECODE</property>

<property name="nativeName">OFFICECODE</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">2</property>

<property name="name">CITY</property>

<property name="nativeName">CITY</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">3</property>

<property name="name">PHONE</property>

<property name="nativeName">PHONE</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">4</property>

<property name="name">ADDRESSLINE1</property>

<property name="nativeName">ADDRESSLINE1</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">5</property>

<property name="name">ADDRESSLINE2</property>

<property name="nativeName">ADDRESSLINE2</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">6</property>

<property name="name">STATE</property>

<property name="nativeName">STATE</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">7</property>

<property name="name">COUNTRY</property>

<property name="nativeName">COUNTRY</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">8</property>

<property name="name">POSTALCODE</property>

<property name="nativeName">POSTALCODE</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

<structure>

<property name="position">9</property>

<property name="name">TERRITORY</property>

<property name="nativeName">TERRITORY</property>

<property name="dataType">string</property>

<property name="nativeDataType">12</property>

</structure>

</list-property>

<property name="queryText">select *

from offices</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>1.0</Version>

<design:ResultSets derivedMetaData="true">

<design:resultSetDefinitions>

<design:resultSetColumns>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>OFFICECODE</design:name>

<design:position>1</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>10</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>OFFICECODE</design:label>

<design:formattingHints>

<design:displaySize>10</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>CITY</design:name>

<design:position>2</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>50</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>CITY</design:label>

<design:formattingHints>

<design:displaySize>50</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>PHONE</design:name>

<design:position>3</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>50</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>PHONE</design:label>

<design:formattingHints>

<design:displaySize>50</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>ADDRESSLINE1</design:name>

<design:position>4</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>50</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>ADDRESSLINE1</design:label>

<design:formattingHints>

<design:displaySize>50</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>ADDRESSLINE2</design:name>

<design:position>5</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>50</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>ADDRESSLINE2</design:label>

<design:formattingHints>

<design:displaySize>50</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>STATE</design:name>

<design:position>6</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>50</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>STATE</design:label>

<design:formattingHints>

<design:displaySize>50</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>COUNTRY</design:name>

<design:position>7</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>50</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>COUNTRY</design:label>

<design:formattingHints>

<design:displaySize>50</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>POSTALCODE</design:name>

<design:position>8</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>15</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>POSTALCODE</design:label>

<design:formattingHints>

<design:displaySize>15</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

<design:resultColumnDefinitions>

<design:attributes>

<design:name>TERRITORY</design:name>

<design:position>9</design:position>

<design:nativeDataTypeCode>12</design:nativeDataTypeCode>

<design:precision>10</design:precision>

<design:scale>0</design:scale>

<design:nullability>Nullable</design:nullability>

</design:attributes>

<design:usageHints>

<design:label>TERRITORY</design:label>

<design:formattingHints>

<design:displaySize>10</design:displaySize>

</design:formattingHints>

</design:usageHints>

</design:resultColumnDefinitions>

</design:resultSetColumns>

</design:resultSetDefinitions>

</design:ResultSets>

</model:DesignValues>]]></xml-property>

</oda-data-set>

</data-sets>

<styles>

<style name="NewStyle" id="79">

<property name="verticalAlign">top</property>

<property name="whiteSpace">nowrap</property>

<property name="display">inline</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>

<grid id="4">

<property name="width">100%</property>

<column id="5"/>

<column id="6"/>

<row id="7">

<cell id="8">

<text id="16">

<property name="contentType">html</property>

<text-property name="content"><![CDATA[

<form name="input" onSubmit="return reloadPage();">


<script type="text/javascript">




function reloadPage() {

//alert("Reload time");

var temp = new String(location.href);

var targetURL = new String();


//added this to force a rerun - specifically for web viewer

temp += "&__overwrite=true";


//alert( document.cbform.mycheckbox.checked );

targetURL = temp.substring(0, temp.indexOf("hideOfficeCodeLabel=") -1);


if(temp.indexOf("hideOfficeCodeLabel=") != -1 )

targetURL = targetURL + "&hideOfficeCodeLabel=" +
document.cbform.mycheckbox.checked;

else

targetURL = temp + "&hideOfficeCodeLabel=" +
document.cbform.mycheckbox.checked;


alert( targetURL );

location.replace(targetURL);


return false;

}

</script>


<table width=100%>

<tr>

<td colspan=2><input type="button" value="Apply Changes" onEnter =
"reloadPage()" onclick="reloadPage()"></td>

</tr>

</table>


</form>]]></text-property>

</text>

</cell>

<cell id="9"/>

</row>

<row id="10">

<cell id="11">

<table id="19">

<property name="width">100%</property>

<property name="dataSet">Data Set</property>

<list-property name="boundDataColumns">

<structure>

<property name="name">OFFICECODE</property>

<expression name="expression">dataSetRow["OFFICECODE"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">CITY</property>

<expression name="expression">dataSetRow["CITY"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">PHONE</property>

<expression name="expression">dataSetRow["PHONE"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">ADDRESSLINE1</property>

<expression name="expression">dataSetRow["ADDRESSLINE1"]</expression >

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">ADDRESSLINE2</property>

<expression name="expression">dataSetRow["ADDRESSLINE2"]</expression >

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">STATE</property>

<expression name="expression">dataSetRow["STATE"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">COUNTRY</property>

<expression name="expression">dataSetRow["COUNTRY"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">POSTALCODE</property>

<expression name="expression">dataSetRow["POSTALCODE"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">TERRITORY</property>

<expression name="expression">dataSetRow["TERRITORY"]</expression>

<property name="dataType">string</property>

</structure>

<structure>

<property name="name">data item</property>

<expression name="expression">params["hideOfficeCodeLabel"]</expression >

<property name="dataType">any</property>

</structure>

</list-property>

<column id="68">

<property name="width">0.5in</property>

</column>

<column id="69">

<property name="width">0.2083333333in</property>

</column>

<column id="70"/>

<column id="71"/>

<column id="72"/>

<column id="73"/>

<column id="74"/>

<column id="75"/>

<column id="76"/>

<header>

<row id="82">

<cell id="83">

<text id="77">

<property name="style">NewStyle</property>

<property name="contentType">html</property>

<text-property name="content"><![CDATA[<form name="cbform">

<INPUT TYPE=CHECKBOX NAME="mycheckbox" <VALUE-OF>if(
params["hideOfficeCodeLabel"].value){

"checked";

}else{

"";

}</VALUE-OF>>Hide Office Code</INPUT>

</form>]]></text-property>

</text>

</cell>

<cell id="84"/>

<cell id="85"/>

<cell id="86"/>

<cell id="87"/>

<cell id="88"/>

<cell id="89"/>

<cell id="90"/>

<cell id="91"/>

</row>

<row id="20">

<cell id="21">

<label id="22">

<property name="style">NewStyle</property>

<list-property name="visibility">

<structure>

<property name="format">all</property>

<expression name="valueExpr">params["hideOfficeCodeLabel"]</expression >

</structure>

</list-property>

<text-property name="text">OFFICECODE</text-property>

</label>

</cell>

<cell id="23">

<label id="24">

<text-property name="text">CITY</text-property>

</label>

</cell>

<cell id="25">

<label id="26">

<text-property name="text">PHONE</text-property>

</label>

</cell>

<cell id="27">

<label id="28">

<text-property name="text">ADDRESSLINE1</text-property>

</label>

</cell>

<cell id="29">

<label id="30">

<text-property name="text">ADDRESSLINE2</text-property>

</label>

</cell>

<cell id="31">

<label id="32">

<text-property name="text">STATE</text-property>

</label>

</cell>

<cell id="33">

<label id="34">

<text-property name="text">COUNTRY</text-property>

</label>

</cell>

<cell id="35">

<label id="36">

<text-property name="text">POSTALCODE</text-property>

</label>

</cell>

<cell id="37">

<label id="38">

<text-property name="text">TERRITORY</text-property>

</label>

</cell>

</row>

</header>

<detail>

<row id="39">

<cell id="40">

<data id="41">

<list-property name="visibility">

<structure>

<property name="format">all</property>

<expression name="valueExpr">params["hideOfficeCodeLabel"]</expression >

</structure>

</list-property>

<property name="resultSetColumn">OFFICECODE</property>

</data>

</cell>

<cell id="42">

<data id="43">

<property name="resultSetColumn">CITY</property>

</data>

</cell>

<cell id="44">

<data id="45">

<property name="resultSetColumn">PHONE</property>

</data>

</cell>

<cell id="46">

<data id="47">

<property name="resultSetColumn">ADDRESSLINE1</property>

</data>

</cell>

<cell id="48">

<data id="49">

<property name="resultSetColumn">ADDRESSLINE2</property>

</data>

</cell>

<cell id="50">

<data id="51">

<property name="resultSetColumn">STATE</property>

</data>

</cell>

<cell id="52">

<data id="53">

<property name="resultSetColumn">COUNTRY</property>

</data>

</cell>

<cell id="54">

<data id="55">

<property name="resultSetColumn">POSTALCODE</property>

</data>

</cell>

<cell id="56">

<data id="57">

<property name="resultSetColumn">TERRITORY</property>

</data>

</cell>

</row>

</detail>

<footer>

<row id="58">

<cell id="59"/>

<cell id="60"/>

<cell id="61"/>

<cell id="62"/>

<cell id="63"/>

<cell id="64"/>

<cell id="65"/>

<cell id="66"/>

<cell id="67"/>

</row>

</footer>

</table>

</cell>

<cell id="12"/>

</row>

<row id="13">

<cell id="14"/>

<cell id="15"/>

</row>

</grid>

</body>

</report>


"exquisitus" <ajay.fsc@gmail.com> wrote in message
news:es76ca$ata$1@utils.eclipse.org...
>I have a requirement where I have to display checkbox in each cell of the
>column of report table. The intension is to to display the details of the
>user in a chart( which is also part of the report ) depending on which user
>checkbox is selected. How would I display a check box in a cell.? Any
>ideas?
Re: including checkboxes in a column of a table [message #222148 is a reply to message #222108] Fri, 02 March 2007 13:25 Go to previous message
Eclipse UserFriend
Originally posted by: xxx.xxx.cl

Jason Weathersby wrote:
> I do not know if this will help but here is an example that uses a checkbox
> in the report to hide a column.

woohoo! you saved my day ;)


btw: works with N20070209 as well
Previous Topic:Report Designs and data set evaluation
Next Topic:Copying Data Source
Goto Forum:
  


Current Time: Tue May 06 18:21:48 EDT 2025

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

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

Back to the top