Issue with license key using SpreadJS Excel IO

Posted by: grazielleconceicao on 17 October 2022, 3:30 pm EST

    • Post Options:
    • Link

    Posted 17 October 2022, 3:30 pm EST - Updated 17 October 2022, 3:36 pm EST

    Hello,

    We are using SpreadJS Excel IO to export the spreadsheet data and we have license key SpreadJS 15 Deployment License Single Hostname - ANNUAL. But, when exporting the data, it shows the message that a license is needed to run it.

    Is it necessary to have another key in addition to the one we already have?

    Awaiting return.

  • Posted 18 October 2022, 3:29 am EST

    Hi,

    It appears that you have not set the ExcelIO licence key based on the screenshot you provided.

    The licence for SpreadJS must be the same as the licence you chose for ExcelIO.

    Please see the following snippet of code:

    import * as GC from '@grapecity/spread-sheets';
    import * as ExcelIO from "@grapecity/spread-excelio";
    
    //Apply License
    var sjsLicense = "sjs-distribution-key";
    // GC.Spread.Sheets.LicenseKey = sjsLicense;
    // ExcelIO.LicenseKey = sjsLicense;

    If the problem still exists for you, would you kindly submit a minimal working sample so that we can look into it and offer you the necessary support.

    Regards,

    Ankit

  • Posted 18 October 2022, 8:17 am EST

    Hi,

    I tried doing this, I’m using typescript and I get the error: "Property ‘LicenseKey’ does not exist on type ‘typeof Excel’. There is no “LicenseKey” in @grapecity/spread-excelio

    import * as ExcelIO from '@grapecity/spread-excelio';
    
    ExcelIO.LicenseKey = process.env.REACT_APP_SPREADJS
  • Posted 19 October 2022, 1:53 am EST

    Hi,

    We could not add the LicenseKey file in Excel namespace, it will be handled as a read-only property. It is a limitation in current typescript definition design.

    As a workaround, while setting a license, convert the ExcelIO to a “any” type as seen below:

    import * as GC from '@grapecity/spread-sheets'
     import * as ExcelIO from '@grapecity/spread-excelio'
    GC.Spread.Sheets.LicenseKey = 'License Key'
    (ExcelIO as any).LicenseKey = 'License Key'

    Try the aforementioned workaround and let us know if you still experience problems.

    Regards,

    Ankit

  • Posted 19 October 2022, 1:05 pm EST

    Hi,

    This solved my problem.

    Thanks!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels