Skip to content

Commit e1de5f7

Browse files
Merge pull request #4 from AdeelIlyas2014/master
Aspose Cells for Apache POI Comparison examples (plugin) added within "Plugins" folder.
2 parents 305d6c9 + 9604209 commit e1de5f7

File tree

38 files changed

+1413
-0
lines changed

38 files changed

+1413
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
5+
<classpathentry kind="lib" path="D:/Banckle/workspaces/ApachePOI_GitHub/lib/Aspose/aspose-cells-8.3.0.jar"/>
6+
<classpathentry kind="lib" path="D:/Banckle/workspaces/ApachePOI_GitHub/lib/ApachePOI/poi-3.11-beta1-20140306.jar"/>
7+
<classpathentry kind="lib" path="D:/Banckle/workspaces/ApachePOI_GitHub/lib/ApachePOI/poi-ooxml-3.11-beta1-20140306.jar"/>
8+
<classpathentry kind="output" path="bin"/>
9+
</classpath>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Aspose_Cells_for_ApachePOI</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 285 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,285 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Data>
3+
<Folders>
4+
<Folder>
5+
<Title>Features Comparison</Title>
6+
<Description>
7+
Contain the code comparison for features in Apache POI SS SDK and Aspose.Cells
8+
These examples are helpful for developers who want to compare Apache POI with Aspose OR migrate from Apache POI to Aspose.
9+
</Description>
10+
<FolderName>featurescomparison</FolderName>
11+
<Order>1</Order>
12+
<Folders>
13+
<Folder>
14+
<Title>Working with Workbook</Title>
15+
<Description>This folder contain the examples to deal with Workbooks.</Description>
16+
<FolderName>workingwithworkbook</FolderName>
17+
<Order>1</Order>
18+
<Examples>
19+
<Example>
20+
<Title>Create New Workbook</Title>
21+
<Description>How to create new Workbook.</Description>
22+
<FolderName>createnewworkbook</FolderName>
23+
<Order>1</Order>
24+
<OutputFiles>
25+
<DataFile>
26+
<Path>..\data\newWorkBook_Aspose_Out.xlsx</Path>
27+
</DataFile>
28+
<DataFile>
29+
<Path>..\data\newWorkBook_Apache_Out.xls</Path>
30+
</DataFile>
31+
</OutputFiles>
32+
<Type>Console</Type>
33+
</Example>
34+
<Example>
35+
<Title>Add Data in Cells</Title>
36+
<Description>How to add data in cells.</Description>
37+
<FolderName>adddataincells</FolderName>
38+
<Order>2</Order>
39+
<OutputFiles>
40+
<DataFile>
41+
<Path>..\data\DataInCells_Aspose_Out.xls</Path>
42+
</DataFile>
43+
<DataFile>
44+
<Path>..\data\DataInCells_Apache_Out.xls</Path>
45+
</DataFile>
46+
</OutputFiles>
47+
<Type>Console</Type>
48+
</Example>
49+
<Example>
50+
<Title>Set Print Area</Title>
51+
<Description>How to Set Print Area.</Description>
52+
<FolderName>setprintarea</FolderName>
53+
<Order>3</Order>
54+
<OutputFiles>
55+
<DataFile>
56+
<Path>..\data\AsposePrintArea_Out.xlsx</Path>
57+
</DataFile>
58+
<DataFile>
59+
<Path>..\data\ApachePrintArea_Out.xls</Path>
60+
</DataFile>
61+
</OutputFiles>
62+
<Type>Console</Type>
63+
</Example>
64+
</Examples>
65+
</Folder>
66+
<Folder>
67+
<Title>Working with Worksheets</Title>
68+
<Description>This folder contain the examples to deal with worksheets.</Description>
69+
<FolderName>workingwithworksheets</FolderName>
70+
<Order>1</Order>
71+
<Examples>
72+
<Example>
73+
<Title>Create New Worksheet</Title>
74+
<Description>How to create new worksheet.</Description>
75+
<FolderName>createnewworksheet</FolderName>
76+
<Order>1</Order>
77+
<OutputFiles>
78+
<DataFile>
79+
<Path>..\data\newWorksheet_Aspose_Out.xls</Path>
80+
</DataFile>
81+
<DataFile>
82+
<Path>..\data\newWorksheet_Apache_Out.xls</Path>
83+
</DataFile>
84+
</OutputFiles>
85+
<Type>Console</Type>
86+
</Example>
87+
<Example>
88+
<Title>Copy Sheet Within Workbook</Title>
89+
<Description>How to copy sheets with in workbook.</Description>
90+
<FolderName>copysheetwithinworkbook</FolderName>
91+
<Order>2</Order>
92+
<OutputFiles>
93+
<DataFile>
94+
<Path>..\data\AsposeCopyWorkbook_Out.xls</Path>
95+
</DataFile>
96+
</OutputFiles>
97+
<Type>Console</Type>
98+
</Example>
99+
<Example>
100+
<Title>Re-Order Sheets Within Workbook</Title>
101+
<Description>How to re-order sheets (change sequence number of sheet) with in workbook.</Description>
102+
<FolderName>reordersheetswithinworkbook</FolderName>
103+
<Order>3</Order>
104+
<OutputFiles>
105+
<DataFile>
106+
<Path>..\data\AsposeMoveSheet_Out.xls</Path>
107+
</DataFile>
108+
<DataFile>
109+
<Path>..\data\Apache_Reordered_Out.xls</Path>
110+
</DataFile>
111+
</OutputFiles>
112+
<Type>Console</Type>
113+
</Example>
114+
<Example>
115+
<Title>Zoom Factor</Title>
116+
<Description>How to set zoom value for worksheet</Description>
117+
<FolderName>zoomfactor</FolderName>
118+
<Order>4</Order>
119+
<OutputFiles>
120+
<DataFile>
121+
<Path>..\data\AsposeZoom_Out.xls</Path>
122+
</DataFile>
123+
<DataFile>
124+
<Path>..\data\ApacheZoom_Out.xls</Path>
125+
</DataFile>
126+
</OutputFiles>
127+
<Type>Console</Type>
128+
</Example>
129+
<Example>
130+
<Title>Header and Footers</Title>
131+
<Description>Working wih header and footers</Description>
132+
<FolderName>headerandfooter</FolderName>
133+
<Order>5</Order>
134+
<InputFiles>
135+
<DataFile>
136+
<Path>..\data\footer.png</Path>
137+
</DataFile>
138+
</InputFiles>
139+
<OutputFiles>
140+
<DataFile>
141+
<Path>..\data\AsposeHeaderFooter_Out.xls</Path>
142+
</DataFile>
143+
<DataFile>
144+
<Path>..\data\ApacheHeaderFooter_Out.xls</Path>
145+
</DataFile>
146+
</OutputFiles>
147+
<Type>Console</Type>
148+
</Example>
149+
</Examples>
150+
</Folder>
151+
<Folder>
152+
<Title>Working with Cells, Rows and Columns</Title>
153+
<Description>This folder contain the examples to deal with Cells, Rows and Columns.</Description>
154+
<FolderName>workingwithcellsrowscolumns</FolderName>
155+
<Order>1</Order>
156+
<Examples>
157+
<Example>
158+
<Title>Freeze Panes</Title>
159+
<Description>How to freeze desired Rows and Columns</Description>
160+
<FolderName>freezepanes</FolderName>
161+
<Order>1</Order>
162+
<OutputFiles>
163+
<DataFile>
164+
<Path>..\data\workbook_Aspose_Out.xls</Path>
165+
</DataFile>
166+
<DataFile>
167+
<Path>..\data\workbook_Apache_Out.xls</Path>
168+
</DataFile>
169+
</OutputFiles>
170+
<Type>Console</Type>
171+
</Example>
172+
<Example>
173+
<Title>Hide and Unhide Cells</Title>
174+
<Description>Shows how to hide and unhide specific Cells</Description>
175+
<FolderName>hideunhidecells</FolderName>
176+
<Order>2</Order>
177+
<InputFiles>
178+
<DataFile>
179+
<Path>..\data\workbook.xls</Path>
180+
</DataFile>
181+
</InputFiles>
182+
<OutputFiles>
183+
<DataFile>
184+
<Path>..\data\hideUnhideCells_Aspose_Out.xls</Path>
185+
</DataFile>
186+
<DataFile>
187+
<Path>..\data\hideUnhideCells_Apache_Out.xls</Path>
188+
</DataFile>
189+
</OutputFiles>
190+
<Type>Console</Type>
191+
</Example>
192+
<Example>
193+
<Title>Merge Cells</Title>
194+
<Description>How to merge multiple Cells</Description>
195+
<FolderName>mergecells</FolderName>
196+
<Order>3</Order>
197+
<OutputFiles>
198+
<DataFile>
199+
<Path>..\data\merge_Aspose_Out.xls</Path>
200+
</DataFile>
201+
<DataFile>
202+
<Path>..\data\merge_Apache_Out.xls</Path>
203+
</DataFile>
204+
</OutputFiles>
205+
<Type>Console</Type>
206+
</Example>
207+
<Example>
208+
<Title>Auto Fit Row and Column</Title>
209+
<Description>Adjust the size of rows and column by autofit</Description>
210+
<FolderName>autofitrowandcolumn</FolderName>
211+
<Order>4</Order>
212+
<InputFiles>
213+
<DataFile>
214+
<Path>..\data\workbook.xls</Path>
215+
</DataFile>
216+
</InputFiles>
217+
<OutputFiles>
218+
<DataFile>
219+
<Path>..\data\AutoFit_Aspose_Out.xls</Path>
220+
</DataFile>
221+
<DataFile>
222+
<Path>..\data\AutoFit_Apache_Out.xls</Path>
223+
</DataFile>
224+
</OutputFiles>
225+
<Type>Console</Type>
226+
</Example>
227+
</Examples>
228+
</Folder>
229+
<Folder>
230+
<Title>Working with Formatting Features</Title>
231+
<Description>This folder contain the examples to deal with documents.</Description>
232+
<FolderName>workingwithformattingfeatures</FolderName>
233+
<Order>1</Order>
234+
<Examples>
235+
<Example>
236+
<Title>Working with Fonts</Title>
237+
<Description>How to use font options</Description>
238+
<FolderName>workingwithfonts</FolderName>
239+
<Order>1</Order>
240+
<OutputFiles>
241+
<DataFile>
242+
<Path>..\data\AsposeFonts.xls</Path>
243+
</DataFile>
244+
<DataFile>
245+
<Path>..\data\ApacheFonts.xls</Path>
246+
</DataFile>
247+
</OutputFiles>
248+
<Type>Console</Type>
249+
</Example>
250+
<Example>
251+
<Title>Working with Colors</Title>
252+
<Description>How to different colors</Description>
253+
<FolderName>workingwithcolors</FolderName>
254+
<Order>2</Order>
255+
<OutputFiles>
256+
<DataFile>
257+
<Path>..\data\AsposeColors_Out.xls</Path>
258+
</DataFile>
259+
<DataFile>
260+
<Path>..\data\ApacheColors_Out.xls</Path>
261+
</DataFile>
262+
</OutputFiles>
263+
<Type>Console</Type>
264+
</Example>
265+
<Example>
266+
<Title>Working with Borders</Title>
267+
<Description>How to apply border options</Description>
268+
<FolderName>workingwithborders</FolderName>
269+
<Order>3</Order>
270+
<OutputFiles>
271+
<DataFile>
272+
<Path>..\data\AsposeBorders_Out.xls</Path>
273+
</DataFile>
274+
<DataFile>
275+
<Path>..\data\ApacheBorders_Out.xls</Path>
276+
</DataFile>
277+
</OutputFiles>
278+
<Type>Console</Type>
279+
</Example>
280+
</Examples>
281+
</Folder>
282+
</Folders>
283+
</Folder>
284+
</Folders>
285+
</Data>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Aspose
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Project in Development Phase
2+
=============================
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package featurescomparison.workingwithcellsrowscolumns.autofitrowandcolumn.java;
2+
3+
import java.io.FileInputStream;
4+
import java.io.FileOutputStream;
5+
import java.io.InputStream;
6+
7+
import org.apache.poi.ss.usermodel.Sheet;
8+
import org.apache.poi.ss.usermodel.Workbook;
9+
import org.apache.poi.ss.usermodel.WorkbookFactory;
10+
11+
public class ApacheAutoFit
12+
{
13+
public static void main(String[] args) throws Exception
14+
{
15+
String dataPath = "src/featurescomparison/workingwithcellsrowscolumns/autofitrowandcolumn/data/";
16+
17+
InputStream inStream = new FileInputStream(dataPath + "workbook.xls");
18+
Workbook workbook = WorkbookFactory.create(inStream);
19+
20+
Sheet sheet = workbook.createSheet("new sheet");
21+
sheet.autoSizeColumn(0); //adjust width of the first column
22+
sheet.autoSizeColumn(1); //adjust width of the second column
23+
24+
FileOutputStream fileOut;
25+
fileOut = new FileOutputStream(dataPath + "AutoFit_Apache_Out.xls");
26+
workbook.write(fileOut);
27+
fileOut.close();
28+
29+
System.out.println("Process Completed.");
30+
}
31+
}

0 commit comments

Comments
 (0)