[]
The following quick start section help you in getting started with the DsExcel library:
In Eclipse IDE, select File | New | Java Project to create a new Java project.
In Project name field, enter the name of your project and click Next.
In Java settings, under Libraries tab, click Add External JARs..
Select the dsexcel-7.0.0.jar to add it to your project.
Click Finish.
The jar file will be added under the Referenced Libraries in your project.
Download the JSON Processing Default Provider and add reference to javax.json as a dependency library in your Java project.
If you're using javax.json-1.1 and above, make sure that you add the following file in your java project in order to license it successfully:
javax.json-1.0.4.jar
Apart from the above, following dependencies are also required:
fontbox-2.0.24.jar
pdfbox-2.0.24.jar
commons-logging-1.2.jar
gson-2.8.9.jar
To know more about these dependencies, refer DsExcel Dependencies.
To create a basic application with DsExcel Java, refer to the following tasks:
Add Namespaces
In Main.java, import the following namespaces -
import com.grapecity.documents.excel.*;
import com.grapecity.documents.excel.drawing.*;
Create a new workbook, access the default worksheet and configure settings
Create a new workbook, access the default worksheet. You can also configure settings like the default row height and column width of the worksheet. An example code is shown below:
Workbook workbook = new Workbook();
IWorksheet worksheet = workbook.getWorksheets().get(0);
worksheet.setStandardHeight(20);
worksheet.setStandardWidth(50);
Save the workbook
After customizing the worksheet, you can save the workbook with the desired name and provide the required path. An example code is shown below:
workbook.save("DsExcelFeatures.xlsx");
When you finish, build and run your project. You will notice that the DsExcelFeatures.xlsx file is created at the specified location on your system.