Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-report-engine-dev] the last column's values do not show up, the first column's values are replaced by 0, 1, 3, 4 .. is it a bug?

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--OFFICECODE--REPOR
TSTO--JOBTITLE--

0--1002--Murphy--Diane--x5800--dmurphy@xxxxxxxxxxxxxxxxxxxx--1--null--

1--1056--Patterson--Mary--x4611--mpatterso@xxxxxxxxxxxxxxxxxxxx--1--1002
--

2--1076--Firrelli--Jeff--x9273--jfirrelli@xxxxxxxxxxxxxxxxxxxx--1--1002-
-

3--1088--Patterson--William--x4871--wpatterson@xxxxxxxxxxxxxxxxxxxx--6--
056-

4--1102--Bondur--Gerard--x5408--gbondur@xxxxxxxxxxxxxxxxxxxx--4--1056--

5--1143--Bow--Anthony--x5428--abow@xxxxxxxxxxxxxxxxxxxx--1--1056--

6--1165--Jennings--Leslie--x3291--ljennings@xxxxxxxxxxxxxxxxxxxx--1--114
3--

7--1166--Thompson--Leslie--x4065--lthompson@xxxxxxxxxxxxxxxxxxxx--1--114
3--

8--1188--Firrelli--Julie--x2173--jfirrelli@xxxxxxxxxxxxxxxxxxxx--2--1143
--

9--1216--Patterson--Steve--x4334--spatterson@xxxxxxxxxxxxxxxxxxxx--2--11
43--
 

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( );
               }


Back to the top