The following quick start section help you in getting started with the DsExcel library:
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:
Apart from the above, following dependencies are also required:
To know more about these dependencies, refer DsExcel Dependencies.
To create a basic application with DsExcel Java, refer to the following tasks:
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); |
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.