Documents for Excel, Java Edition ReadMe
ReadMe / Installation
In This Topic
    Installation
    In This Topic

    GcExcel Java API reference is available through Maven Central Repository, a directory that stores all the java archives (.jar files) and adds libraries, plugins and references to your project.

    For installation of the product, refer to the following steps:

    Step 1 - Download the GcExcel Java package

    You can either download the GcExcel java package (gcexcel-3.1.0.jar) from Maven Central repository or download it locally on your machine from GrapeCity website.

    Step 2 - Install the GcExcel Java package and add dependency for GcExcel library

    Complete the following steps to install the GcExcel Java package (gcexcel-3.1.0.jar) and add dependency for GcExcel Java library in your application.

    If you are creating an application :

    1. Using Java Integrated Development Environment (IDE):

      You can install any Java IDE - Eclipse or IntelliJ as per your choice. Shared below are the steps to create a Java application using Eclipse IDE:

      1. Open the Eclipse IDE.
      2. Create a new Java project.
      3. In Project name field, enter the name of your project and click Next.
      4. In Java settings, under Libraries tab, click Add External JARs..
      5. Select the gcexcel-3.1.0.jar to add it to your project.
      6. Click Finish.
      7. The jar file will be added under the Referenced Libraries in your project.

    2. Using the Gradle project:

      Open the build.gradle and append the following script in the dependencies block:

      compile("com.grapecity.documents:gcexcel:3.1.0")
    3. Using the Maven project:

      Open the pom.xml and add below xml element in the dependencies node.

      <dependency>
         <groupId>com.grapecity.documents</groupId>
         <artifactId>gcexcel</artifactId>
         <version>3.1.0</version>
      </dependency>

      The jar file will be added as a library in the project and your project can now reference all classes of GcExcel in the jar file.

    Step 3 - Create a basic application with GcExcel Java

    To create a basic application with GcExcel 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

      Create a new workbook and add a worksheet using the following code:

      Workbook workbook = new Workbook();
      IWorksheet worksheet = workbook.getWorksheets().get(0);
    3. Configure worksheet settings

      After your workbook is created, you can set the tab color and customize the default row height and column width of the worksheet as per your preferences. An example code is shown below:

      worksheet.setTabColor('Color.getGreen()');
      worksheet.setStandardHeight(20);
      worksheet.setStandardWidth(50);
    4. Save the workbook

      When you are done, you can save the workbook with the desired name and provide the required path. An example code is shown below:

      workbook.save("GcExcelFeatures.xlsx");

      You can view the saved GcExcelFeatures.xlsx file at the specified location.