Package org.openoffice.odf.doc.element.table

Examples of org.openoffice.odf.doc.element.table.OdfTableRow


            Element officeSpreadsheet = ( Element ) contentDoc.getElementsByTagNameNS( OdfNamespace.OFFICE.getUri(),
                "spreadsheet" ).item( 0 );
            officeSpreadsheet.appendChild( table );

            // header
            OdfTableRow headerRow = new OdfTableRow( contentDoc );
            table.appendChild( headerRow );
            LinkedHashMap<String, Short> attributeNameMap = new LinkedHashMap<String, Short>();
            if ( this.exportDn )
            {
                short cellNum = ( short ) 0;
                //attributeNameMap.put( "dn", new Short( cellNum ) ); //$NON-NLS-1$
                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( "dn" ); //$NON-NLS-1$
                headerRow.appendCell( cell );
            }

            // max export
            if ( searchParameter.getCountLimit() < 1 || searchParameter.getCountLimit() > MAX_COUNT_LIMIT )
            {
View Full Code Here


        // group multi-valued attributes
        Map<String, String> attributeMap = ExportCsvJob.getAttributeMap( null, record, valueDelimiter, "UTF-16",
            binaryEncoding );

        // output attributes
        OdfTableRow row = new OdfTableRow( contentDoc );
        table.appendChild( row );

        if ( exportDn )
        {
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( record.getDnLine().getValueAsString() );
            row.appendCell( cell );

        }
        for ( String attributeName : attributeMap.keySet() )
        {
            if ( !headerRowAttributeNameMap.containsKey( attributeName ) )
            {
                short cellNum = ( short ) headerRowAttributeNameMap.size();
                headerRowAttributeNameMap.put( attributeName, new Short( cellNum ) );

                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( attributeName );
                headerRow.appendCell( cell );
            }

        }
        for ( String attributeName : headerRowAttributeNameMap.keySet() )
        {
            String value = attributeMap.get( attributeName );
            if ( value == null )
            {
                value = "";
            }
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( value );
            row.appendCell( cell );
        }
    }
View Full Code Here

            Element officeSpreadsheet = ( Element ) contentDoc.getElementsByTagNameNS( OdfNamespace.OFFICE.getUri(),
                "spreadsheet" ).item( 0 ); //$NON-NLS-1$
            officeSpreadsheet.appendChild( table );

            // header
            OdfTableRow headerRow = new OdfTableRow( contentDoc );
            table.appendChild( headerRow );
            LinkedHashMap<String, Short> attributeNameMap = new LinkedHashMap<String, Short>();
            if ( this.exportDn )
            {
                //                short cellNum = ( short ) 0;
                //attributeNameMap.put( "dn", new Short( cellNum ) ); //$NON-NLS-1$
                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( "dn" ); //$NON-NLS-1$
                headerRow.appendCell( cell );
            }

            // max export
            if ( searchParameter.getCountLimit() < 1 || searchParameter.getCountLimit() > MAX_COUNT_LIMIT )
            {
View Full Code Here

        // group multi-valued attributes
        Map<String, String> attributeMap = ExportCsvRunnable.getAttributeMap( null, record, valueDelimiter, "UTF-16", //$NON-NLS-1$
            binaryEncoding );

        // output attributes
        OdfTableRow row = new OdfTableRow( contentDoc );
        table.appendChild( row );

        if ( exportDn )
        {
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( record.getDnLine().getValueAsString() );
            row.appendCell( cell );

        }
        for ( String attributeName : attributeMap.keySet() )
        {
            if ( !headerRowAttributeNameMap.containsKey( attributeName ) )
            {
                short cellNum = ( short ) headerRowAttributeNameMap.size();
                headerRowAttributeNameMap.put( attributeName, new Short( cellNum ) );

                OdfTableCell cell = new OdfTableCell( contentDoc );
                cell.setValueType( OdfValueType.STRING );
                cell.setStringValue( attributeName );
                headerRow.appendCell( cell );
            }

        }
        for ( String attributeName : headerRowAttributeNameMap.keySet() )
        {
            String value = attributeMap.get( attributeName );
            if ( value == null )
            {
                value = ""; //$NON-NLS-1$
            }
            OdfTableCell cell = new OdfTableCell( contentDoc );
            cell.setValueType( OdfValueType.STRING );
            cell.setStringValue( value );
            row.appendCell( cell );
        }
    }
View Full Code Here

TOP

Related Classes of org.openoffice.odf.doc.element.table.OdfTableRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.