Home » Archived » BIRT » the last column's values do not show up,the first column's values are replaced by 0, 1, 3, 4 .. is i
the last column's values do not show up,the first column's values are replaced by 0, 1, 3, 4 .. is i [message #156952] |
Thu, 27 April 2006 18:38 |
Eclipse User |
|
|
|
Originally posted by: chaohua.wang.premierata.com
Hi, Folks,
I use IDataPreviewTask to preview a data set.
But the last column's value does not show up, the first column's values are
replaced by 0,1,3,4..
This is an Employee table
EMPLOYEENUMBER should be 1002, 1056... but is replace by 0,1, 2,3.
The JobTitle's values are gone. I don't what is wrong
Please help,
Chaohua
Please see the result.
-------------
EMPLOYEENUMBER--LASTNAME--FIRSTNAME--EXTENSION--EMAIL--OFFIC ECODE--REPORTSTO--JOBTITLE--
0--1002--Murphy--Diane--x5800--dmurphy@classicmodelcars.com--1--null--
1--1056--Patterson--Mary--x4611--mpatterso@classicmodelcars.com--1--1002--
2--1076--Firrelli--Jeff--x9273--jfirrelli@classicmodelcars.com--1--1002--
3--1088--Patterson--William--x4871--wpatterson@classicmodelcars.com--6--1056--
4--1102--Bondur--Gerard--x5408--gbondur@classicmodelcars.com--4--1056--
5--1143--Bow--Anthony--x5428--abow@classicmodelcars.com--1--1056--
6--1165--Jennings--Leslie--x3291--ljennings@classicmodelcars.com--1--1143--
7--1166--Thompson--Leslie--x4065--lthompson@classicmodelcars.com--1--1143--
8--1188--Firrelli--Julie--x2173--jfirrelli@classicmodelcars.com--2--1143--
9--1216--Patterson--Steve--x4334--spatterson@classicmodelcars.com--2--1143--
The following is my code:
try{
//Open a report design
IReportRunnable design =
reportEngine.openReportDesign(designFile);
//Create Data Preview task
IDataPreviewTask task =
reportEngine.createDataPreviewTask(design);
//Execute Data Set, returning only 10 rows. Set binding map
to null (We have no data set parameters)
// IQueryResults actualResultSet =
task.executeDataSet("parcelCount", 1, null);
IQueryResults actualResultSet =
task.executeDataSet("Employes", 10, null);
if ( actualResultSet != null )
{
//Iterate through results
Collection col =
actualResultSet.getPreparedQuery( ).getReportQueryDefn( ).getRowExpressions(
);
IBaseExpression[] expressions =
(IBaseExpression[])col.toArray( new IBaseExpression[col.size()]);
IResultIterator iter =
actualResultSet.getResultIterator( );
int columnCount = expressions.length;
for ( int n = 0; n < columnCount; n++ )
{
System.out.print(
actualResultSet.getResultMetaData().getColumnName(n+1) + "--" );
}
System.out.println("");
while ( iter.next( ) )
{
for ( int n = 0 ; n < columnCount; n++ )
{
System.out.print(
iter.getString( expressions[n] )+ "--" );
}
System.out.println("");
}
actualResultSet.close( );
}
} catch ( BirtException ex ){
ex.printStackTrace( );
}
-
|
|
|
Goto Forum:
Current Time: Mon May 05 03:37:56 EDT 2025
Powered by FUDForum. Page generated in 0.02614 seconds
|