Skip to content

Commit 7295b1b

Browse files
committed
2 parents 9ef1a35 + 2468000 commit 7295b1b

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* --------------------------------------------------------------------------------
3+
* <copyright company="Aspose" file="XmlControllerTests.java">
4+
* Copyright (c) 2023 Aspose.Cells Cloud
5+
* </copyright>
6+
* <summary>
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in all
15+
* copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
* </summary>
25+
* --------------------------------------------------------------------------------
26+
*/
27+
28+
package com.aspose.cloud.cells.api;
29+
30+
import com.aspose.cloud.cells.client.*;
31+
import com.aspose.cloud.cells.model.*;
32+
import com.aspose.cloud.cells.request.*;
33+
34+
import org.junit.Test;
35+
import java.util.ArrayList;
36+
import java.util.List;
37+
import java.io.File;
38+
import java.util.HashMap;
39+
import junit.framework.Assert;
40+
41+
42+
public class CustomCaseTest {
43+
private String remoteFolder = "TestData/In";
44+
45+
private CellsApi api;
46+
public CustomCaseTest(){
47+
try {
48+
api = new CellsApi(CellsApiUtil.GetClientId(),CellsApiUtil.GetClientSecret(),CellsApiUtil.GetAPIVersion(),CellsApiUtil.GetBaseUrl());
49+
} catch (ApiException e) {
50+
e.printStackTrace();
51+
}
52+
}
53+
54+
@Test
55+
public void ConversionToHtmlUsingExtendQueryParameters() throws Exception {
56+
String localName = "Book1.xlsx";
57+
String remoteName = "Book1.xlsx";
58+
59+
String format = "html";
60+
String newfilename = "DotNetSDK/OutResult/PostExcelSaveAs.html";
61+
62+
CellsApiUtil.Upload(api, remoteFolder + "/" + remoteName , localName , "");
63+
64+
PostWorkbookSaveAsRequest request = new PostWorkbookSaveAsRequest();
65+
request.setName(remoteName);
66+
67+
request.setNewfilename(newfilename);
68+
69+
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
70+
saveOptions.setSaveFormat(format);
71+
72+
request.setSaveOptions(saveOptions);
73+
74+
request.setFolder(remoteFolder);
75+
HashMap<String, String> extendQueryParameterMap = new HashMap<>();
76+
extendQueryParameterMap.put("SaveAsSingleFile", "true");
77+
extendQueryParameterMap.put("ExportImagesAsBase64", "true");
78+
request.setExtendQueryParameterMap(extendQueryParameterMap);
79+
80+
SaveResponse response = this.api.postWorkbookSaveAs(request);
81+
}
82+
83+
84+
85+
86+
}

0 commit comments

Comments
 (0)