public void Cells_OleObjects_Tests()
        {
            try
            {
                storageService.File.CopyFile(Utils.CloudStorage_Input_Folder + "/cells-sample.xlsx", Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx");

                CellsOleObjectsResponse cellsOleObjectsResponse = cellsService.OleObjects.GetWorksheetOleObjectsInfo(name, "Sheet5", Utils.CloudStorage_Output_Folder);
                CellsOleObjectResponse  cellsOleObjectResponse2 = cellsService.OleObjects.GetOleObjectInfo(name, "sheet5", 0, Utils.CloudStorage_Output_Folder);

                CellsOleObject cellsOleObject = new CellsOleObject();
                cellsOleObject.SourceFullName      = Utils.CloudStorage_Input_Folder + "/doc-sample.doc";
                cellsOleObject.ImageSourceFullName = Utils.CloudStorage_Output_Folder + "/signature.jpg";
                cellsOleObject.UpperLeftRow        = 10;
                cellsOleObject.UpperLeftColumn     = 10;
                cellsOleObject.Top    = 10;
                cellsOleObject.Left   = 20;
                cellsOleObject.Height = 20;
                cellsOleObject.Width  = 20;

                CellsOleObjectResponse CellsOleObjectResponse3 = cellsService.OleObjects.AddOleObject(name, "sheet5", 1, 1, 200, 200, string.Empty, string.Empty, cellsOleObject, Utils.CloudStorage_Output_Folder);
                cellsService.OleObjects.UpdateOleObject(name, "sheet5", 0, cellsOleObject, Utils.CloudStorage_Output_Folder);

                cellsService.OleObjects.GetTheOleObjectInSomeFormat(name, "sheet5", 0, CellsOleObjectFormat.Gif, Utils.Local_Output_Path + "cells-ole-out.gif", Utils.CloudStorage_Output_Folder);

                cellsService.OleObjects.DeleteOleObject(name, "sheet5", 0, Utils.CloudStorage_Output_Folder);
                cellsService.OleObjects.DeleteAllOleObjects(name, "sheet5", Utils.CloudStorage_Output_Folder);

                //storageService.File.DownloadFile(Utils.CloudStorage_Output_Folder + "/cells-sample.xlsx", Utils.Local_Output_Path + "/cells-sample.xlsx");
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
        }
Example #2
0
        static void Main()
        {
            string dataDir = Common.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

            string input  = "sample1.xlsx";
            string output = "output.xlsx";

            Common.StorageService.File.UploadFile(dataDir + input, input, storage: Common.STORAGE);
            string sheetName = "Sheet1";

            CellsOleObject cellsOleObject = new CellsOleObject();

            cellsOleObject.SourceFullName      = "ole.docx";
            cellsOleObject.ImageSourceFullName = "picture.png";
            cellsOleObject.UpperLeftRow        = 10;
            cellsOleObject.UpperLeftColumn     = 10;
            cellsOleObject.Top    = 10;
            cellsOleObject.Left   = 20;
            cellsOleObject.Height = 20;
            cellsOleObject.Width  = 20;

            Common.CellsService.OleObjects.AddOleObject(input, sheetName, 1, 1, 1000, 1000, string.Empty, string.Empty, cellsOleObject, Common.FOLDER, storage: Common.STORAGE);

            Common.StorageService.File.DownloadFile(input, dataDir + output, storage: Common.STORAGE);
        }