Method setRowPageBreak cannot be found in Worksheet

Posted by: pavloboiko on 12 October 2023, 2:10 am EST

    • Post Options:
    • Link

    Posted 12 October 2023, 2:10 am EST - Updated 12 October 2023, 2:15 am EST

    There is a type for the method setRowPageBreak that allows to run the code, but when this method call is being executed - the error is thrown

  • Posted 12 October 2023, 2:29 pm EST - Updated 12 October 2023, 2:35 pm EST

    Hi Pavlo,

    The issue occurs when you haven’t added the reference for the print feature in your application. Kindly add the reference for the print feature and you will be able to successfully call the “setRowPageBreak” method.

    For example, if you are using PureJS application, kindly add the following reference:

    
    '<script src="https://www.grapecity.com/spreadjs/demos/en/purejs/node_modules/@grapecity/spread-sheets-print/dist/gc.spread.sheets.print.min.js" type="text/javascript"></script>'

    And if you are using some JavaScript Framework like React, Angular, kindly add the following module:

    import "@grapecity/spread-sheets-print";

    You could also refer to the following demo on SpreadJS Printing: https://www.grapecity.com/spreadjs/demos/features/print/basic-print/purejs

    Sample: https://jscodemine.grapecity.com/share/a1kpHHyy502QeDTrxWH12g/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"%2C"%2Fpackage.json"%2C"%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    If the issue still persists for you kindly share us a minimal working sample so that we could investigate the issue at our end and could assist you accordingly. You may also modify the above sample and share is with us replicating the issue.

    Regards,

    Ankit

  • Posted 12 October 2023, 7:21 pm EST

    Thank you for the answer, I’ve installed @grapecity/spread-sheets-print package and imported it like you said. However it still throws the error. Could you please provide a sample, how it should be imported and used in Angular

  • Posted 15 October 2023, 4:11 pm EST

    Hi,

    Kindly refer to the attached Angular Sample using the “@grapecity/spread-sheets-print” module. Please make sure to import the print module after the “@grapecity/spread-sheets” module. You may refer to the following code snippet:

    import * as GC from "@grapecity/spread-sheets";
    import "@grapecity/spread-sheets-print";

    If the issue still persists for you, kindly share us a minimal working sample replicating the issue so that we could investigate and could assist you accordingly.

    You may also modify the attached sample and share it with us.

    Regards,

    Ankit

    sjs-angular-app.zip

  • Posted 15 October 2023, 7:44 pm EST

    Thank you for your answers. I’ve solved my problem. It was caused by mismatch among the versions of the libraries spread-sheets, spread-sheets-print, spread-sheets-angular, etc.

Need extra support?

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

Learn More

Forum Channels