Skip to main content



      Home
Home » Archived » BIRT » Image in cross tab
Image in cross tab [message #255417] Fri, 14 September 2007 02:59 Go to next message
Eclipse UserFriend
In sample dataset of PRODUCTLINES, I want to use column of PRODUCTLINE and
IMAGE to create a crosstab.
I have created a cube use column of PRODUCTLINE to be dimension and
measure.
Create a cross tab and drop the dimension in row, and measure in detail.
And now I want to design a cross tab like this:

----------------------
| Car | image(Car) |
----------------------
| Ship | image(Ship) |
----------------------

What can I do?
Re: Image in cross tab [message #255514 is a reply to message #255417] Fri, 14 September 2007 13:18 Go to previous message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

I do not think you can use image data in the cube, but you can do a
nasty work around by calling a hidden table before the crosstab that
loads a map with the images and then drop an image element into the
crosstab and set its data using its onCreate script. Take a look at the
attached example.

Look at the initialize script and the onCreate script for the row in the
top table. Then look at the onCreate script for both elements in the
cross tab. This is fairly convoluted and there may be a better way of
doing this. You may also want to log a bugzilla entry for this..

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.14"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.2.0.v20070620 Build &lt;2.2.0.v20070626-1003></property>
<property name="units">in</property>
<property name="comments">Copyright (c) 2007 &lt;&lt;Your Company
Name here>></property>
<html-property name="description">Creates a blank report with no
predefined content.</html-property>
<method name="initialize"><![CDATA[importPackage( Packages.java.util );
myimagearray = new HashMap();]]></method>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="6">
<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="7">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">PRODUCTLINE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">TEXTDESCRIPTION</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">HTMLDESCRIPTION</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">IMAGE</property>
<property name="dataType">any</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">PRODUCTLINE</property>
<property name="nativeName">PRODUCTLINE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">TEXTDESCRIPTION</property>
<property name="nativeName">TEXTDESCRIPTION</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">HTMLDESCRIPTION</property>
<property name="nativeName">HTMLDESCRIPTION</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">IMAGE</property>
<property name="nativeName">IMAGE</property>
<property name="dataType">any</property>
<property name="nativeDataType">2004</property>
</structure>
</list-property>
<property name="queryText">select *
from CLASSICMODELS.PRODUCTLINES</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>PRODUCTLINE</design:name>
<design:position>1</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>PRODUCTLINE</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>TEXTDESCRIPTION</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>4000</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>TEXTDESCRIPTION</design:label>
<design:formattingHints>
<design:displaySize>4000</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>HTMLDESCRIPTION</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>1048576</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>HTMLDESCRIPTION</design:label>
<design:formattingHints>
<design:displaySize>1048576</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>IMAGE</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>2004</design:nativeDataTypeCode >
<design:precision>1048576</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
</design:attributes>
<design:usageHints>
<design:label>IMAGE</design:label>
<design:formattingHints>
<design:displaySize>2097152</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
</data-sets>
<cubes>
<tabular-cube name="Customer Cube" id="14">
<property name="defaultMeasureGroup">Summary Field</property>
<property name="dimensions">
<tabular-dimension name="Group" id="15">
<property
name="defaultHierarchy">NewTabularHierarchy</property>
<property name="hierarchies">
<tabular-hierarchy name="NewTabularHierarchy"
id="16">
<property name="levels">
<tabular-level name="PRODUCTLINE" id="17">
<property
name="dataType">string</property>
<property
name="levelType">dynamic</property>
<property
name="columnName">PRODUCTLINE</property>
</tabular-level>
</property>
<property name="dataSet">Data Set</property>
</tabular-hierarchy>
</property>
</tabular-dimension>
</property>
<property name="measureGroups">
<tabular-measure-group name="Summary Field" id="18"/>
</property>
<property name="dataSet">Data Set</property>
</tabular-cube>
</cubes>
<styles>
<style name="crosstab" id="4">
<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-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="NewStyle" id="133">
<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>
<table id="72">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">PRODUCTLINE</property>
<expression
name="expression">dataSetRow["PRODUCTLINE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">TEXTDESCRIPTION</property>
<expression
name="expression">dataSetRow["TEXTDESCRIPTION"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">HTMLDESCRIPTION</property>
<expression
name="expression">dataSetRow["HTMLDESCRIPTION"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">IMAGE</property>
<expression
name="expression">dataSetRow["IMAGE"]</expression>
<property name="dataType">any</property>
</structure>
</list-property>
<column id="96"/>
<column id="97"/>
<column id="98"/>
<column id="99"/>
<header>
<row id="73">
<cell id="74">
<label id="75">
<text-property
name="text">PRODUCTLINE</text-property>
</label>
</cell>
<cell id="76">
<label id="77">
<text-property
name="text">TEXTDESCRIPTION</text-property>
</label>
</cell>
<cell id="78">
<label id="79">
<text-property
name="text">HTMLDESCRIPTION</text-property>
</label>
</cell>
<cell id="80">
<label id="81">
<text-property
name="text">IMAGE</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="82">
<method
name="onCreate"><![CDATA[importPackage(Packages.java.io);
importPackage(Packages.java.lang);


xyz = this.getRowData().getColumnValue("IMAGE");
jjj = this.getRowData().getColumnValue("IMAGE").length;

myimagearray.put(this.getRowData().getColumnValue("PRODUCTLINE "),
this.getRowData().getColumnValue("IMAGE"));]]></method>
<cell id="83">
<data id="84">
<property
name="resultSetColumn">PRODUCTLINE</property>
</data>
</cell>
<cell id="85">
<data id="86">
<property
name="resultSetColumn">TEXTDESCRIPTION</property>
</data>
</cell>
<cell id="87">
<data id="88">
<property
name="resultSetColumn">HTMLDESCRIPTION</property>
</data>
</cell>
<cell id="89">
<data id="90">
<property
name="resultSetColumn">IMAGE</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="91">
<cell id="92"/>
<cell id="93"/>
<cell id="94"/>
<cell id="95"/>
</row>
</footer>
</table>
<extended-item extensionName="Crosstab" id="33">
<property name="rows">
<extended-item extensionName="CrosstabView" id="34">
<property name="views">
<extended-item extensionName="DimensionView"
id="35">
<property name="dimension">Group</property>
<property name="levels">
<extended-item
extensionName="LevelView" name="NewLevel View" id="36">
<property
name="level">Group/PRODUCTLINE</property>
<property name="member">
<extended-item
extensionName="CrosstabCell" id="37">
<property name="content">
<data
name="PRODUCTLINE" id="38">
<property
name="style">NewStyle</property>
<method
name="onCreate"><![CDATA[myproductline = this.getValue();]]></method>
<property
name="resultSetColumn">PRODUCTLINE</property>
</data>
<image id="71">
<property
name="style">NewStyle</property>
<method
name="onCreate"><![CDATA[this.data =
myimagearray.get(myproductline);]]></method>
<property
name="source">expr</property>
<expression
name="valueExpr">row["Column Binding_1"]</expression>
</image>
</property>
</extended-item>
</property>
</extended-item>
</property>
</extended-item>
</property>
</extended-item>
</property>
<property name="cube">Customer Cube</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">PRODUCTLINE</property>
<expression
name="expression">dimension["Group"]["PRODUCTLINE"];</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">Column Binding_1</property>
<expression name="expression">"dummy"</expression>
<property name="dataType">any</property>
</structure>
</list-property>
</extended-item>
</body>
<list-property name="images">
<structure>
<property name="name">clientprintico.PNG</property>
<property name="data">

iVBORw0KGgoAAAANSUhEUgAAABIAAAAVCAIAAADEqSm4AAAAAXNSR0IArs4c 6QAAAARnQU1BAACxjwv8

YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpR PAAAAd5JREFUOE+tk8sv

A1EUxssfZmFhZSOsBAsbodEISryiXmmxECSIRwgRlaAiXhGPqERppZp2zJQa JtrRalNqOs/S1rmZeiVl

pDH5cpOZe373O+eeOVk226gqgwewDKTKgEEJfsVW9892zOlVVd/+NfIbBkwy mYwnErHYC8dLDCuEI2zw

iaGDkSqt7jcsHk8sb5nnTbsTxo3hGZNh1NgxOEv5wwpY7OWVF2IMK4YjnOwD zLU3pIAB8+62OTRtMowY

OwfncCqggEE9j89c8DGKfO6RD0H5nSStgAHz6TZj6h1bgNrsl3cKWKoe8PGF 3LfIx07cWXHqRwxuv7V/

KnUHvhB+E0CM22vFKAuGMAj46AHqG0HS8KnJMN7SPwlrQ89IQ/dwnW6gpq1P 06yvbuxSa3XQbtiCMAhO

/SXw4glK7oCE0aKTluxe8eSGPyKFgyt+B+c2Xdyag12wMos2Btac/OJP7DIg EQ8Ic/hEGyVaSN7sEfbc

3DbGrjuj1uxsAHKXVGkw3C+5aPHcK57eCsekcOjhdwluC0NWK+dRAGR9c4MM L+5FyF5WrW6oslFfom4u

KNPkFZVDKCgNRvghQwEmQGYqtPpSdUtBWXVeYYqBrTQY3K98pKLkNvzHmP59 0t8A0tcB7BW6gQcAAAAA
SUVORK5CYII=
</property>
</structure>
</list-property>
</report>


Sure wrote:
> In sample dataset of PRODUCTLINES, I want to use column of PRODUCTLINE
> and IMAGE to create a crosstab.
> I have created a cube use column of PRODUCTLINE to be dimension and
> measure.
> Create a cross tab and drop the dimension in row, and measure in detail.
> And now I want to design a cross tab like this:
>
> ----------------------
> | Car | image(Car) |
> ----------------------
> | Ship | image(Ship) |
> ----------------------
>
> What can I do?
>
Previous Topic:Birt all in one 2.2.0 installs 1.0.1???
Next Topic:Dynamic table width in PDF format of a report.Is it possible?
Goto Forum:
  


Current Time: Sun Jun 08 21:42:39 EDT 2025

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

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

Back to the top