Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Dynamic Master page
Dynamic Master page [message #640595] Mon, 22 November 2010 10:15 Go to next message
Anthony S is currently offline Anthony S
Messages: 19
Registered: September 2010
Junior Member
Hello !

I would like ton make Master page width & height dynamic.

I have a master page for a table. Depending my data I the number of line in my table will be different (height). I would like to be able to set dynamically the height or width of my master page.

Anthony
Re: Dynamic Master page [message #640678 is a reply to message #640595] Mon, 22 November 2010 13:55 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You can change the master page settings in the beforeFactory like:
reportContext.getDesignHandle().findMasterPage("myMasterPage ").setProperty("height",
"4in");
Where myMasterPage is the named master page. You also must set the page
type to custom. You do this manually or by script like:
reportContext.getDesignHandle().findMasterPage("myMasterPage ").pageType="custom";

The problem is that this is before any data is collected. You can base
these scripts on parameters but not data called from a table element.
One way around this is to use one report to get the data and create
parameters for a second report that you automatically forward to using a
text element in the report.

<script type="text/javascript">

function forward() {
var temp = new String(location.href);
var detailReport = "mycustomizedrpt.rptdesign"
var TargetURL = temp.replace(/forwarddetail.rptdesign/, detailReport);
var TargetURL = TargetURL&newHeight=....calculated in first report

location.replace(TargetURL);
return false;
}
forward();
</script>

Jason

On 11/22/2010 10:15 AM, Anthony S wrote:
> Hello !
>
> I would like ton make Master page width & height dynamic.
>
> I have a master page for a table. Depending my data I the number of line
> in my table will be different (height). I would like to be able to set
> dynamically the height or width of my master page.
>
> Anthony
>
Re: Dynamic Master page [message #640815 is a reply to message #640595] Tue, 23 November 2010 04:42 Go to previous messageGo to next message
Jana  is currently offline Jana
Messages: 3
Registered: November 2010
Junior Member
Hi Guys,

I have maybe similar question, but I need your help. I would like to have watermark only for pdf output not for other outputs as doc, xls, hmtl. Now I set the background image for master page to have watermark in report. Can be this set dynamically, in dependent on output format? I tried it in many ways, but without any success.

Thanks
Re: Dynamic Master page [message #640968 is a reply to message #640815] Tue, 23 November 2010 12:28 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

If you are re-running the report you can just use an onRender script like:
if( reportContext.getOutputFormat() == "pdf" ){
reportContext.getDesignHandle().findMasterPage("Simple
MasterPage").setProperty("backgroundImage", "");
}

If you are using the viewer and export the report to pdf this will not
re-execute the report so the above script will not work. If you need to
do that one solution is to create two separate master pages one for pdf
and one for non pdf and then add a table to the report. In the page
break tab set the master page for the table to be the non pdf master
page. select the visibility tab and hide the table for the pdf format
only. Next copy the table and paste it. In the copy set the master
page for it to be the pdf master page. Hide the table for the all
outputs but pdf. See attached example.

Jason

<?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
2.6.1.v20100902 Build &lt;2.6.1.v20100915-1750></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="8">
<list-property name="privateDriverProperties">
<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">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="9">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<text-property
name="heading">ORDERNUMBER</text-property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<text-property
name="heading">PRODUCTCODE</text-property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<text-property
name="heading">QUANTITYORDERED</text-property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<text-property name="heading">PRICEEACH</text-property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<text-property
name="heading">ORDERLINENUMBER</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails
where ordernumber =10101]]></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>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRODUCTCODE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRODUCTCODE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>QUANTITYORDERED</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRICEEACH</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERLINENUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</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="NonPDF" id="2">
<property name="backgroundImage">green.png</property>
<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>
<simple-master-page name="PDF" id="7"/>
</page-setup>
<body>
<table id="10">
<property name="masterPage">NonPDF</property>
<property name="dataSet">Data Set</property>
<list-property name="visibility">
<structure>
<property name="format">pdf</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression name="expression"
type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="39"/>
<column id="40"/>
<column id="41"/>
<column id="42"/>
<column id="43"/>
<header>
<row id="11">
<cell id="12">
<label id="13">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="16">
<label id="17">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="18">
<label id="19">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="20">
<label id="21">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="22">
<cell id="23">
<data id="24">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="25">
<data id="26">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="27">
<data id="28">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="29">
<data id="30">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="31">
<data id="32">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="33">
<cell id="34"/>
<cell id="35"/>
<cell id="36"/>
<cell id="37"/>
<cell id="38"/>
</row>
</footer>
</table>
<table id="44">
<property name="masterPage">PDF</property>
<property name="dataSet">Data Set</property>
<list-property name="visibility">
<structure>
<property name="format">xls</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
<structure>
<property name="format">postscript</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
<structure>
<property name="format">doc</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
<structure>
<property name="format">html</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
<structure>
<property name="format">csv</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
<structure>
<property name="format">ppt</property>
<expression name="valueExpr"
type="javascript">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression name="expression"
type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
</list-property>
<column id="73"/>
<column id="74"/>
<column id="75"/>
<column id="76"/>
<column id="77"/>
<header>
<row id="45">
<cell id="46">
<label id="47">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="48">
<label id="49">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="50">
<label id="51">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="52">
<label id="53">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="54">
<label id="55">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="56">
<cell id="57">
<data id="58">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="59">
<data id="60">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="61">
<data id="62">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="63">
<data id="64">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="65">
<data id="66">
<property name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="67">
<cell id="68"/>
<cell id="69"/>
<cell id="70"/>
<cell id="71"/>
<cell id="72"/>
</row>
</footer>
</table>
</body>
</report>


On 11/23/2010 4:42 AM, Jana wrote:
> Hi Guys,
>
> I have maybe similar question, but I need your help. I would like to
> have watermark only for pdf output not for other outputs as doc, xls,
> hmtl. Now I set the background image for master page to have watermark
> in report. Can be this set dynamically, in dependent on output format? I
> tried it in many ways, but without any success.
>
> Thanks
Re: Dynamic Master page [message #640975 is a reply to message #640968] Tue, 23 November 2010 12:43 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BTW another approach is to not put the background image on the master
page but on an outer grid for the report. Set the grid height to be
close to the size of the master page, create a style with a background
image and apply the style to the grid. Then using an onrender script on
the grid like:

if( reportContext.getOutputFormat() == "pdf" ){
this.getStyle().backgroundImage = "";
}

should cause the image to not be displayed even if exporting from the
viewer.

see attached example

Jason

<?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
2.6.1.v20100902 Build &lt;2.6.1.v20100915-1750></property>
<property name="units">in</property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="layoutPreference">fixed layout</property>
<property name="bidiLayoutOrientation">ltr</property>
<property name="imageDPI">96</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="7">
<list-property name="privateDriverProperties">
<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">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="8">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<text-property
name="heading">ORDERNUMBER</text-property>
<property name="displayLength">11</property>
<property name="horizontalAlign">justify</property>
<property name="wordWrap">false</property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<text-property
name="heading">PRODUCTCODE</text-property>
<property name="displayLength">15</property>
<property name="horizontalAlign">justify</property>
<property name="wordWrap">false</property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<text-property
name="heading">QUANTITYORDERED</text-property>
<property name="displayLength">11</property>
<property name="horizontalAlign">justify</property>
<property name="wordWrap">false</property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<text-property name="heading">PRICEEACH</text-property>
<property name="displayLength">22</property>
<property name="horizontalAlign">justify</property>
<property name="wordWrap">false</property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<text-property
name="heading">ORDERLINENUMBER</text-property>
<property name="displayLength">6</property>
<property name="horizontalAlign">justify</property>
<property name="wordWrap">false</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">5</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails
where ordernumber = 10101
]]></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>1.0</Version>
<design:ResultSets derivedMetaData="true">
<design:resultSetDefinitions>
<design:resultSetColumns>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>1</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRODUCTCODE</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRODUCTCODE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRODUCTCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>QUANTITYORDERED</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>4</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>QUANTITYORDERED</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>QUANTITYORDERED</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PRICEEACH</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>8</design:nativeDataTypeCode>
<design:precision>15</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PRICEEACH</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PRICEEACH</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERLINENUMBER</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>5</design:nativeDataTypeCode>
<design:precision>5</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERLINENUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERLINENUMBER</design:label>
<design:formattingHints>
<design:displaySize>6</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>
<style name="NewStyle" id="9">
<property name="backgroundImage">c:/dwn/Koala.jpg</property>
<property name="backgroundRepeat">no-repeat</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="10">
<property name="style">NewStyle</property>
<property name="masterPage">Simple MasterPage</property>
<property name="height">10in</property>
<property name="width">100%</property>
<method name="onRender"><![CDATA[if(
reportContext.getOutputFormat() == "pdf" ){
this.getStyle().backgroundImage = "";
}]]></method>
<column id="11"/>
<row id="12">
<property name="height">9in</property>
<cell id="13">
<table id="14">
<property name="dataSet">Data Set</property>
<list-property name="boundDataColumns">
<structure>
<property
name="name">ORDERNUMBER</property>
<text-property
name="displayName">ORDERNUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERNUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property
name="name">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property
name="name">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
<expression name="expression"
type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
<property
name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
<expression name="expression"
type="javascript">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property
name="name">ORDERLINENUMBER</property>
<text-property
name="displayName">ORDERLINENUMBER</text-property>
<expression name="expression"
type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
<property
name="dataType">integer</property>
</structure>
</list-property>
<column id="43"/>
<column id="44"/>
<column id="45"/>
<column id="46"/>
<column id="47"/>
<header>
<row id="15">
<cell id="16">
<label id="17">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="18">
<label id="19">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="20">
<label id="21">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="22">
<label id="23">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="24">
<label id="25">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="26">
<cell id="27">
<data id="28">
<property
name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="29">
<data id="30">
<property
name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="31">
<data id="32">
<property
name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="33">
<data id="34">
<property
name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="35">
<data id="36">
<property
name="whiteSpace">nowrap</property>
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="37">
<cell id="38"/>
<cell id="39"/>
<cell id="40"/>
<cell id="41"/>
<cell id="42"/>
</row>
</footer>
</table>
</cell>
</row>
</grid>
</body>
</report>


On 11/23/2010 12:28 PM, Jason Weathersby wrote:
> If you are re-running the report you can just use an onRender script like:
> if( reportContext.getOutputFormat() == "pdf" ){
> reportContext.getDesignHandle().findMasterPage("Simple
> MasterPage").setProperty("backgroundImage", "");
> }
>
> If you are using the viewer and export the report to pdf this will not
> re-execute the report so the above script will not work. If you need to
> do that one solution is to create two separate master pages one for pdf
> and one for non pdf and then add a table to the report. In the page
> break tab set the master page for the table to be the non pdf master
> page. select the visibility tab and hide the table for the pdf format
> only. Next copy the table and paste it. In the copy set the master page
> for it to be the pdf master page. Hide the table for the all outputs but
> pdf. See attached example.
>
> Jason
>
> <?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 2.6.1.v20100902
> Build &lt;2.6.1.v20100915-1750></property>
> <property name="units">in</property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="bidiLayoutOrientation">ltr</property>
> <property name="imageDPI">96</property>
> <data-sources>
> <oda-data-source extensionID="org.eclipse.birt.report.data.oda.jdbc"
> name="Data Source" id="8">
> <list-property name="privateDriverProperties">
> <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">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="9">
> <list-property name="columnHints">
> <structure>
> <property name="columnName">ORDERNUMBER</property>
> <text-property name="displayName">ORDERNUMBER</text-property>
> <text-property name="heading">ORDERNUMBER</text-property>
> </structure>
> <structure>
> <property name="columnName">PRODUCTCODE</property>
> <text-property name="displayName">PRODUCTCODE</text-property>
> <text-property name="heading">PRODUCTCODE</text-property>
> </structure>
> <structure>
> <property name="columnName">QUANTITYORDERED</property>
> <text-property name="displayName">QUANTITYORDERED</text-property>
> <text-property name="heading">QUANTITYORDERED</text-property>
> </structure>
> <structure>
> <property name="columnName">PRICEEACH</property>
> <text-property name="displayName">PRICEEACH</text-property>
> <text-property name="heading">PRICEEACH</text-property>
> </structure>
> <structure>
> <property name="columnName">ORDERLINENUMBER</property>
> <text-property name="displayName">ORDERLINENUMBER</text-property>
> <text-property name="heading">ORDERLINENUMBER</text-property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="nativeName">PRODUCTCODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="nativeName">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="nativeName">PRICEEACH</property>
> <property name="dataType">float</property>
> <property name="nativeDataType">8</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="nativeName">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">5</property>
> </structure>
> </list-property>
> <xml-property name="queryText"><![CDATA[select *
> from orderdetails
> where ordernumber =10101]]></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>1.0</Version>
> <design:ResultSets derivedMetaData="true">
> <design:resultSetDefinitions>
> <design:resultSetColumns>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>ORDERNUMBER</design:name>
> <design:position>1</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:precision>10</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>ORDERNUMBER</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>ORDERNUMBER</design:label>
> <design:formattingHints>
> <design:displaySize>11</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>PRODUCTCODE</design:name>
> <design:position>2</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>15</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>PRODUCTCODE</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>PRODUCTCODE</design:label>
> <design:formattingHints>
> <design:displaySize>15</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>QUANTITYORDERED</design:name>
> <design:position>3</design:position>
> <design:nativeDataTypeCode>4</design:nativeDataTypeCode>
> <design:precision>10</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>QUANTITYORDERED</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>QUANTITYORDERED</design:label>
> <design:formattingHints>
> <design:displaySize>11</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>PRICEEACH</design:name>
> <design:position>4</design:position>
> <design:nativeDataTypeCode>8</design:nativeDataTypeCode>
> <design:precision>15</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>PRICEEACH</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>PRICEEACH</design:label>
> <design:formattingHints>
> <design:displaySize>22</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>ORDERLINENUMBER</design:name>
> <design:position>5</design:position>
> <design:nativeDataTypeCode>5</design:nativeDataTypeCode>
> <design:precision>5</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>ORDERLINENUMBER</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>ORDERLINENUMBER</design:label>
> <design:formattingHints>
> <design:displaySize>6</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="NonPDF" id="2">
> <property name="backgroundImage">green.png</property>
> <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>
> <simple-master-page name="PDF" id="7"/>
> </page-setup>
> <body>
> <table id="10">
> <property name="masterPage">NonPDF</property>
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">pdf</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <text-property name="displayName">ORDERNUMBER</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRODUCTCODE</property>
> <text-property name="displayName">PRODUCTCODE</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["PRODUCTCODE"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">QUANTITYORDERED</property>
> <text-property name="displayName">QUANTITYORDERED</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRICEEACH</property>
> <text-property name="displayName">PRICEEACH</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["PRICEEACH"]</expression>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="name">ORDERLINENUMBER</property>
> <text-property name="displayName">ORDERLINENUMBER</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="39"/>
> <column id="40"/>
> <column id="41"/>
> <column id="42"/>
> <column id="43"/>
> <header>
> <row id="11">
> <cell id="12">
> <label id="13">
> <text-property name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> <cell id="14">
> <label id="15">
> <text-property name="text">PRODUCTCODE</text-property>
> </label>
> </cell>
> <cell id="16">
> <label id="17">
> <text-property name="text">QUANTITYORDERED</text-property>
> </label>
> </cell>
> <cell id="18">
> <label id="19">
> <text-property name="text">PRICEEACH</text-property>
> </label>
> </cell>
> <cell id="20">
> <label id="21">
> <text-property name="text">ORDERLINENUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="22">
> <cell id="23">
> <data id="24">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="25">
> <data id="26">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">PRODUCTCODE</property>
> </data>
> </cell>
> <cell id="27">
> <data id="28">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">QUANTITYORDERED</property>
> </data>
> </cell>
> <cell id="29">
> <data id="30">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">PRICEEACH</property>
> </data>
> </cell>
> <cell id="31">
> <data id="32">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">ORDERLINENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="33">
> <cell id="34"/>
> <cell id="35"/>
> <cell id="36"/>
> <cell id="37"/>
> <cell id="38"/>
> </row>
> </footer>
> </table>
> <table id="44">
> <property name="masterPage">PDF</property>
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">xls</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> <structure>
> <property name="format">postscript</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> <structure>
> <property name="format">doc</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> <structure>
> <property name="format">html</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> <structure>
> <property name="format">csv</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> <structure>
> <property name="format">ppt</property>
> <expression name="valueExpr" type="javascript">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <text-property name="displayName">ORDERNUMBER</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRODUCTCODE</property>
> <text-property name="displayName">PRODUCTCODE</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["PRODUCTCODE"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">QUANTITYORDERED</property>
> <text-property name="displayName">QUANTITYORDERED</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["QUANTITYORDERED"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRICEEACH</property>
> <text-property name="displayName">PRICEEACH</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["PRICEEACH"]</expression>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="name">ORDERLINENUMBER</property>
> <text-property name="displayName">ORDERLINENUMBER</text-property>
> <expression name="expression"
> type="javascript">dataSetRow["ORDERLINENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <column id="73"/>
> <column id="74"/>
> <column id="75"/>
> <column id="76"/>
> <column id="77"/>
> <header>
> <row id="45">
> <cell id="46">
> <label id="47">
> <text-property name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> <cell id="48">
> <label id="49">
> <text-property name="text">PRODUCTCODE</text-property>
> </label>
> </cell>
> <cell id="50">
> <label id="51">
> <text-property name="text">QUANTITYORDERED</text-property>
> </label>
> </cell>
> <cell id="52">
> <label id="53">
> <text-property name="text">PRICEEACH</text-property>
> </label>
> </cell>
> <cell id="54">
> <label id="55">
> <text-property name="text">ORDERLINENUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <detail>
> <row id="56">
> <cell id="57">
> <data id="58">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="59">
> <data id="60">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">PRODUCTCODE</property>
> </data>
> </cell>
> <cell id="61">
> <data id="62">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">QUANTITYORDERED</property>
> </data>
> </cell>
> <cell id="63">
> <data id="64">
> <property name="whiteSpace">nowrap</property>
> <property name="resultSetColumn">PRICEEACH</property>
> </data>
> </cell>
> <cell id="65">
> <data id="66">
> <property name="whiteSpace">nowrap</property>
> <prop
Re: Dynamic Master page [message #641213 is a reply to message #640975] Wed, 24 November 2010 10:02 Go to previous messageGo to next message
Jana  is currently offline Jana
Messages: 3
Registered: November 2010
Junior Member
Hi Jason,

thank you very much for your advices. In my case, I had to use the third suggestion, and it works, but I have problem in the case if report doesn't have any data. The watermark is showed only in table and I need it to be showed on the whole page. So e.g i see only part of "L" from "CONFIDENTIAL". I set the grid height to 100 % but nothing changed.
Re: Dynamic Master page [message #641220 is a reply to message #641213] Wed, 24 November 2010 10:07 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Try setting the grid height to 8.5 in instead of %

Jason

On 11/24/2010 10:02 AM, Jana wrote:
> Hi Jason,
>
> thank you very much for your advices. In my case, I had to use the third
> suggestion, and it works, but I have problem in the case if report
> doesn't have any data. The watermark is showed only in table and I need
> it to be showed on the whole page. So e.g i see only part of "L" from
> "CONFIDENTIAL". I set the grid height to 100 % but nothing changed.
Re: Dynamic Master page [message #641638 is a reply to message #640678] Fri, 26 November 2010 07:15 Go to previous messageGo to next message
No real name is currently offline No real name
Messages: 7
Registered: November 2010
Junior Member
Hi Jason,

I'm trying to use your code. Could you please specify this line:
var TargetURL = TargetURL&newHeight=....calculated in first report

I don't understand the value "newHeight" is this the name of the parameter set in the first report for using the data set?

thanks!
Re: Dynamic Master page [message #641659 is a reply to message #641220] Fri, 26 November 2010 09:57 Go to previous messageGo to next message
Jana  is currently offline Jana
Messages: 3
Registered: November 2010
Junior Member
Jason,
I tried your example and it doesn't work in the case when only pdf should have background image and the other formats not.

<method name="onRender"><![CDATA[if(
reportContext.getOutputFormat() == "html" ){
this.getStyle().backgroundImage = "";
}]]></method>

so I need help with this for pdf output.
Re: Dynamic Master page [message #641876 is a reply to message #641638] Sun, 28 November 2010 23:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

newHeight would be the parameter in the second report. You would use
this parameter in the second report to set the height.

Jason

On 11/26/2010 7:15 AM, nadine_heinrichs@gmx.de wrote:
> Hi Jason,
>
> I'm trying to use your code. Could you please specify this line:
> var TargetURL = TargetURL&newHeight=....calculated in first report
>
> I don't understand the value "newHeight" is this the name of the
> parameter set in the first report for using the data set?
>
> thanks!
>
Re: Dynamic Master page [message #641877 is a reply to message #641659] Sun, 28 November 2010 23:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

I tried that script and it worked for me. Can you try
if( reportContext.getOutputFormat() != "pdf" ){
this.getStyle().backgroundImage = "";
}

Jason

On 11/26/2010 9:57 AM, Jana wrote:
> Jason, I tried your example and it doesn't work in the case when only
> pdf should have background image and the other formats not.
>
> <method name="onRender"><![CDATA[if( reportContext.getOutputFormat() ==
> "html" ){
> this.getStyle().backgroundImage = "";
> }]]></method>
>
> so I need help with this for pdf output.
Re: Dynamic Master page [message #1059412 is a reply to message #640595] Sat, 18 May 2013 01:43 Go to previous messageGo to next message
GowriShankar V is currently offline GowriShankar V
Messages: 1
Registered: May 2013
Junior Member
You can change the master page settings in the beforeFactory like:
reportContext.getDesignHandle().findMasterPage("myMasterPage ").setProperty("height",
"4in");
Where myMasterPage is the named master page. You also must set the page
type to custom. You do this manually or by script like:
reportContext.getDesignHandle().findMasterPage("myMasterPage ").pageType="custom";



hi Jason,
i have a small doubt in dis.
do we have to run the reports using the run n render task or the changes can be observed by running in the BIRT viewer itself after we implament the code given in the post to change the width and height of the master page in the beforeFactory task


Thanks
GowriShankar..!!
Re: Dynamic Master page [message #1059872 is a reply to message #1059412] Wed, 22 May 2013 00:32 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1546
Registered: July 2009
Senior Member

If you're using a fixed layout, the width and height settings should work even from the viewer. Let me know.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Dynamic Master page [message #1061075 is a reply to message #1059872] Wed, 29 May 2013 15:39 Go to previous messageGo to next message
Jonathan Rodgers is currently offline Jonathan Rodgers
Messages: 11
Registered: May 2013
Junior Member
I had the same question regarding dynamically adjusting the master page size. With no success, can I be pointed in the right direction. Thanks.

Im using a fixed layout, and put the following in Script: beforeFactory

reportContext.getDesignHandle().findmasterpage("Simple MasterPage").pagetype="custom";
reportContext.getDesignHandle().findMasterPage("Simple MasterPage").setProperty("height","8.5in");
reportContext.getDesignHandle().findMasterPage("Simple MasterPage").setProperty("width","11in");

However I get the following errors:

ReportDesign (id = 1):
+ There are errors evaluating script "reportContext.getDesignHandle().findmasterpage("Simple MasterPage").pagetype="custom";
reportContext.getDesignHandle().findMasterPage("Simple MasterPage").setProperty("height","8.5in");
reportContext.getDesignHandle().findMasterPage("Simple MasterPage").setProperty("width","11in");":
TypeError: Cannot find function findmasterpage in object org.eclipse.birt.report.model.api.ReportDesignHandle@a00a15. (/report/method[@name="beforeFactory"]#1)
Re: Dynamic Master page [message #1061529 is a reply to message #1061075] Sat, 01 June 2013 23:46 Go to previous messageGo to next message
Michael Williams is currently offline Michael Williams
Messages: 1546
Registered: July 2009
Senior Member

If you look at your code and at the error, your first line has all lower case letters in findMasterPage and the error is telling you it doesn't recognize it as "findmasterpage". If you change that line, it should work.

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Re: Dynamic Master page [message #1061723 is a reply to message #1061529] Mon, 03 June 2013 11:09 Go to previous messageGo to next message
Jonathan Rodgers is currently offline Jonathan Rodgers
Messages: 11
Registered: May 2013
Junior Member
Thanks that was it, along with the inpromper capitalization ".pagetype". I read that error message repeatedly just wasnt seeing the issue.
Re: Dynamic Master page [message #1062490 is a reply to message #1061723] Sat, 08 June 2013 01:23 Go to previous message
Michael Williams is currently offline Michael Williams
Messages: 1546
Registered: July 2009
Senior Member

Great! Glad it's resolved now! Let us know whenever you have questions! Smile

Michael

Add interactivity, scheduling, sharing, live Excel export, and JS integration to your BIRT app with the new, free BIRT server, BIRT iHub F-Type.
Previous Topic:Problem on set global variable
Next Topic:chart: hide legend entry
Goto Forum:
  


Current Time: Mon Jul 28 08:27:30 EDT 2014

Powered by FUDForum. Page generated in 0.02898 seconds