Examples of XCell


Examples of com.sun.star.table.XCell

    * a double-value in the cell else it inserts a formula in the cell
    */
    public static void insertIntoCell(
        int CellX, int CellY, String theValue, XSpreadsheet TT1, String flag) {

        XCell oCell = null;

        try {
            oCell = TT1.getCellByPosition(CellX, CellY);
        } catch (com.sun.star.lang.IndexOutOfBoundsException ex) {
            System.out.println("Could not get Cell");
        }
        if (flag.equals("V")) {oCell.setValue((new Float(theValue)).floatValue());}
                   else {oCell.setFormula(theValue);}

    } // end of insertIntoCell
View Full Code Here

Examples of com.sun.star.table.XCell

        return re;
    }

    private XCell getCell(int x, int y, XSpreadsheet xSpreadsheet) {
        XCell re = null;

        try {
            re = xSpreadsheet.getCellByPosition(x, y);
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("Couldn't get word");
View Full Code Here

Examples of com.sun.star.table.XCell

    * @see com.sun.star.text.XText
    */
    protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) {

        XInterface oObj = null;
        XCell aCell = null;

        // creation of testobject here
        // first we write what we are intend to do to log file
        log.println( "Creating a test environment" );

View Full Code Here

Examples of com.sun.star.table.XCell

            XSpreadsheets xSpreadsheets = xSpreadsheetDoc.getSheets();
            XIndexAccess xSheetsIndexArray = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, xSpreadsheets);
            XSpreadsheet xSheet = (XSpreadsheet) AnyConverter.toObject(
                new Type(XSpreadsheet.class),xSheetsIndexArray.getByIndex(0));
            XCell xCell = xSheet.getCellByPosition(0, 0);
            xCell.setFormula(CELL_TEXT);
           
            log.println("fill sheet 1 with contnet...");
            util.CalcTools.fillCalcSheetWithContent(xSheetDoc, 1, 1, 1, 5, 5);

        } catch (com.sun.star.uno.Exception e) {
View Full Code Here

Examples of com.sun.star.table.XCell

        TestParameters Param, PrintWriter log) {

        XInterface oObj = null;

        // inserting some content to have non-empty page preview
        XCell xCell = null;
        try {
            XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
            XIndexAccess oIndexSheets = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
            XSpreadsheet oSheet = null;
            try {
                oSheet = (XSpreadsheet) AnyConverter.toObject(
                        new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));
            } catch (com.sun.star.lang.IllegalArgumentException iae) {
                throw new StatusException("couldn't get sheet",iae);
            }
            xCell = oSheet.getCellByPosition(0, 0) ;
            xCell.setFormula("ScAccessiblePageHeader");
        } catch(com.sun.star.lang.WrappedTargetException e) {
            log.println("Exception ceating relation :");
            e.printStackTrace(log);
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("Exception ceating relation :");
View Full Code Here

Examples of com.sun.star.table.XCell

        }

        XInterface oObj = null;

        // inserting some content to have non-empty page preview
        XCell xCell = null;
        try {
            XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
            XIndexAccess oIndexSheets = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
            Object o = oIndexSheets.getByIndex(0);
            XSpreadsheet oSheet = (XSpreadsheet)AnyConverter.toObject(
                            new com.sun.star.uno.Type(XSpreadsheet.class), o);
            xCell = oSheet.getCellByPosition(0, 0) ;
            xCell.setFormula("ScAccessiblePageHeader");

            xCell = oSheet.getCellByPosition(0, 1) ;
            xCell.setFormula("Cell 1");
            xCell = oSheet.getCellByPosition(0, 2) ;
            xCell.setFormula("Cell 2");
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            log.println("Exception ceating relation :");
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e) {
            log.println("Exception ceating relation :");
View Full Code Here

Examples of com.sun.star.table.XCell

        }

        XInterface oObj = null;

        // inserting some content to have non-empty page preview
        XCell xCell = null;
        try {
            XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
            XIndexAccess oIndexSheets = (XIndexAccess)
                UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
            Object o = oIndexSheets.getByIndex(0);
            XSpreadsheet oSheet = (XSpreadsheet)AnyConverter.toObject(
                            new com.sun.star.uno.Type(XSpreadsheet.class), o);
            xCell = oSheet.getCellByPosition(0, 0) ;
            xCell.setFormula("ScAccessiblePageHeader");

            xCell = oSheet.getCellByPosition(0, 1) ;
            xCell.setFormula("Cell 1");
            xCell = oSheet.getCellByPosition(0, 2) ;
            xCell.setFormula("Cell 2");
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            log.println("Exception ceating relation :");
            failed(e.getMessage());
        } catch(com.sun.star.lang.WrappedTargetException e) {
            log.println("Exception ceating relation :");
View Full Code Here

Examples of com.sun.star.table.XCell

            UnoRuntime.queryInterface(XModel.class, xSpreadsheetDoc);

        XController xController = xModel.getCurrentController();

        //setting value of cell A1
        XCell xCell = null;
        try {
            log.println("Getting spreadsheet") ;
            XSpreadsheets oSheets = xSpreadsheetDoc.getSheets() ;
            XIndexAccess oIndexSheets = (XIndexAccess)
            UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
            Object o = oIndexSheets.getByIndex(0);
            XSpreadsheet oSheet = (XSpreadsheet)AnyConverter.toObject(
                            new com.sun.star.uno.Type(XSpreadsheet.class), o);

            log.println("Getting a cell from sheet") ;
            xCell = oSheet.getCellByPosition(0, 0);
        } catch(com.sun.star.lang.IllegalArgumentException e) {
            failed(e.getMessage());
        } catch (com.sun.star.lang.WrappedTargetException e) {
            failed(e.getMessage());
            return;
        } catch (com.sun.star.lang.IndexOutOfBoundsException e) {
            failed(e.getMessage());
            return;
        }

        xCell.setFormula("Value");

        //setting property 'PrintHeaders' of the style 'Default'
        XStyleFamiliesSupplier xSFS = (XStyleFamiliesSupplier)
            UnoRuntime.queryInterface(XStyleFamiliesSupplier.class,
                                                            xSpreadsheetDoc);
View Full Code Here

Examples of com.sun.star.table.XCell

            XSheetCellCursor xCursor = xSheet.createCursorByRange(xSCR);
            XCellCursor xCellCursor = (XCellCursor)UnoRuntime.queryInterface(
                XCellCursor.class, xCursor);

            xCellCursor.gotoEnd();
            XCell xCell = xCursor.getCellByPosition(0, 0);
            XCellAddressable xCellAddr = (XCellAddressable)UnoRuntime.queryInterface(
                XCellAddressable.class, xCell);

            return xCellAddr.getCellAddress();
        }
View Full Code Here

Examples of com.sun.star.table.XCell

        requiredMethod("getSubTotalDescriptor()");
        requiredMethod("setDataArea()");

        for(int i = STARTROW; i < ENDROW+1; i++) {
            try {
                XCell cell = xCellRange.getCellByPosition(COL, i);
                cell.setValue(i);
            } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
                log.println("Unexpected exception");
                e.printStackTrace(log);
                tRes.tested("refresh()", false);
            }
        }

        SubTotalColumn[] STC = new SubTotalColumn[1];
        STC[0] = new SubTotalColumn();
        STC[0].Column = COL;
        STC[0].Function = com.sun.star.sheet.GeneralFunction.SUM;

        double oldVal = 0;
        try {
            XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
            oldVal = checkCell.getValue();
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("Unexpected exception");
            e.printStackTrace(log);
            tRes.tested("refresh()", false);
        }
        log.println("Value of the cell (" + COL + ", " + ENDROW +
            ") : " + oldVal );

        log.println("Set new SubTotal descriptor...");

        STD.clear();
        STD.addNew(STC, 1);

        double valBeforeRefresh = 0;
        try {
            XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
            valBeforeRefresh = checkCell.getValue();
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("Unexpected exception");
            e.printStackTrace(log);
            tRes.tested("refresh()", false);
        }
        log.println("Value of the cell (" + COL + ", " + ENDROW +
            ") : " + valBeforeRefresh );

        log.println("Now call refresh()...");
        oObj.refresh();

        double valAfterRefresh = 0;
        try {
            XCell checkCell = xCellRange.getCellByPosition(COL, ENDROW);
            valAfterRefresh = checkCell.getValue();
        } catch(com.sun.star.lang.IndexOutOfBoundsException e) {
            log.println("Unexpected exception");
            e.printStackTrace(log);
            tRes.tested("refresh()", false);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.