public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Pivot_Table_Example.xls";
            String sheetName = "Sheet2";
            String storage   = "";
            String folder    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get worksheet pivot table informations
                PivotTablesResponse apiResponse = cellsApi.GetWorksheetPivotTables(fileName, sheetName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Get Worksheet Pivot Tables Information, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Test_Book.xls";
            String sheetName = "Sheet1";
            String formula   = "SUM(A5:A10)";
            String storage   = "";
            String folder    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to calculate formula in a worksheet
                SingleValueResponse apiResponse = cellsApi.GetWorkSheetCalculateFormula(fileName, sheetName, formula, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    SingleValue resultValue = apiResponse.Value;
                    Console.WriteLine("Calculated value:" + resultValue.Value);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #3
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "password_protected_Sample_Test_Book.xls";
            String storage  = "";
            String folder   = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to clear modify password
                SaaSposeResponse apiResponse = cellsApi.DeleteDocumentUnProtectFromChanges(fileName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Password is removed");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #4
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Hide_Row_Sample_Test_Book.xls";
            String sheetName = "Sheet1";
            int    startrow  = 1;
            int    totalRows = 1;
            Double height    = 1.0;
            String storage   = "";
            String folder    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to unhide rows in excel workbook
                SaaSposeResponse apiResponse = cellsApi.PostUnhideWorksheetRows(fileName, sheetName, startrow, totalRows, height, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Unhide Rows in Excel Worksheet, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #5
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName   = "Sample_Test_Book.xls";
            String sheetName  = "Sheet5";
            int    chartIndex = 0;
            String storage    = "";
            String folder     = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get fill format of chart area from worksheet
                FillFormatResponse apiResponse = cellsApi.GetChartAreaFillFormat(fileName, sheetName, chartIndex, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    FillFormat chartAreaFillFormat = apiResponse.FillFormat;
                    Console.WriteLine("ChatArea FillFormat Type :: " + chartAreaFillFormat.Type);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #6
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String  fileName  = "Sample_Test_Book.xls";
            String  sheetName = "Sheet1";
            Boolean isVisible = true;
            String  storage   = "";
            String  folder    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to unhide excel worksheet
                WorksheetResponse apiResponse = cellsApi.PutChangeVisibilityWorksheet(fileName, sheetName, isVisible, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Visibility Type: " + apiResponse.Worksheet.VisibilityType);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Test_Book.xls";
            String sheetName = "Sheet1";
            String cellName  = "a12";
            String storage   = "";
            String folder    = "";

            Style style = new Style();

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to change cell style
                StyleResponse apiResponse = cellsApi.PostUpdateWorksheetCellStyle(fileName, sheetName, cellName, storage, folder, style);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Set Formula for a Cell in Excel Worksheets, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "Sample_Book1.xlsx";
            String storage  = "";
            String folder   = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get all document properties
                CellsDocumentPropertiesResponse apiResponse = cellsApi.GetDocumentProperties(fileName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    foreach (CellsDocumentProperty docProperty in apiResponse.DocumentProperties.DocumentPropertyList)
                    {
                        Console.WriteLine("Name: " + docProperty.Name);
                        Console.WriteLine("Value: " + docProperty.Value);
                        Console.WriteLine("BuiltIn: " + docProperty.BuiltIn);
                    }
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName        = "Sample_Test_Book.xls";
            String sheetName       = "Sheet4";
            int    autoshapeNumber = 1;
            String storage         = "";
            String folder          = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get autoshape from worksheet
                AutoShapeResponse apiResponse = cellsApi.GetWorksheetAutoshape(fileName, sheetName, autoshapeNumber, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    AutoShape autoShape = apiResponse.AutoShape;
                    Console.WriteLine(autoShape.HtmlText);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "Sample_Test_Book.xls";
            String storage  = "";
            String folder   = "";
            WorkbookEncryptionRequest body = new WorkbookEncryptionRequest();

            body.EncryptionType = "XOR";
            body.Password       = "******";
            body.KeyLength      = 128;

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
                // Invoke Aspose.Cells Cloud SDK API to encrypt excel workbook
                SaaSposeResponse apiResponse = cellsApi.PostEncryptDocument(fileName, storage, folder, body);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("File is Encrypted");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Test_Book.xls";
            String sheetName = "Sheet2";
            String storage   = null;
            String folder    = null;

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get text items from worksheet
                TextItemsResponse apiResponse = cellsApi.GetWorkSheetTextItems(fileName, sheetName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    foreach (TextItem item in apiResponse.TextItems.TextItemList)
                    {
                        Console.WriteLine("Text: " + item.Text);
                        Console.WriteLine("Href: " + item.link.Href);
                    }
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName     = "Sample_Test_Book" + new Random().Next(100) + ".xls";
            String templateFile = "Sample_Test_Book.xls";
            String dataFile     = null;

            byte[] file    = null;
            String storage = null;
            String folder  = null;

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(templateFile, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + templateFile));
                // Invoke Aspose.Cells Cloud SDK API to create workbook from template
                WorkbookResponse apiResponse = cellsApi.PutWorkbookCreate(fileName, templateFile, dataFile, storage, folder, file);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    String outPutFileName = apiResponse.Workbook.FileName;
                    Console.WriteLine("File name:" + outPutFileName);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #13
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            string name    = "Sample_Test_Book.xls";
            string storage = null;
            string folder  = null;

            try
            {
                storageApi.PutCreate(name, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + name));

                Com.Aspose.Cells.Model.ImportOption body = new Com.Aspose.Cells.Model.ImportOption();
                body.IsInsert = true;

                Com.Aspose.Cells.Model.SaaSposeResponse apiResponse;
                apiResponse = cellsApi.PostImportData(name, storage, folder, body);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Import batch data, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #14
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Book1.xlsx";
            String mergeWith = "Sample_Book2.xls";
            String storage   = "";
            String folder    = "";

            try
            {
                // Upload file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Upload merge file to aspose cloud storage
                storageApi.PutCreate(mergeWith, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + mergeWith));

                // Invoke Aspose.Cells Cloud SDK API to merge excel workbooks
                WorkbookResponse apiResponse = cellsApi.PostWorkbooksMerge(fileName, mergeWith, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    String destFileName = apiResponse.Workbook.FileName;
                    Console.WriteLine("File name:" + destFileName);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #15
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String  fileName  = "Sample_Test_Book.xls";
            Boolean isAutoFit = true;
            int?    startRow  = 1;
            int?    endRow    = 10;
            String  storage   = "";
            String  folder    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to autofit rows in workbooks
                SaaSposeResponse apiResponse = cellsApi.PostAutofitWorkbookRows(fileName, startRow, endRow, isAutoFit, storage, folder, null);

                if (apiResponse != null)
                {
                    Console.WriteLine("Auto Fit Rows in Excel Workbooks, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Test_Book.xls";
            String sheetName = "Sheet6";
            String storage   = "";
            String folder    = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to delete all pictures
                SaaSposeResponse apiResponse = cellsApi.DeleteWorkSheetPictures(fileName, sheetName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Delete all Pictures from Excel Worksheet, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #17
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName             = "Sample_Test_Book";
            String fileExtension        = ".xls";
            String sheetName            = "Sheet1";
            String format               = "png";
            int?   verticalResolution   = null;
            int?   horizontalResolution = null;
            String storage              = "";
            String folder               = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName + fileExtension));

                // Invoke Aspose.Cells Cloud SDK API to convert worksheet to image
                ResponseMessage apiResponse = cellsApi.GetWorkSheetWithFormat(fileName + fileExtension, sheetName, format, verticalResolution, horizontalResolution, storage, folder);

                if (apiResponse != null)
                {
                    Console.WriteLine("Worksheet converted to Image!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #18
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName       = "Sample_Test_Book.xls";
            String sheetName      = "Sheet1";
            int    row            = 1;
            int    column         = 1;
            int    freezedRows    = 1;
            int    freezedColumns = 1;
            String folder         = "";
            String storage        = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to freeze panes in excel worksheet
                SaaSposeResponse apiResponse = cellsApi.PutWorksheetFreezePanes(fileName, sheetName, row, column, freezedRows, freezedColumns, folder, storage);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Freeze Panes in Excel Worksheet, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName         = "Sample_Test_Book.xls";
            String sheetName        = "Sheet2";
            String cellOrMethodName = "maxdatarow";
            String storage          = "";
            String folder           = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get max data row from worksheet
                ResponseMessage apiResponse = cellsApi.GetWorksheetCell(fileName, sheetName, cellOrMethodName, storage, folder);

                if (apiResponse != null)
                {
                    Console.WriteLine("Max data Row," + System.Text.Encoding.Default.GetString(apiResponse.ResponseStream));
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #20
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName             = "Sample_Test_Book.xls";
            String sheetName            = "Sheet1";
            String storage              = "";
            String folder               = "";
            WorksheetMovingRequest body = new WorksheetMovingRequest();

            body.DestinationWorksheet = "Sheet5";
            body.Position             = "after";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to move excel worksheets
                WorksheetsResponse apiResponse = cellsApi.PostMoveWorksheet(fileName, sheetName, storage, folder, body);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("WorkSheet moved!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String name         = "Sample_OleObject_Book1";
            String fileName     = name + ".xlsx";
            String sheetName    = "Sheet1";
            int    objectNumber = 0;
            String format       = "png";
            String storage      = "";
            String folder       = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to convert OleObject to image
                ResponseMessage apiResponse = cellsApi.GetWorksheetOleObjectWithFormat(fileName, sheetName, objectNumber, format, storage, folder);

                if (apiResponse != null)
                {
                    Console.WriteLine("Convert OLE Object to Image, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName     = "Sample_Book1.xlsx";
            String propertyName = "AsposeAuthor";
            String storage      = "";
            String folder       = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to remove particular property
                CellsDocumentPropertiesResponse apiResponse = cellsApi.DeleteDocumentProperty(fileName, propertyName, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Property have been removed!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName       = "Sample_Test_Book.xls";
            String sheetName      = "Sheet2";
            int    hyperlinkIndex = 0;
            String storage        = "";
            String folder         = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get hyperlinks from worksheet
                HyperlinkResponse apiResponse = cellsApi.GetWorkSheetHyperlink(fileName, sheetName, hyperlinkIndex, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Hyperlink Address : " + apiResponse.Hyperlink.Address);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            string fileName             = "Sample_Test_Book.xls";
            string format               = "png";
            int?   from                 = null;
            int?   to                   = null;
            int?   horizontalResolution = null;
            int?   verticalResolution   = null;
            string storage              = null;
            string folder               = null;

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to split excel workbooks
                SplitResultResponse apiResponse = cellsApi.PostWorkbookSplit(fileName, format, from, to, horizontalResolution, verticalResolution, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Workbook is splited!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #25
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Test_Book.xls";
            String sheetName = "Sheet2-new";
            String storage   = "";
            String folder    = "";

            try
            {
                // Invoke Aspose.Cells Cloud SDK API to add new excel sheet
                WorksheetsResponse apiResponse = cellsApi.PutAddNewWorksheet(fileName, sheetName, storage, folder);

                if (apiResponse != null)
                {
                    Console.WriteLine("Added a New Excel Worksheet!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName  = "Sample_Test_Book.xls";
            String sheetName = "Sheet2";
            String cellarea  = "A10:B20";
            String value     = "1234";
            String type      = "int";
            String storage   = "";
            String folder    = "";


            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to set range value in worksheet
                SaaSposeResponse apiResponse = cellsApi.PostSetCellRangeValue(fileName, sheetName, cellarea, value, type, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Set Range Value in Excel Worksheet, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #27
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String  fileName   = "Group_Rows_Sample_Test_Book.xls";
            String  sheetName  = "Sheet1";
            int     firstIndex = 1;
            int     lastIndex  = 1;
            Boolean hide       = false;
            String  storage    = "";
            String  folder     = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to ungroup rows in worksheet
                SaaSposeResponse apiResponse = cellsApi.PostUngroupWorksheetRows(fileName, sheetName, firstIndex, lastIndex, hide, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("UnGroup Rows in Excel Worksheet, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
Пример #28
0
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName = "Sample_Test_Book.xls";
            String oldValue = "aspose";
            String newValue = "aspose.com";

            String storage = null;
            String folder  = null;

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to replace text in workbook
                WorkbookReplaceResponse apiResponse = cellsApi.PostWorkbooksTextReplace(fileName, oldValue, newValue, storage, folder);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Matches: " + apiResponse.Matches);
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            String fileName    = "Sample_Test_Book.xls";
            String sheetName   = "Sheet5";
            int    chartNumber = 0;
            String storage     = "";
            String folder      = "";

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));

                // Invoke Aspose.Cells Cloud SDK API to get chart from worksheet
                ResponseMessage apiResponse = cellsApi.GetWorksheetChart(fileName, sheetName, chartNumber, storage, folder);

                if (apiResponse != null)
                {
                    Console.WriteLine("Get Chart from a Worksheet, done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }
        public static void Run()
        {
            // ExStart:1
            CellsApi   cellsApi   = new CellsApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);
            StorageApi storageApi = new StorageApi(Common.APP_KEY, Common.APP_SID, Common.BASEPATH);

            string fileName       = "Sample_Test_Book.xls";
            string sourceFileName = "Sample_Book2.xls";
            string imageFileName  = "aspose-logo.png";

            string sheetName       = "Sheet1";
            int?   upperLeftRow    = null;
            int?   upperLeftColumn = null;
            int?   height          = null;
            int?   width           = null;
            string oleFile         = null;
            string imageFile       = null;
            string storage         = null;
            string folder          = null;

            Com.Aspose.Cells.Model.OleObject body = new Com.Aspose.Cells.Model.OleObject();
            body.SourceFullName      = sourceFileName;
            body.ImageSourceFullName = imageFileName;
            body.UpperLeftRow        = 15;
            body.UpperLeftColumn     = 5;
            body.Top        = 10;
            body.Bottom     = 10;
            body.Left       = 10;
            body.Height     = 400;
            body.Width      = 400;
            body.IsAutoSize = true;

            try
            {
                // Upload source file to aspose cloud storage
                storageApi.PutCreate(fileName, "", "", System.IO.File.ReadAllBytes(Common.GetDataDir() + fileName));
                storageApi.PutCreate(sourceFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + sourceFileName));
                storageApi.PutCreate(imageFileName, null, null, System.IO.File.ReadAllBytes(Common.GetDataDir() + imageFileName));

                // Invoke Aspose.Cells Cloud SDK API to add OleObject
                OleObjectResponse apiResponse = cellsApi.PutWorksheetOleObject(fileName, sheetName, upperLeftRow, upperLeftColumn, height, width, oleFile, imageFile, storage, folder, body);

                if (apiResponse != null && apiResponse.Status.Equals("OK"))
                {
                    Console.WriteLine("Add OleObjects to Excel Worksheet, Done!");
                    Console.ReadKey();
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine("error:" + ex.Message + "\n" + ex.StackTrace);
            }
            // ExEnd:1
        }