Document Solutions for Excel, Java Edition | Document Solutions
Getting Started / Quick Start
In This Topic
    Quick Start
    In This Topic

    The following quick start section help you in getting started with the DsExcel library:

    Step 1: Create a Java Project and add dependency for DsExcel library

    1. In Eclipse IDE, select File | New | Java Project to create a new Java project.
    2. In Project name field, enter the name of your project and click Next.
    3. In Java settings, under Libraries tab, click Add External JARs..
      Java Settings dialog
    4. Select the dsexcel-7.0.0.jar to add it to your project.
    5. Click Finish.
    6. The jar file will be added under the Referenced Libraries in your project.

      RJar file under the Referenced Libraries

    Step 2 - Add the required dependencies

    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.

    Step 3 - Create a basic application with DsExcel Java

    To create a basic application with DsExcel Java, refer to the following tasks:

    1. Add Namespaces

      In Main.java, import the following namespaces -

      import com.grapecity.documents.excel.*;
      import com.grapecity.documents.excel.drawing.*;

    2. 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);

    3. 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");

       

    Step 4 - Build and Run the Project

    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.