Package com.sun.star.table

Examples of com.sun.star.table.XCellRange


        CellRangeAddress oldCRA = (CellRangeAddress)
                                    tEnv.getObjRelation("DATAAREA");
        if (oldCRA == null) throw new StatusException(Status.failed
            ("Relation 'DATAAREA' not found"));

        XCellRange cr = oObj.getReferredCells();
        log.println(cr.toString());

        if (cr == null) {
            log.println("getReferredCells returned NULL.");
            tRes.tested("getReferredCells()", false);
            return;
View Full Code Here


        // creation of testobject here
        XSpreadsheets oSheets = (XSpreadsheets)xSheetDoc.getSheets();
        XIndexAccess oIndexAccess = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
        XCellRange oSheet = null;
        try {
            oSheet = (XCellRange) AnyConverter.toObject(
                    new Type(XCellRange.class),oIndexAccess.getByIndex(0));

            XCell oCell_1 = (XCell)oSheet.getCellByPosition(0, 0);
            XTextRange oTextRange = (XTextRange)
                UnoRuntime.queryInterface(XTextRange.class, oCell_1);
            oTextRange.setString("Test string 1");

            XCell oCell_2 = (XCell)oSheet.getCellByPosition(5, 1);
            oCell_2.setValue(15);

            XCell oCell_3 = (XCell)oSheet.getCellByPosition(3, 9);
            oTextRange = (XTextRange)
                UnoRuntime.queryInterface(XTextRange.class, oCell_3);
            oTextRange.setString("test 2");
            cellArr[0] = oCell_1;
            cellArr[1] = oCell_2;
View Full Code Here

    {
        final XCell cellA1 = getCellA1();
        cellA1.setValue( INIT_VALUE );
        assertEquals( "initializing the cell value didn't work", cellA1.getValue(), INIT_VALUE, 0 );

        XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
            ((SpreadsheetDocument)m_document).getSheet(0) );

        for ( int i=0; i<12; ++i )
        {
            XCell cell = range.getCellByPosition( 1, i );
            cell.setFormula( "" );
        }
    }
View Full Code Here

    public void verifyInitialDocumentState() throws com.sun.star.uno.Exception
    {
        final XCell cellA1 = getCellA1();
        assertEquals( "cell A1 doesn't have its initial value", INIT_VALUE, cellA1.getValue(), 0 );

        XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
            ((SpreadsheetDocument)m_document).getSheet(0) );
        for ( int i=0; i<12; ++i )
        {
            final XCell cell = range.getCellByPosition( 1, i );
            assertEquals( "Cell B" + (i+1) + " not having its initial value (an empty string)", "", cell.getFormula() );
        }
    }
View Full Code Here

        assertEquals( "cell A1 doesn't have the value which we gave it", MODIFIED_VALUE, cellA1.getValue(), 0 );
    }

    public int doMultipleModifications() throws com.sun.star.uno.Exception
    {
        XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
            ((SpreadsheetDocument)m_document).getSheet(0) );

        final String[] months = new String[] {
            "January", "February", "March", "April", "May", "June", "July", "August",
            "September", "October", "November", "December" };
        for ( int i=0; i<12; ++i )
        {
            final XCell cell = range.getCellByPosition( 1, i );
            cell.setFormula( months[i] );
        }
        return 12;
    }
View Full Code Here

        return 12;
    }

    private XCell getCellA1() throws com.sun.star.uno.Exception
    {
        XCellRange range = UnoRuntime.queryInterface( XCellRange.class,
            ((SpreadsheetDocument)m_document).getSheet(0) );
        return range.getCellByPosition( 0, 0 );
    }
View Full Code Here

                                                         xSheets.getElementNames()[0]));
            m_aLog.log("Fill two cells with value and formula.");
            xSheet.getCellByPosition(0, 0).setValue(1);
            xSheet.getCellByPosition(0, 1).setFormula("=a1+1");
            m_aLog.log("Retrieve big range.");
            XCellRange           xRange      = xSheet.getCellRangeByName("A1:Z9999");
            XCellSeries          xSeries     = UnoRuntime.queryInterface(XCellSeries.class, xRange);
            m_aLog.log("Duplicate cells from top to bottom inside range.");
            xSeries.fillAuto(FillDirection.TO_BOTTOM, 2);
            m_aLog.log("Duplicate cells from left to right inside range.");
            xSeries.fillAuto(FillDirection.TO_RIGHT , 1);
View Full Code Here

            XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
                             new Type(XSpreadsheet.class),
                             oSpreadsheets.getByName(
                                     oSpreadsheets.getElementNames()[0]));

            XCellRange testRange = oSheet.getCellRangeByName("$A$1:$D$4");

            XSheetCellRange testSheetRange = (XSheetCellRange) UnoRuntime.queryInterface(
                                                     XSheetCellRange.class,
                                                     testRange);
            oSheet.getCellByPosition(1, 1).setValue(1);
View Full Code Here

            for (int i=0; i<rangeLengthY; i++) {
                for (int j=0; j<rangeLengthX; j++) {
                    newData[i][j] = new Double(10*i +j);
                }
            }
            XCellRange xRange = null;
            try {
                xRange = xSheet.getCellRangeByPosition(startCellX, startCellY,
                                    startCellX+rangeLengthX-1, startCellY+rangeLengthY-1);
            } catch ( IndexOutOfBoundsException e){
                    throw new Exception(
View Full Code Here

        // and also put the list selection index into cell B2
        implBind( listBox, document.createListIndexBinding( sheet, exchangeColumn, exchangeRow ) );

        // ----------------------------------------------------------------------
        // fill the cells which we just bound the listbox to
        XCellRange exchangeSheet = document.getSheet( listSourceSheet );
        String[] listContent = new String[] { "first", "second", "third", "forth", "fivth" };
        for ( short row = topRow; row <= bottomRow; ++row )
        {
            XTextRange cellText = (XTextRange)UnoRuntime.queryInterface(
                XTextRange.class, exchangeSheet.getCellByPosition( column, row ) );
            cellText.setString( listContent[row] );
        }

        // some coloring
        XPropertySet exchangeCell = UNO.queryPropertySet(
View Full Code Here

TOP

Related Classes of com.sun.star.table.XCellRange

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.