Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » PageNofM(Crystal Report Function) functionality in BIRT(PageNofM(Crystal Report Function) functionality in BIRT)
PageNofM(Crystal Report Function) functionality in BIRT [message #554762] Tue, 24 August 2010 07:21 Go to next message
No real name is currently offline No real name
Messages: 3
Registered: February 2010
Junior Member
Hi,

I need to implement PageNofM functionlity in the PDF Birt report footer.

Currently I have manually created a grid with 4 columns, to hold 'Page', 'N', 'of', 'M' and I am getting N and M values dynamically using AutoText. But as the values of N and M increase from 2 digits to 3 or 4 digits, the values of N and M gets truncated, the size of the column that hold these N and M values in the grid does not expand automatically based on the N and M values length.

Where as in Crystal Reports, PageNofM function handles the expansion and contraction of the columns Width based on the N and M values.

Is there any equivalent function in BIRT? Else, please suggest an alternative


Thanks,
Madhuri
Re: PageNofM(Crystal Report Function) functionality in BIRT [message #554867 is a reply to message #554762] Tue, 24 August 2010 10:53 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you not just use inline styles to re-construct the page n of m
string on the master page. Take a look at the attached example.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.21"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.2.v20100208 Build &lt;2.5.2.v20100210-0630></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="7">
<text-property name="displayName"></text-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>
<property name="OdaConnProfileName"></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>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<text-property
name="displayName">PRODUCTCODE</text-property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<text-property
name="displayName">QUANTITYORDERED</text-property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<text-property
name="displayName">PRICEEACH</text-property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<text-property
name="displayName">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]]></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="pageNofM" id="57">
<property name="display">inline</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-header>
<grid id="50">
<column id="51"/>
<row id="52">
<cell id="53">
<auto-text id="54">
<property name="style">pageNofM</property>
<property
name="type">page-number</property>
</auto-text>
<label id="56">
<property name="style">pageNofM</property>
<text-property
name="text">of</text-property>
</label>
<auto-text id="55">
<property name="style">pageNofM</property>
<property name="type">total-page</property>
</auto-text>
</cell>
</row>
</grid>
</page-header>
<page-footer>
<auto-text id="48">
<property name="type">page-variable</property>
<property name="pageVariable">MyCurrentPage</property>
</auto-text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="11">
<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="40"/>
<column id="41"/>
<column id="42"/>
<column id="43"/>
<column id="44"/>
<header>
<row id="12">
<cell id="13">
<label id="14">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="15">
<label id="16">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="17">
<label id="18">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="19">
<label id="20">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="21">
<label id="22">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="23">
<cell id="24">
<data id="25">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="26">
<data id="27">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="28">
<data id="29">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="30">
<data id="31">
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="32">
<data id="33">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="34">
<cell id="35"/>
<cell id="36"/>
<cell id="37"/>
<cell id="38"/>
<cell id="39"/>
</row>
</footer>
</table>
</body>
</report>


On 8/24/2010 7:21 AM, madhuri.boggavarapu@wipro.com wrote:
> Hi,
>
> I need to implement PageNofM functionlity in the PDF Birt report footer.
>
> Currently I have manually created a grid with 4 columns, to hold 'Page',
> 'N', 'of', 'M' and I am getting N and M values dynamically using
> AutoText. But as the values of N and M increase from 2 digits to 3 or 4
> digits, the values of N and M gets truncated, the size of the column
> that hold these N and M values in the grid does not expand automatically
> based on the N and M values length.
>
> Where as in Crystal Reports, PageNofM function handles the expansion and
> contraction of the columns Width based on the N and M values.
>
> Is there any equivalent function in BIRT? Else, please suggest an
> alternative
>
>
> Thanks,
> Madhuri


Jason Weathersby

BIRT Exchange
Re: PageNofM(Crystal Report Function) functionality in BIRT [message #555035 is a reply to message #554762] Wed, 25 August 2010 05:15 Go to previous message
No real name is currently offline No real name
Messages: 3
Registered: February 2010
Junior Member
Thanks for the reply Jason, it worked.
Previous Topic:image in the grid
Next Topic:birt and cognos reportnet
Goto Forum:
  


Current Time: Wed Apr 23 02:45:00 EDT 2014

Powered by FUDForum. Page generated in 0.02444 seconds