Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Crosstab issue - not to sort alphabetically
Crosstab issue - not to sort alphabetically [message #366483] Mon, 05 January 2009 16:36 Go to next message
Anthony Ku Ong is currently offline Anthony Ku OngFriend
Messages: 3
Registered: July 2009
Junior Member
Hi,

I'm using BIRT 2.3.1 and would like to know if there's a way
to have the crosstab not sort alphabetically (when creating groups),
but to take 'unsorted' result from the tabluar data?

Say this is the raw tabular data:

Category | Units | Category
----------|--------------|----------------------|----------- -
Apples | XX One
Bannanas | XX One
Apples | XX Two
Oranges | XX Two
Bannanas | XX Two
Apples | XX Three
Oranges | XX Three
Bannanas | XX Three


If I create a cross-tab, i'll get something like this:

-----------------------------------------------------
Category | Apples | Oranges | Bannanas
|
-----------------------------------------------------
| Three | XX | XX | XX |
| Two | XX | XX | XX |
| One | XX | XX | XX |
-----------------------------------------------------


For me this is out-of-order (Category) I want something like this:
The raw data is already sorted, and I don't want to resort the fields
alphabetically.

-----------------------------------------------------
| Apples | Oranges | Bannanas
-----------------------------------------------------
| One | XX | XX | XX |
| Two | XX | XX | XX |
| Three | XX | XX | XX |
-----------------------------------------------------

How can I do this? I know that I can tell a BIRT table that my data is
already sorted when adding a group section using : <property
name="sortByGroups">false</property>. Is there something similar I can
do in the Crosstab?

Thanks,
Anthony
Re: Crosstab issue - not to sort alphabetically [message #366503 is a reply to message #366483] Tue, 06 January 2009 19:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Anthony,

If you select the crosstab and then choose sorting you should be able to
enter an expression for the sort key. In your case you could enter:

if( data["yourcat"] == "One" ){
"A";
}
if( data["yourcat"] == "Two" ){
"B";
}
if( data["yourcat"] == "Three" ){
"C";
}

You could also add a computed column to the dataset that indicates the
order and put it in the cube and use it to sort on.

Jason

Anthony Ku Ong wrote:
> Hi,
>
> I'm using BIRT 2.3.1 and would like to know if there's a way
> to have the crosstab not sort alphabetically (when creating groups),
> but to take 'unsorted' result from the tabluar data?
>
> Say this is the raw tabular data:
>
> Category | Units | Category
> ----------|--------------|----------------------|----------- -
> Apples | XX One Bannanas | XX One
> Apples | XX Two
> Oranges | XX Two Bannanas | XX Two
> Apples | XX Three
> Oranges | XX Three Bannanas | XX Three
>
>
> If I create a cross-tab, i'll get something like this:
>
> -----------------------------------------------------
> Category | Apples | Oranges | Bannanas |
> -----------------------------------------------------
> | Three | XX | XX | XX |
> | Two | XX | XX | XX |
> | One | XX | XX | XX |
> -----------------------------------------------------
>
>
> For me this is out-of-order (Category) I want something like this:
> The raw data is already sorted, and I don't want to resort the fields
> alphabetically.
>
> -----------------------------------------------------
> | Apples | Oranges | Bannanas
> -----------------------------------------------------
> | One | XX | XX | XX |
> | Two | XX | XX | XX |
> | Three | XX | XX | XX |
> -----------------------------------------------------
>
> How can I do this? I know that I can tell a BIRT table that my data is
> already sorted when adding a group section using : <property
> name="sortByGroups">false</property>. Is there something similar I can
> do in the Crosstab?
>
> Thanks,
> Anthony
>
>
>
>
Re: Crosstab issue - not to sort alphabetically [message #366517 is a reply to message #366503] Wed, 07 January 2009 07:05 Go to previous messageGo to next message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
Hi Jason,

I have a similar problem, a cross-tab from a data set that is already sorted.
In the data set I have a column that is the sort order, but I don't want to display that value in
the crosstab.
I can't see how to 'use it to sort on'.

Colin

Jason Weathersby wrote:
> Anthony,
>
> If you select the crosstab and then choose sorting you should be able to
> enter an expression for the sort key. In your case you could enter:
>
> if( data["yourcat"] == "One" ){
> "A";
> }
> if( data["yourcat"] == "Two" ){
> "B";
> }
> if( data["yourcat"] == "Three" ){
> "C";
> }
>
> You could also add a computed column to the dataset that indicates the
> order and put it in the cube and use it to sort on.
>
> Jason
Re: Crosstab issue - not to sort alphabetically [message #366521 is a reply to message #366517] Wed, 07 January 2009 16:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Colin,

Take a look at the attached example. I wanted to sort the columns based
on quantity in stock, but I did not want to add a dimension for it. So
I took the product line dimension and added an attribute that has the
qty in stock. I then use this to sort the crosstab. I also added a
derived measure to show the value. I only did this to prove that it was
working but this could be deleted. So in your case use your sort order
column as an attribute on the dimension you want to sort.

Jason

<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.17"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.3.1.v20080911 Build &lt;2.3.1.v20080922-1151></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>
<list-property name="userProperties">
<structure>
<property name="name">salesbydate.dsOrders.x</property>
<property name="type">integer</property>
<property name="isVisible">false</property>
</structure>
<structure>
<property name="name">salesbydate.dsOrders.y</property>
<property name="type">integer</property>
<property name="isVisible">false</property>
</structure>
<structure>
<property
name="name">salesbydate.ProductGroup.NewTabularHierarchy.x </property>
<property name="type">integer</property>
<property name="isVisible">false</property>
</structure>
<structure>
<property
name="name">salesbydate.ProductGroup.NewTabularHierarchy.y </property>
<property name="type">integer</property>
<property name="isVisible">false</property>
</structure>
<structure>
<property name="name">salesbydate.dsOrders.width</property>
<property name="type">integer</property>
<property name="isVisible">false</property>
</structure>
<structure>
<property name="name">salesbydate.dsOrders.height</property>
<property name="type">integer</property>
<property name="isVisible">false</property>
</structure>
</list-property>
<property name="salesbydate.dsOrders.x">251</property>
<property name="salesbydate.dsOrders.y">47</property>
<property
name="salesbydate.ProductGroup.NewTabularHierarchy.x">39</property >
<property
name="salesbydate.ProductGroup.NewTabularHierarchy.y">69</property >
<property name="salesbydate.dsOrders.width">150</property>
<property name="salesbydate.dsOrders.height">200</property>
<text-property name="displayName">Blank Report</text-property>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="layoutPreference">auto layout</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>
<property name="OdaConnProfileName"></property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="customers" id="8">
<list-property name="columnHints">
<structure>
<property name="columnName">CUSTOMERNUMBER</property>
<property name="displayName">CUSTOMERNUMBER</property>
</structure>
<structure>
<property name="columnName">CUSTOMERNAME</property>
<property name="displayName">CUSTOMERNAME</property>
</structure>
<structure>
<property name="columnName">CONTACTLASTNAME</property>
<property name="displayName">CONTACTLASTNAME</property>
</structure>
<structure>
<property name="columnName">CONTACTFIRSTNAME</property>
<property
name="displayName">CONTACTFIRSTNAME</property>
</structure>
<structure>
<property name="columnName">PHONE</property>
<property name="displayName">PHONE</property>
</structure>
<structure>
<property name="columnName">ADDRESSLINE1</property>
<property name="displayName">ADDRESSLINE1</property>
</structure>
<structure>
<property name="columnName">ADDRESSLINE2</property>
<property name="displayName">ADDRESSLINE2</property>
</structure>
<structure>
<property name="columnName">CITY</property>
<property name="displayName">CITY</property>
</structure>
<structure>
<property name="columnName">STATE</property>
<property name="displayName">STATE</property>
</structure>
<structure>
<property name="columnName">POSTALCODE</property>
<property name="displayName">POSTALCODE</property>
</structure>
<structure>
<property name="columnName">COUNTRY</property>
<property name="displayName">COUNTRY</property>
</structure>
<structure>
<property
name="columnName">SALESREPEMPLOYEENUMBER</property>
<property
name="displayName">SALESREPEMPLOYEENUMBER</property>
</structure>
<structure>
<property name="columnName">CREDITLIMIT</property>
<property name="displayName">CREDITLIMIT</property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">CUSTOMERNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CONTACTLASTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">CONTACTFIRSTNAME</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">PHONE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">ADDRESSLINE1</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">ADDRESSLINE2</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">CITY</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">STATE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">POSTALCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">COUNTRY</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">12</property>
<property
name="name">SALESREPEMPLOYEENUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">13</property>
<property name="name">CREDITLIMIT</property>
<property name="dataType">float</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="nativeName">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">CUSTOMERNAME</property>
<property name="nativeName">CUSTOMERNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">CONTACTLASTNAME</property>
<property name="nativeName">CONTACTLASTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">CONTACTFIRSTNAME</property>
<property name="nativeName">CONTACTFIRSTNAME</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">PHONE</property>
<property name="nativeName">PHONE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">6</property>
<property name="name">ADDRESSLINE1</property>
<property name="nativeName">ADDRESSLINE1</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">ADDRESSLINE2</property>
<property name="nativeName">ADDRESSLINE2</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">CITY</property>
<property name="nativeName">CITY</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">STATE</property>
<property name="nativeName">STATE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">POSTALCODE</property>
<property name="nativeName">POSTALCODE</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">COUNTRY</property>
<property name="nativeName">COUNTRY</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">12</property>
<property name="name">SALESREPEMPLOYEENUMBER</property>
<property
name="nativeName">SALESREPEMPLOYEENUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">13</property>
<property name="name">CREDITLIMIT</property>
<property name="nativeName">CREDITLIMIT</property>
<property name="dataType">float</property>
<property name="nativeDataType">8</property>
</structure>
</list-property>
<property name="queryText">select *
from customers</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>CUSTOMERNUMBER</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>CUSTOMERNUMBER</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CUSTOMERNUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CUSTOMERNAME</design:name>
<design:position>2</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>CUSTOMERNAME</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CUSTOMERNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CONTACTLASTNAME</design:name>
<design:position>3</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>CONTACTLASTNAME</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CONTACTLASTNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CONTACTFIRSTNAME</design:name>
<design:position>4</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>CONTACTFIRSTNAME</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CONTACTFIRSTNAME</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>PHONE</design:name>
<design:position>5</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>PHONE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>PHONE</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ADDRESSLINE1</design:name>
<design:position>6</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ADDRESSLINE1</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ADDRESSLINE1</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>ADDRESSLINE2</design:name>
<design:position>7</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ADDRESSLINE2</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ADDRESSLINE2</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CITY</design:name>
<design:position>8</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>CITY</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CITY</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>STATE</design:name>
<design:position>9</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>STATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>STATE</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>POSTALCODE</design:name>
<design:position>10</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>POSTALCODE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>POSTALCODE</design:label>
<design:formattingHints>
<design:displaySize>15</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>COUNTRY</design:name>
<design:position>11</design:position>
<design:nativeDataTypeCode>12</design:nativeDataTypeCode>
<design:precision>50</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>COUNTRY</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>COUNTRY</design:label>
<design:formattingHints>
<design:displaySize>50</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>SALESREPEMPLOYEENUMBER</design:name>
<design:position>12</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>SALESREPEMPLOYEENUMBER</design:displayName >
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>SALESREPEMPLOYEENUMBER</design:label>
<design:formattingHints>
<design:displaySize>11</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>CREDITLIMIT</design:name>
<design:position>13</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>CREDITLIMIT</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>CREDITLIMIT</design:label>
<design:formattingHints>
<design:displaySize>22</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
</design:resultSetColumns>
</design:resultSetDefinitions>
</design:ResultSets>
</model:DesignValues>]]></xml-property>
</oda-data-set>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="dsOrders" id="9">
<list-property name="columnHints">
<structure>
<property name="columnName">ORDERNUMBER</property>
<property name="displayName">ORDERNUMBER</property>
</structure>
<structure>
<property name="columnName">PRODUCTCODE</property>
<property name="displayName">PRODUCTCODE</property>
</structure>
<structure>
<property name="columnName">QUANTITYORDERED</property>
<property name="displayName">QUANTITYORDERED</property>
</structure>
<structure>
<property name="columnName">PRICEEACH</property>
<property name="displayName">PRICEEACH</property>
</structure>
<structure>
<property name="columnName">ORDERLINENUMBER</property>
<property name="displayName">ORDERLINENUMBER</property>
</structure>
<structure>
<property name="columnName">ORDERNUMBER_6</property>
<property name="displayName">ORDERNUMBER</property>
</structure>
<structure>
<property name="columnName">ORDERDATE</property>
<property name="displayName">ORDERDATE</property>
</structure>
<structure>
<property name="columnName">REQUIREDDATE</property>
<property name="displayName">REQUIREDDATE</property>
</structure>
<structure>
<property name="columnName">SHIPPEDDATE</property>
<property name="displayName">SHIPPEDDATE</property>
</structure>
<structure>
<property name="columnName">STATUS</property>
<property name="displayName">STATUS</property>
</structure>
<structure>
<property name="columnName">COMMENTS</property>
<property name="displayName">COMMENTS</property>
</structure>
<structure>
<property name="columnName">CUSTOMERNUMBER</property>
<property name="displayName">CUSTOMERNUMBER</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>
<structure>
<property name="position">6</property>
<property name="name">ORDERNUMBER_6</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">ORDERDATE</property>
<property name="dataType">date</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">REQUIREDDATE</property>
<property name="dataType">date</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">SHIPPEDDATE</property>
<property name="dataType">date</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">STATUS</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">COMMENTS</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">12</property>
<property name="name">CUSTOMERNUMBER</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>
<structure>
<property name="position">6</property>
<property name="name">ORDERNUMBER_6</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
<structure>
<property name="position">7</property>
<property name="name">ORDERDATE</property>
<property name="nativeName">ORDERDATE</property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
</structure>
<structure>
<property name="position">8</property>
<property name="name">REQUIREDDATE</property>
<property name="nativeName">REQUIREDDATE</property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
</structure>
<structure>
<property name="position">9</property>
<property name="name">SHIPPEDDATE</property>
<property name="nativeName">SHIPPEDDATE</property>
<property name="dataType">date</property>
<property name="nativeDataType">91</property>
</structure>
<structure>
<property name="position">10</property>
<property name="name">STATUS</property>
<property name="nativeName">STATUS</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">11</property>
<property name="name">COMMENTS</property>
<property name="nativeName">COMMENTS</property>
<property name="dataType">string</property>
<property name="nativeDataType">12</property>
</structure>
<structure>
<property name="position">12</property>
<property name="name">CUSTOMERNUMBER</property>
<property name="nativeName">CUSTOMERNUMBER</property>
<property name="dataType">integer</property>
<property name="nativeDataType">4</property>
</structure>
</list-property>
<property name="queryText">select *
from CLASSICMODELS.ORDERDETAILS, CLASSICMODELS.ORDERS
where CLASSICMODELS.ORDERS.ORDERNUMBER =
CLASSICMODELS.ORDERDETAILS.ORDERNUMBER
and
CLASSICMODELS.ORDERS.STATUS = 'Shipped'</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:resultColumnDefinitions>
<design:attributes>
<design:name>ORDERNUMBER</design:name>
<design:position>6</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>ORDERDATE</design:name>
<design:position>7</design:position>
<design:nativeDataTypeCode>91</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>ORDERDATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>ORDERDATE</design:label>
<design:formattingHints>
<design:displaySize>10</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>REQUIREDDATE</design:name>
<design:position>8</design:position>
<design:nativeDataTypeCode>91</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>REQUIREDDATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>REQUIREDDATE</design:label>
<design:formattingHints>
<design:displaySize>10</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>SHIPPEDDATE</design:name>
<design:position>9</design:position>
<design:nativeDataTypeCode>91</design:nativeDataTypeCode>
<design:precision>10</design:precision>
<design:scale>0</design:scale>
<design:nullability>Nullable</design:nullability>
<design:uiHints>
<design:displayName>SHIPPEDDATE</design:displayName>
</design:uiHints>
</design:attributes>
<design:usageHints>
<design:label>SHIPPEDDATE</design:label>
<design:formattingHints>
<design:displaySize>10</design:displaySize>
</design:formattingHints>
</design:usageHints>
</design:resultColumnDefinitions>
<design:resultColumnDefinitions>
<design:attributes>
<design:name>STATUS</design:name>
<design:position>
Re: Crosstab issue - not to sort alphabetically [message #366527 is a reply to message #366503] Thu, 08 January 2009 02:07 Go to previous messageGo to next message
Anthony Ku Ong is currently offline Anthony Ku OngFriend
Messages: 3
Registered: July 2009
Junior Member
Thanks Jason, tried your suggestion of adding a computed column to the
dataset and placing it in the cube to sort on. Works great :)
Re: Crosstab issue - not to sort alphabetically [message #366535 is a reply to message #366521] Thu, 08 January 2009 11:24 Go to previous messageGo to next message
Colin Sutton is currently offline Colin SuttonFriend
Messages: 121
Registered: July 2009
Senior Member
Thanks, Jason, excellent!
Colin

Jason Weathersby wrote:
> Colin,
>
> Take a look at the attached example. I wanted to sort the columns based
> on quantity in stock, but I did not want to add a dimension for it. So
> I took the product line dimension and added an attribute that has the
> qty in stock. I then use this to sort the crosstab. I also added a
> derived measure to show the value. I only did this to prove that it was
> working but this could be deleted. So in your case use your sort order
> column as an attribute on the dimension you want to sort.
>
> Jason
>
> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.17"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.3.1.v20080911 Build &lt;2.3.1.v20080922-1151></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>
> <list-property name="userProperties">
> <structure>
> <property name="name">salesbydate.dsOrders.x</property>
> <property name="type">integer</property>
> <property name="isVisible">false</property>
> </structure>
> <structure>
> <property name="name">salesbydate.dsOrders.y</property>
> <property name="type">integer</property>
> <property name="isVisible">false</property>
> </structure>
> <structure>
> <property
> name="name">salesbydate.ProductGroup.NewTabularHierarchy.x </property>
> <property name="type">integer</property>
> <property name="isVisible">false</property>
> </structure>
> <structure>
> <property
> name="name">salesbydate.ProductGroup.NewTabularHierarchy.y </property>
> <property name="type">integer</property>
> <property name="isVisible">false</property>
> </structure>
> <structure>
> <property name="name">salesbydate.dsOrders.width</property>
> <property name="type">integer</property>
> <property name="isVisible">false</property>
> </structure>
> <structure>
> <property name="name">salesbydate.dsOrders.height</property>
> <property name="type">integer</property>
> <property name="isVisible">false</property>
> </structure>
> </list-property>
> <property name="salesbydate.dsOrders.x">251</property>
> <property name="salesbydate.dsOrders.y">47</property>
> <property
> name="salesbydate.ProductGroup.NewTabularHierarchy.x">39</property >
> <property
> name="salesbydate.ProductGroup.NewTabularHierarchy.y">69</property >
> <property name="salesbydate.dsOrders.width">150</property>
> <property name="salesbydate.dsOrders.height">200</property>
> <text-property name="displayName">Blank Report</text-property>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="layoutPreference">auto layout</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>
> <property name="OdaConnProfileName"></property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="customers" id="8">
> <list-property name="columnHints">
> <structure>
> <property name="columnName">CUSTOMERNUMBER</property>
> <property name="displayName">CUSTOMERNUMBER</property>
> </structure>
> <structure>
> <property name="columnName">CUSTOMERNAME</property>
> <property name="displayName">CUSTOMERNAME</property>
> </structure>
> <structure>
> <property name="columnName">CONTACTLASTNAME</property>
> <property name="displayName">CONTACTLASTNAME</property>
> </structure>
> <structure>
> <property name="columnName">CONTACTFIRSTNAME</property>
> <property
> name="displayName">CONTACTFIRSTNAME</property>
> </structure>
> <structure>
> <property name="columnName">PHONE</property>
> <property name="displayName">PHONE</property>
> </structure>
> <structure>
> <property name="columnName">ADDRESSLINE1</property>
> <property name="displayName">ADDRESSLINE1</property>
> </structure>
> <structure>
> <property name="columnName">ADDRESSLINE2</property>
> <property name="displayName">ADDRESSLINE2</property>
> </structure>
> <structure>
> <property name="columnName">CITY</property>
> <property name="displayName">CITY</property>
> </structure>
> <structure>
> <property name="columnName">STATE</property>
> <property name="displayName">STATE</property>
> </structure>
> <structure>
> <property name="columnName">POSTALCODE</property>
> <property name="displayName">POSTALCODE</property>
> </structure>
> <structure>
> <property name="columnName">COUNTRY</property>
> <property name="displayName">COUNTRY</property>
> </structure>
> <structure>
> <property
> name="columnName">SALESREPEMPLOYEENUMBER</property>
> <property
> name="displayName">SALESREPEMPLOYEENUMBER</property>
> </structure>
> <structure>
> <property name="columnName">CREDITLIMIT</property>
> <property name="displayName">CREDITLIMIT</property>
> </structure>
> </list-property>
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">CUSTOMERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">CUSTOMERNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">CONTACTLASTNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">CONTACTFIRSTNAME</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">PHONE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">6</property>
> <property name="name">ADDRESSLINE1</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">ADDRESSLINE2</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">CITY</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">9</property>
> <property name="name">STATE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">10</property>
> <property name="name">POSTALCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">11</property>
> <property name="name">COUNTRY</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">12</property>
> <property
> name="name">SALESREPEMPLOYEENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">13</property>
> <property name="name">CREDITLIMIT</property>
> <property name="dataType">float</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">CUSTOMERNUMBER</property>
> <property name="nativeName">CUSTOMERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">CUSTOMERNAME</property>
> <property name="nativeName">CUSTOMERNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">CONTACTLASTNAME</property>
> <property name="nativeName">CONTACTLASTNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">CONTACTFIRSTNAME</property>
> <property name="nativeName">CONTACTFIRSTNAME</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">PHONE</property>
> <property name="nativeName">PHONE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">6</property>
> <property name="name">ADDRESSLINE1</property>
> <property name="nativeName">ADDRESSLINE1</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">ADDRESSLINE2</property>
> <property name="nativeName">ADDRESSLINE2</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">CITY</property>
> <property name="nativeName">CITY</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">9</property>
> <property name="name">STATE</property>
> <property name="nativeName">STATE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">10</property>
> <property name="name">POSTALCODE</property>
> <property name="nativeName">POSTALCODE</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">11</property>
> <property name="name">COUNTRY</property>
> <property name="nativeName">COUNTRY</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">12</property>
> <property name="name">SALESREPEMPLOYEENUMBER</property>
> <property
> name="nativeName">SALESREPEMPLOYEENUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">13</property>
> <property name="name">CREDITLIMIT</property>
> <property name="nativeName">CREDITLIMIT</property>
> <property name="dataType">float</property>
> <property name="nativeDataType">8</property>
> </structure>
> </list-property>
> <property name="queryText">select *
> from customers</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>CUSTOMERNUMBER</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>CUSTOMERNUMBER</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>CUSTOMERNUMBER</design:label>
> <design:formattingHints>
> <design:displaySize>11</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>CUSTOMERNAME</design:name>
> <design:position>2</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>CUSTOMERNAME</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>CUSTOMERNAME</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>CONTACTLASTNAME</design:name>
> <design:position>3</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>CONTACTLASTNAME</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>CONTACTLASTNAME</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>CONTACTFIRSTNAME</design:name>
> <design:position>4</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>CONTACTFIRSTNAME</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>CONTACTFIRSTNAME</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>PHONE</design:name>
> <design:position>5</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>PHONE</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>PHONE</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>ADDRESSLINE1</design:name>
> <design:position>6</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>ADDRESSLINE1</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>ADDRESSLINE1</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>ADDRESSLINE2</design:name>
> <design:position>7</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>ADDRESSLINE2</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>ADDRESSLINE2</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>CITY</design:name>
> <design:position>8</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>CITY</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>CITY</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>STATE</design:name>
> <design:position>9</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>STATE</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>STATE</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>POSTALCODE</design:name>
> <design:position>10</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>POSTALCODE</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>POSTALCODE</design:label>
> <design:formattingHints>
> <design:displaySize>15</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>COUNTRY</design:name>
> <design:position>11</design:position>
> <design:nativeDataTypeCode>12</design:nativeDataTypeCode>
> <design:precision>50</design:precision>
> <design:scale>0</design:scale>
> <design:nullability>Nullable</design:nullability>
> <design:uiHints>
> <design:displayName>COUNTRY</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>COUNTRY</design:label>
> <design:formattingHints>
> <design:displaySize>50</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>SALESREPEMPLOYEENUMBER</design:name>
> <design:position>12</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>SALESREPEMPLOYEENUMBER</design:displayName >
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>SALESREPEMPLOYEENUMBER</design:label>
> <design:formattingHints>
> <design:displaySize>11</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> <design:resultColumnDefinitions>
> <design:attributes>
> <design:name>CREDITLIMIT</design:name>
> <design:position>13</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>CREDITLIMIT</design:displayName>
> </design:uiHints>
> </design:attributes>
> <design:usageHints>
> <design:label>CREDITLIMIT</design:label>
> <design:formattingHints>
> <design:displaySize>22</design:displaySize>
> </design:formattingHints>
> </design:usageHints>
> </design:resultColumnDefinitions>
> </design:resultSetColumns>
> </design:resultSetDefinitions>
> </design:ResultSets>
> </model:DesignValues>]]></xml-property>
> </oda-data-set>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="dsOrders" id="9">
> <list-property name="columnHints">
> <structure>
> <property name="columnName">ORDERNUMBER</property>
> <property name="displayName">ORDERNUMBER</property>
> </structure>
> <structure>
> <property name="columnName">PRODUCTCODE</property>
> <property name="displayName">PRODUCTCODE</property>
> </structure>
> <structure>
> <property name="columnName">QUANTITYORDERED</property>
> <property name="displayName">QUANTITYORDERED</property>
> </structure>
> <structure>
> <property name="columnName">PRICEEACH</property>
> <property name="displayName">PRICEEACH</property>
> </structure>
> <structure>
> <property name="columnName">ORDERLINENUMBER</property>
> <property name="displayName">ORDERLINENUMBER</property>
> </structure>
> <structure>
> <property name="columnName">ORDERNUMBER_6</property>
> <property name="displayName">ORDERNUMBER</property>
> </structure>
> <structure>
> <property name="columnName">ORDERDATE</property>
> <property name="displayName">ORDERDATE</property>
> </structure>
> <structure>
> <property name="columnName">REQUIREDDATE</property>
> <property name="displayName">REQUIREDDATE</property>
> </structure>
> <structure>
> <property name="columnName">SHIPPEDDATE</property>
> <property name="displayName">SHIPPEDDATE</property>
> </structure>
> <structure>
> <property name="columnName">STATUS</property>
> <property name="displayName">STATUS</property>
> </structure>
> <structure>
> <property name="columnName">COMMENTS</property>
> <property name="displayName">COMMENTS</property>
> </structure>
> <structure>
> <property name="columnName">CUSTOMERNUMBER</property>
> <property name="displayName">CUSTOMERNUMBER</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>
> <structure>
> <property name="position">6</property>
> <property name="name">ORDERNUMBER_6</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">ORDERDATE</property>
> <property name="dataType">date</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">REQUIREDDATE</property>
> <property name="dataType">date</property>
> </structure>
> <structure>
> <property name="position">9</property>
> <property name="name">SHIPPEDDATE</property>
> <property name="dataType">date</property>
> </structure>
> <structure>
> <property name="position">10</property>
> <property name="name">STATUS</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">11</property>
> <property name="name">COMMENTS</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">12</property>
> <property name="name">CUSTOMERNUMBER</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>
> <structure>
> <property name="position">6</property>
> <property name="name">ORDERNUMBER_6</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> <structure>
> <property name="position">7</property>
> <property name="name">ORDERDATE</property>
> <property name="nativeName">ORDERDATE</property>
> <property name="dataType">date</property>
> <property name="nativeDataType">91</property>
> </structure>
> <structure>
> <property name="position">8</property>
> <property name="name">REQUIREDDATE</property>
> <property name="nativeName">REQUIREDDATE</property>
> <property name="dataType">date</property>
> <property name="nativeDataType">91</property>
> </structure>
> <structure>
> <property name="position">9</property>
> <property name="name">SHIPPEDDATE</property>
> <property name="nativeName">SHIPPEDDATE</property>
> <property name="dataType">date</property>
> <property name="nativeDataType">91</property>
> </structure>
> <structure>
> <property name="position">10</property>
> <property name="name">STATUS</property>
> <property name="nativeName">STATUS</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">11</property>
> <property name="name">COMMENTS</property>
> <property name="nativeName">COMMENTS</property>
> <property name="dataType">string</property>
> <property name="nativeDataType">12</property>
> </structure>
> <structure>
> <property name="position">12</property>
> <property name="name">CUSTOMERNUMBER</property>
> <property name="nativeName">CUSTOMERNUMBER</property>
> <property name="dataType">integer</property>
> <property name="nativeDataType">4</property>
> </structure>
> </list-property>
> <property name="queryText">select *
> from CLASSICMODELS.ORDERDETAILS, CLASSICMODELS.ORDERS
> where CLASSICMODELS.ORDERS.ORDERNUMBER =
> CLASSICMODELS.ORDERDETAILS.ORDERNUMBER
> and
> CLASSICMODELS.ORDERS.STATUS = 'Shipped'</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:resultColumnDefinitions>
> <design:attributes>
> <design:name>ORDERNUMBER</design:name>
> <design:position>6</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>
>
Re: Crosstab issue - not to sort alphabetically [message #915867 is a reply to message #366503] Tue, 18 September 2012 05:42 Go to previous messageGo to next message
suyash patil is currently offline suyash patilFriend
Messages: 2
Registered: September 2012
Junior Member
Anthony/Jason,

I have been doing similar thing and but I didnt understand exactly by "adding a computed column to the dataset that indicates the
order and put it in the cube and use it to sort on."
Can please post any example rptdesign for doing so?

Regard,
Suyash Patil


Eclipse User wrote on Tue, 06 January 2009 14:23
Originally posted by: jasonweathersby.alltel.net

Anthony,

If you select the crosstab and then choose sorting you should be able to
enter an expression for the sort key. In your case you could enter:

if( data["yourcat"] == "One" ){
"A";
}
if( data["yourcat"] == "Two" ){
"B";
}
if( data["yourcat"] == "Three" ){
"C";
}

You could also add a computed column to the dataset that indicates the
order and put it in the cube and use it to sort on.

Jason

Anthony Ku Ong wrote:
> Hi,
>
> I'm using BIRT 2.3.1 and would like to know if there's a way
> to have the crosstab not sort alphabetically (when creating groups),
> but to take 'unsorted' result from the tabluar data?
>
> Say this is the raw tabular data:
>
> Category | Units | Category
> ----------|--------------|----------------------|----------- -
> Apples | XX One Bannanas | XX One
> Apples | XX Two
> Oranges | XX Two Bannanas | XX Two
> Apples | XX Three
> Oranges | XX Three Bannanas | XX Three
>
>
> If I create a cross-tab, i'll get something like this:
>
> -----------------------------------------------------
> Category | Apples | Oranges | Bannanas |
> -----------------------------------------------------
> | Three | XX | XX | XX |
> | Two | XX | XX | XX |
> | One | XX | XX | XX |
> -----------------------------------------------------
>
>
> For me this is out-of-order (Category) I want something like this:
> The raw data is already sorted, and I don't want to resort the fields
> alphabetically.
>
> -----------------------------------------------------
> | Apples | Oranges | Bannanas
> -----------------------------------------------------
> | One | XX | XX | XX |
> | Two | XX | XX | XX |
> | Three | XX | XX | XX |
> -----------------------------------------------------
>
> How can I do this? I know that I can tell a BIRT table that my data is
> already sorted when adding a group section using : <property
> name="sortByGroups">false</property>. Is there something similar I can
> do in the Crosstab?
>
> Thanks,
> Anthony
>
>
>
>

Re: Crosstab issue - not to sort alphabetically [message #916119 is a reply to message #915867] Tue, 18 September 2012 15:10 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This example uses an attribute:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1172-sorting-a-crosstab-by-a-field-not-in-the-crosstab/
The attribute could have been a computed column.

Jason
Previous Topic:PHP dumps JSON file for BIRT to read from
Next Topic:Embedded Images are not appearing in Web logic
Goto Forum:
  


Current Time: Fri Dec 06 01:25:17 GMT 2024

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

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

Back to the top