← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8928: Improved excel meta data export

 

------------------------------------------------------------
revno: 8928
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-11-07 12:51:51 +0300
message:
  Improved excel meta data export
removed:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/ExtendedDataElementConverter.java
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/DataElementConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/IndicatorConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitHierarchyConverter.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/DataElementConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/DataElementConverter.java	2012-11-07 09:51:51 +0000
@@ -29,13 +29,6 @@
 
 import java.util.Collection;
 
-import jxl.format.Alignment;
-import jxl.format.Border;
-import jxl.format.BorderLineStyle;
-import jxl.format.Colour;
-import jxl.format.UnderlineStyle;
-import jxl.write.WritableCellFormat;
-import jxl.write.WritableFont;
 import jxl.write.WritableSheet;
 import jxl.write.WritableWorkbook;
 import jxl.write.WriteException;
@@ -82,22 +75,13 @@
 
         WritableSheet sheet = workbook.createSheet( i18n.getString( "data_elements" ), sheetIndex );
         
-        WritableCellFormat FORMAT_LABEL = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 13,
-            WritableFont.NO_BOLD, true, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-        
-        WritableCellFormat FORMAT_TEXT = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
-            WritableFont.NO_BOLD, false ) );
-        
         try
         {
-            setUpFormat( FORMAT_LABEL, Alignment.CENTRE, Border.ALL, BorderLineStyle.THIN, Colour.TAN );
-            setUpFormat( FORMAT_TEXT, Alignment.GENERAL, Border.ALL, BorderLineStyle.DOTTED, Colour.BLACK );
-            
-            printDataElementHeaders( sheet, FORMAT_LABEL, i18n, rowNumber++, columnIndex );
+            printDataElementHeaders( sheet, i18n, rowNumber++, columnIndex );
 
             for ( DataElement element : elements )
             {
-                addDataElementCellToSheet( sheet, FORMAT_TEXT, element, i18n, rowNumber++, columnIndex );
+                addDataElementCellToSheet( sheet, element, i18n, rowNumber++, columnIndex );
             }
         }
         catch ( RowsExceededException e1 )

=== removed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/ExtendedDataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/ExtendedDataElementConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/ExtendedDataElementConverter.java	1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
-package org.hisp.dhis.importexport.xls.converter;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Collection;
-
-import jxl.format.Alignment;
-import jxl.format.Border;
-import jxl.format.BorderLineStyle;
-import jxl.format.Colour;
-import jxl.format.UnderlineStyle;
-import jxl.write.WritableCellFormat;
-import jxl.write.WritableFont;
-import jxl.write.WritableSheet;
-import jxl.write.WritableWorkbook;
-import jxl.write.WriteException;
-import jxl.write.biff.RowsExceededException;
-
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.importexport.ExportParams;
-import org.hisp.dhis.importexport.XLSConverter;
-import org.hisp.dhis.system.util.ExcelUtils;
-
-/**
- * @author Dang Duy Hieu
- * @version $$
- */
-public class ExtendedDataElementConverter
-    extends ExcelUtils
-    implements XLSConverter
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private DataElementService dataElementService;
-
-    public ExtendedDataElementConverter( DataElementService dataElementService )
-    {
-        this.dataElementService = dataElementService;
-    }
-
-    // -------------------------------------------------------------------------
-    // PDFConverter implementation
-    // -------------------------------------------------------------------------
-
-    public void write( WritableWorkbook workbook, ExportParams params, int sheetIndex )
-    {
-        I18n i18n = params.getI18n();
-
-        int rowNumber = 0;
-        int columnIndex = 0;
-
-        WritableSheet sheet = workbook.createSheet( i18n.getString( "data_elements" ), sheetIndex );
-        
-        WritableCellFormat FORMAT_LABEL_MERGED = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 14,
-            WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-
-        WritableCellFormat FORMAT_LABEL = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 13,
-            WritableFont.NO_BOLD, true, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-
-        WritableCellFormat FORMAT_TEXT = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
-            WritableFont.NO_BOLD, false ) );
-
-        Collection<DataElement> elements = dataElementService.getDataElements( params.getDataElements() );
-
-        try
-        {            
-            setUpFormat( FORMAT_LABEL_MERGED, Alignment.JUSTIFY, Border.ALL, BorderLineStyle.THIN, Colour.BROWN );
-            setUpFormat( FORMAT_LABEL, Alignment.CENTRE, Border.ALL, BorderLineStyle.THIN, Colour.TAN );
-            setUpFormat( FORMAT_TEXT, Alignment.GENERAL, Border.ALL, BorderLineStyle.DOTTED, Colour.BLACK );
-            
-            printExtendedDataElementHeaders( sheet, FORMAT_LABEL_MERGED, FORMAT_LABEL, i18n, rowNumber++, columnIndex );
-
-            rowNumber++;
-
-            for ( DataElement element : elements )
-            {
-                addExtendedDataElementCellToSheet( sheet, FORMAT_TEXT, element, i18n, rowNumber++, columnIndex );
-            }
-        }
-        catch ( RowsExceededException e )
-        {
-            e.printStackTrace();
-        }
-        catch ( WriteException e )
-        {
-            e.printStackTrace();
-        }
-    }
-}

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/IndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/IndicatorConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/IndicatorConverter.java	2012-11-07 09:51:51 +0000
@@ -29,13 +29,6 @@
 
 import java.util.Collection;
 
-import jxl.format.Alignment;
-import jxl.format.Border;
-import jxl.format.BorderLineStyle;
-import jxl.format.Colour;
-import jxl.format.UnderlineStyle;
-import jxl.write.WritableCellFormat;
-import jxl.write.WritableFont;
 import jxl.write.WritableSheet;
 import jxl.write.WritableWorkbook;
 import jxl.write.WriteException;
@@ -84,24 +77,15 @@
 
         WritableSheet sheet = workbook.createSheet( i18n.getString( "indicators" ), sheetIndex );
 
-        WritableCellFormat FORMAT_LABEL = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 13,
-            WritableFont.NO_BOLD, true, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-
-        WritableCellFormat FORMAT_TEXT = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
-            WritableFont.NO_BOLD, false ) );
-        
         Collection<Indicator> indicators = indicatorService.getIndicators( params.getIndicators() );
         
         try
         {
-            setUpFormat( FORMAT_LABEL, Alignment.CENTRE, Border.ALL, BorderLineStyle.THIN, Colour.TAN );
-            setUpFormat( FORMAT_TEXT, Alignment.GENERAL, Border.ALL, BorderLineStyle.DOTTED, Colour.BLACK );
-            
-            printIndicatorHeaders( sheet, FORMAT_LABEL, i18n, rowNumber++, columnIndex );
+            printIndicatorHeaders( sheet, i18n, rowNumber++, columnIndex );
 
             for ( Indicator indicator : indicators )
             {
-                addIndicatorCellToSheet( sheet, FORMAT_TEXT, indicator, i18n, expressionService, rowNumber++,
+                addIndicatorCellToSheet( sheet, indicator, i18n, expressionService, rowNumber++,
                     columnIndex );
             }
         }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitConverter.java	2012-11-07 09:51:51 +0000
@@ -29,13 +29,6 @@
 
 import java.util.Collection;
 
-import jxl.format.Alignment;
-import jxl.format.Border;
-import jxl.format.BorderLineStyle;
-import jxl.format.Colour;
-import jxl.format.UnderlineStyle;
-import jxl.write.WritableCellFormat;
-import jxl.write.WritableFont;
 import jxl.write.WritableSheet;
 import jxl.write.WritableWorkbook;
 import jxl.write.WriteException;
@@ -82,25 +75,16 @@
 
         WritableSheet sheet = workbook.createSheet( i18n.getString( "organisation_units" ), sheetIndex );
 
-        WritableCellFormat FORMAT_LABEL = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 13,
-            WritableFont.NO_BOLD, true, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-
-        WritableCellFormat FORMAT_TEXT = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
-            WritableFont.NO_BOLD, false ) );
-
         Collection<OrganisationUnit> units = organisationUnitService.getOrganisationUnits( params
             .getOrganisationUnits() );
 
         try
         {
-            setUpFormat( FORMAT_LABEL, Alignment.CENTRE, Border.ALL, BorderLineStyle.THIN, Colour.TAN );
-            setUpFormat( FORMAT_TEXT, Alignment.GENERAL, Border.ALL, BorderLineStyle.DOTTED, Colour.BLACK );
-            
-            printOrganisationUnitHeaders( sheet, FORMAT_LABEL, i18n, rowNumber++, columnIndex );
+            printOrganisationUnitHeaders( sheet, i18n, rowNumber++, columnIndex );
 
             for ( OrganisationUnit unit : units )
             {
-                addOrganisationUnitCellToSheet( sheet, FORMAT_TEXT, unit, i18n, format, rowNumber++, columnIndex );
+                addOrganisationUnitCellToSheet( sheet, unit, i18n, format, rowNumber++, columnIndex );
             }
         }
         catch ( RowsExceededException e )

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitHierarchyConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitHierarchyConverter.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/xls/converter/OrganisationUnitHierarchyConverter.java	2012-11-07 09:51:51 +0000
@@ -30,13 +30,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
-import jxl.format.Alignment;
-import jxl.format.Border;
-import jxl.format.BorderLineStyle;
-import jxl.format.Colour;
-import jxl.format.UnderlineStyle;
-import jxl.write.WritableCellFormat;
-import jxl.write.WritableFont;
 import jxl.write.WritableSheet;
 import jxl.write.WritableWorkbook;
 import jxl.write.WriteException;
@@ -81,22 +74,9 @@
 
         WritableSheet sheet = workbook.createSheet( i18n.getString( "organisation_unit_hierarchy" ), sheetIndex );
 
-        WritableCellFormat FORMAT_LABEL_MERGED = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 14,
-            WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-
-        WritableCellFormat FORMAT_LABEL = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 13,
-            WritableFont.NO_BOLD, true, UnderlineStyle.NO_UNDERLINE, Colour.WHITE ) );
-
-        WritableCellFormat FORMAT_TEXT = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
-            WritableFont.NO_BOLD, false ) );
-
         try
         {
-            setUpFormat( FORMAT_LABEL_MERGED, Alignment.CENTRE, Border.ALL, BorderLineStyle.THIN, Colour.BROWN );
-            setUpFormat( FORMAT_LABEL, Alignment.CENTRE, Border.ALL, BorderLineStyle.THIN, Colour.TAN );
-            setUpFormat( FORMAT_TEXT, Alignment.GENERAL, Border.ALL, BorderLineStyle.DOTTED, Colour.BLACK );
-            
-            printOrganisationUnitHierarchyHeaders( sheet, FORMAT_LABEL_MERGED, FORMAT_LABEL, i18n,
+            printOrganisationUnitHierarchyHeaders( sheet, i18n,
                 rowNumber++, columnIndex, organisationUnitService.getNumberOfOrganisationalLevels() );
 
             rowNumber++;
@@ -105,7 +85,7 @@
 
             for ( OrganisationUnit unit : hierarchy )
             {
-                addOrganisationUnitHierarchyCellToSheet( sheet, FORMAT_TEXT, unit, i18n, rowNumber++, unit.getLevel()-1 );
+                addOrganisationUnitHierarchyCellToSheet( sheet, unit, i18n, rowNumber++, unit.getLevel()-1 );
             }
         }
         catch ( RowsExceededException e )

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java	2012-10-18 13:04:28 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ExcelUtils.java	2012-11-07 09:51:51 +0000
@@ -36,9 +36,6 @@
 
 import jxl.Workbook;
 import jxl.WorkbookSettings;
-import jxl.format.Alignment;
-import jxl.format.Border;
-import jxl.format.BorderLineStyle;
 import jxl.format.Colour;
 import jxl.format.UnderlineStyle;
 import jxl.write.Label;
@@ -69,204 +66,117 @@
 {
     public static final String EXTENSION_XLS = ".xls";
 
-    // -------------------------------------------------------------------------
-    //
-    // -------------------------------------------------------------------------
-
-    public static void setUpFormat( WritableCellFormat cellFormat, Alignment alignment, Border border,
-        BorderLineStyle borderLineStyle, Colour colour )
-        throws WriteException
-    {
-        cellFormat.setAlignment( alignment );
-        cellFormat.setBackground( colour );
-        cellFormat.setBorder( border, borderLineStyle );
-    }
-
-    public static void printDataElementHeaders( WritableSheet sheet, WritableCellFormat format, I18n i18n, int row,
+    public static WritableCellFormat FORMAT_LABEL = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 13,
+        WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK ) );
+    
+    public static WritableCellFormat FORMAT_TEXT = new WritableCellFormat( new WritableFont( WritableFont.ARIAL, 11,
+        WritableFont.NO_BOLD, false ) );
+    
+    public static void printDataElementHeaders( WritableSheet sheet, I18n i18n, int row,
         int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column++, row, i18n.getString( "name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "alternative_name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "short_name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "code" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "description" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "active" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "type" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "aggregation_operator" ), format ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "name" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "short_name" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "code" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "description" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "active" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "type" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "aggregation_operator" ), FORMAT_LABEL ) );
     }
 
-    public static void addDataElementCellToSheet( WritableSheet sheet, WritableCellFormat format, DataElement element,
+    public static void addDataElementCellToSheet( WritableSheet sheet, DataElement element,
         I18n i18n, int row, int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column++, row, element.getName(), format ) );
-        sheet.addCell( new Label( column++, row, element.getShortName(), format ) );
-        sheet.addCell( new Label( column++, row, element.getCode(), format ) );
-        sheet.addCell( new Label( column++, row, element.getDescription(), format ) );
-        sheet.addCell( new Label( column++, row, getBoolean().get( element.isActive() ), format ) );
-        sheet.addCell( new Label( column++, row, getType().get( element.getType() ), format ) );
+        sheet.addCell( new Label( column++, row, element.getName(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, element.getShortName(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, element.getCode(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, element.getDescription(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, getBoolean().get( element.isActive() ), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, getType().get( element.getType() ), FORMAT_TEXT ) );
         sheet.addCell( new Label( column++, row, getAggregationOperator().get( element.getAggregationOperator() ),
-            format ) );
+            FORMAT_TEXT ) );
     }
 
-    public static void printIndicatorHeaders( WritableSheet sheet, WritableCellFormat format, I18n i18n, int row,
+    public static void printIndicatorHeaders( WritableSheet sheet, I18n i18n, int row,
         int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column++, row, i18n.getString( "name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "alternative_name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "short_name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "code" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "description" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "annualized" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "indicator_type" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "numerator_description" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "numerator_formula" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "denominator_description" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "denominator_formula" ), format ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "name" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "short_name" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "code" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "description" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "annualized" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "indicator_type" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "numerator_description" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "numerator_formula" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "denominator_description" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "denominator_formula" ), FORMAT_LABEL ) );
 
     }
 
-    public static void addIndicatorCellToSheet( WritableSheet sheet, WritableCellFormat format, Indicator indicator,
+    public static void addIndicatorCellToSheet( WritableSheet sheet, Indicator indicator,
         I18n i18n, ExpressionService expressionService, int row, int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column++, row, indicator.getName(), format ) );
-        sheet.addCell( new Label( column++, row, indicator.getShortName(), format ) );
-        sheet.addCell( new Label( column++, row, indicator.getCode(), format ) );
-        sheet.addCell( new Label( column++, row, indicator.getDescription(), format ) );
-        sheet.addCell( new Label( column++, row, getBoolean().get( indicator.isAnnualized() ), format ) );
-        sheet.addCell( new Label( column++, row, getType().get( indicator.getIndicatorType().getName() ), format ) );
-        sheet.addCell( new Label( column++, row, indicator.getNumeratorDescription(), format ) );
-        sheet.addCell( new Label( column++, row, expressionService.getExpressionDescription( indicator.getNumerator() ), format ) );
-        sheet.addCell( new Label( column++, row, indicator.getDenominatorDescription(), format ) );
-        sheet.addCell( new Label( column++, row, expressionService.getExpressionDescription( indicator.getDenominator() ), format ) );
-    }
-
-    public static void printExtendedDataElementHeaders( WritableSheet sheet, WritableCellFormat format1,
-        WritableCellFormat format2, I18n i18n, int row, int column )
-        throws RowsExceededException, WriteException
-    {
-        sheet.addCell( new Label( column, row, i18n.getString( "identifying_and_definitional_attributes" ), format1 ) );
-        sheet.mergeCells( column, row, 16, row );
-
-        column = 17;
-        sheet
-            .addCell( new Label( column, row, i18n.getString( "relational_and_representational_attributes" ), format1 ) );
-        sheet.mergeCells( column, row, 26, row );
-
-        column = 27;
-        sheet.addCell( new Label( column, row, i18n.getString( "administrative_attributes" ), format1 ) );
-        sheet.mergeCells( 27, row, 39, row );
-
-        // row = 2 & column = 1->8
-        row++;
-        column = 1;
-        printDataElementHeaders( sheet, format2, i18n, row, column );
-
-        // row = 2 & column = 9->16
-        column = 9;
-        sheet.addCell( new Label( column++, row, i18n.getString( "mnemonic" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "version" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "context" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "synonyms" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "hononyms" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "keywords" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "status" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "status_date" ), format2 ) );
-
-        // -------------------------------------------------------------------------
-        // Relational and representational attributes
-        // -------------------------------------------------------------------------
-
-        // row = 2 & column = 17->26
-        sheet.addCell( new Label( column++, row, i18n.getString( "data_type" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "representational_form" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "representational_layout" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "minimum_size" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "maximum_size" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "data_domain" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "validation_rules" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "related_data_references" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "guide_for_use" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "collection_methods" ), format2 ) );
-
-        // -------------------------------------------------------------------------
-        // Administrative attributes
-        // -------------------------------------------------------------------------
-
-        // row = 2 & column = 27->36
-        sheet.addCell( new Label( column++, row, i18n.getString( "responsible_authority" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "update_rules" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "access_authority" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "update_frequency" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "location" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "reporting_methods" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "version_status" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "previous_version_references" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "source_document" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "source_organisation" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "comment" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "saved" ), format2 ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "last_updated" ), format2 ) );
-    }
-
-    public static void addExtendedDataElementCellToSheet( WritableSheet sheet, WritableCellFormat format,
-        DataElement element, I18n i18n, int row, int column )
-        throws RowsExceededException, WriteException
-    {
-        // row = 3 & column = 1->8
-        addDataElementCellToSheet( sheet, format, element, i18n, row, column );
-    }
-
-    public static void printOrganisationUnitHeaders( WritableSheet sheet, WritableCellFormat format, I18n i18n,
+        sheet.addCell( new Label( column++, row, indicator.getName(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, indicator.getShortName(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, indicator.getCode(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, indicator.getDescription(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, getBoolean().get( indicator.isAnnualized() ), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, getType().get( indicator.getIndicatorType().getName() ), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, indicator.getNumeratorDescription(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, expressionService.getExpressionDescription( indicator.getNumerator() ), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, indicator.getDenominatorDescription(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, expressionService.getExpressionDescription( indicator.getDenominator() ), FORMAT_TEXT ) );
+    }
+
+    public static void printOrganisationUnitHeaders( WritableSheet sheet, I18n i18n,
         int row, int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column++, row, i18n.getString( "short_name" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "code" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "opening_date" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "closed_date" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "active" ), format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( "comment" ), format ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "short_name" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "code" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "opening_date" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "closed_date" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "active" ), FORMAT_LABEL ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( "comment" ), FORMAT_LABEL ) );
 
     }
 
-    public static void addOrganisationUnitCellToSheet( WritableSheet sheet, WritableCellFormat format,
+    public static void addOrganisationUnitCellToSheet( WritableSheet sheet, 
         OrganisationUnit unit, I18n i18n, I18nFormat i18nFormat, int row, int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column++, row, unit.getShortName(), format ) );
-        sheet.addCell( new Label( column++, row, unit.getCode(), format ) );
-        sheet.addCell( new Label( column++, row, unit.getOpeningDate() != null ? i18nFormat.formatDate( unit
-            .getOpeningDate() ) : "", format ) );
-        sheet.addCell( new Label( column++, row, unit.getClosedDate() != null ? i18nFormat.formatDate( unit
-            .getClosedDate() ) : "", format ) );
-        sheet.addCell( new Label( column++, row, i18n.getString( getBoolean().get( unit.isActive() ) ), format ) );
-        sheet.addCell( new Label( column++, row, unit.getComment(), format ) );
+        sheet.addCell( new Label( column++, row, unit.getShortName(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, unit.getCode(), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, unit.getOpeningDate() != null ? i18nFormat.formatDate( unit.getOpeningDate() ) : "", FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, unit.getClosedDate() != null ? i18nFormat.formatDate( unit.getClosedDate() ) : "", FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, i18n.getString( getBoolean().get( unit.isActive() ) ), FORMAT_TEXT ) );
+        sheet.addCell( new Label( column++, row, unit.getComment(), FORMAT_TEXT ) );
     }
 
-    public static void printOrganisationUnitHierarchyHeaders( WritableSheet sheet, WritableCellFormat format1,
-        WritableCellFormat format2, I18n i18n, int row, int column, int level )
+    public static void printOrganisationUnitHierarchyHeaders( WritableSheet sheet,
+        I18n i18n, int row, int column, int level )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column, row, i18n.getString( "organisation_unit_level" ), format1 ) );
+        sheet.addCell( new Label( column, row, i18n.getString( "organisation_unit_level" ), FORMAT_LABEL ) );
         sheet.mergeCells( column, row, level - 1, row );
 
         row++;
 
         for ( int i = 1; i <= level; i++ )
         {
-            sheet.addCell( new Label( column++, row, (i + ""), format2 ) );
+            sheet.addCell( new Label( column++, row, (i + ""), FORMAT_TEXT ) );
         }
     }
 
-    public static void addOrganisationUnitHierarchyCellToSheet( WritableSheet sheet, WritableCellFormat format,
+    public static void addOrganisationUnitHierarchyCellToSheet( WritableSheet sheet,
         OrganisationUnit unit, I18n i18n, int row, int column )
         throws RowsExceededException, WriteException
     {
-        sheet.addCell( new Label( column, row, unit.getName(), format ) );
+        sheet.addCell( new Label( column, row, unit.getName(), FORMAT_TEXT ) );
     }
 
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm	2012-10-16 15:30:28 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/profile.vm	2012-11-07 09:51:51 +0000
@@ -34,7 +34,7 @@
 <div class="userRow"><div class="userLabel">$i18n.getString( "email" )</div><div class="userValue">$!encoder.htmlEncode( $user.email )</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "phone_number" )</div><div class="userValue">$!encoder.htmlEncode( $user.phoneNumber )</div></div>
 <div class="userRow"><div class="userLabel">$i18n.getString( "org_units" )</div><div class="userValue">$!encoder.htmlEncode( $user.getOrganisationUnitsName() )</div></div>
-<div class="userRow"><div class="userLabel">$i18n.getString( "user_roles" )</div><div class="userValue">$!encoder.htmlEncode( $user.getOrganisationUnitsName() )</div></div>
+<div class="userRow"><div class="userLabel">$i18n.getString( "user_roles" )</div><div class="userValue">$!encoder.htmlEncode( $user.userCredentials.getUserAuthorityGroupsName() )</div></div>
 </div>
 <div id="userInfoLink"><a class="bold" href="javascript:showFullProfile()">$i18n.getString( "view_full_profile" )</a></div>