Package com.sun.star.sheet

Examples of com.sun.star.sheet.XSpreadsheetDocument


        return res;
    }

    private XSpreadsheet getSheet(XComponent xDoc) {
        XSpreadsheetDocument xSheetDoc = (XSpreadsheetDocument) UnoRuntime.queryInterface(
                                                 XSpreadsheetDocument.class,
                                                 xDoc);
        XSpreadsheet xSheet = null;

        try {
            xSheet = (XSpreadsheet) UnoRuntime.queryInterface(
                             XSpreadsheet.class,
                             xSheetDoc.getSheets()
                                      .getByName(xSheetDoc.getSheets()
                                                          .getElementNames()[0]));
        } catch (com.sun.star.container.NoSuchElementException e) {
            log.println("Couldn't get sheet");
            e.printStackTrace((PrintWriter) log);
        } catch (com.sun.star.lang.WrappedTargetException e) {
View Full Code Here


    /** Create a spreadsheet document, insert some text, header and footer.
     * Let the user resize the document and check the contents.
     */
    public void checkPositiveViewForwarder() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;

        try {
            log.println("Creating a spreadsheet document");
            xSpreadsheetDoc = SOF.createCalcDoc(null);
        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        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);
View Full Code Here

     * Create a spreadsheet document, insert some text, header and footer.
     * Let the user resize the document and check the contents.
     */
    public void checkNegativeViewForwarder() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;

        try {
            log.println("Creating a spreadsheet document");
            xSpreadsheetDoc = SOF.createCalcDoc(null);
        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        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);
View Full Code Here

     */
    public void checkPreviewHeaderCells() {

        XInterface oObj = null;
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF);
        XSpreadsheetDocument xSpreadsheetDoc = null;

        try {
            log.println("Creating a spreadsheet document");
            xSpreadsheetDoc = SOF.createCalcDoc(null);
        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        XModel xModel = (XModel)
            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);
View Full Code Here

     * Check the preview of Shapes: load a document with shapes and see, if they
     * are accessible.
     */
    public void checkPreviewShape() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;
        XComponent xComp = null;
        XInterface oObj = null;

        try {
            String docName = "calcshapes.sxc";
View Full Code Here

            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xSheetDoc);

            // Setting some string to a cell
            XSpreadsheetDocument xSpreadsheetDoc = (XSpreadsheetDocument)
                UnoRuntime.queryInterface(XSpreadsheetDocument.class, xSheetDoc);
            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);
View Full Code Here

    /** Create a spreadsheet document, insert some text, header and footer.
     * Let the user resize the document and check the contents.
     */
    public void checkPositiveViewForwarder() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;

        try {
            log.println("Creating a spreadsheet document");
            xSpreadsheetDoc = SOF.createCalcDoc(null);
        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        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);
View Full Code Here

     * Create a spreadsheet document, insert some text, header and footer.
     * Let the user resize the document and check the contents.
     */
    public void checkNegativeViewForwarder() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;

        try {
            log.println("Creating a spreadsheet document");
            xSpreadsheetDoc = SOF.createCalcDoc(null);
        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        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);
View Full Code Here

     */
    public void checkPreviewHeaderCells() {

        XInterface oObj = null;
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF);
        XSpreadsheetDocument xSpreadsheetDoc = null;

        try {
            log.println("Creating a spreadsheet document");
            xSpreadsheetDoc = SOF.createCalcDoc(null);
        } catch (com.sun.star.uno.Exception e) {
            failed(e.getMessage());
            return;
        }

        XModel xModel = (XModel)
            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);
View Full Code Here

     * Check the preview of Shapes: load a document with shapes and see, if they
     * are accessible.
     */
    public void checkPreviewShape() {
        SOfficeFactory SOF = SOfficeFactory.getFactory( mXMSF );
        XSpreadsheetDocument xSpreadsheetDoc = null;
        XComponent xComp = null;
        XInterface oObj = null;

        try {
            String docName = "calcshapes.sxc";
View Full Code Here

TOP

Related Classes of com.sun.star.sheet.XSpreadsheetDocument

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.