Changeset 3712 for sandbox

Show
Ignore:
Timestamp:
12/16/10 15:03:42 (17 months ago)
Author:
pmauduit
Message:

Pivot Table Block?

Trying to parse numbers and print it by default with one decimal. If
this number parsing fails, the cell content is considered as a String.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • sandbox/camptocamp/print-geobi/src/main/java/org/mapfish/print/config/layout/PivotTableBlock.java

    r3685 r3712  
    172172                        { 
    173173                                String curValue ; 
    174                                  
     174 
    175175                                try { 
    176                                         curValue = column.getString(dataIndexes.get(j)); 
     176                                        Float cellFloat = column.getFloat(dataIndexes.get(j)); 
     177                                        // one decimal by default 
     178                                        // TODO : this should be parameterized into the YAML 
     179                                        // configuration file. 
     180                                        curValue = String.format("%.1f", cellFloat); 
    177181                                } catch (Exception e) { 
    178                                         curValue = "";     // not found ? falling back to empty string value 
     182                                        try { 
     183                                                curValue = column.getString(dataIndexes.get(j)); 
     184                                        } catch (Exception e2) { 
     185                                                curValue = ""; // not found ? falling back to empty 
     186                                                                                // string value 
     187                                        } 
    179188                                } 
    180189                                 
     
    203212          } 
    204213      } 
    205        
     214      table.setSplitRows(false); 
    206215      table.setComplete(true); 
    207216      return table;