Sheet Not Visible While Printing

Posted by: tyler.franklin on 27 February 2024, 5:11 am EST

    • Post Options:
    • Link

    Posted 27 February 2024, 5:11 am EST - Updated 27 February 2024, 5:55 am EST

    Good morning,

    I have a non-hidden sheet that is not printed when I call spread.print(). In the attached image I use a forEach loop to customize the printInfo object of each sheet.



    The sheetsList array contains three sheets. I am able to customize the printInfo object for the first two sheets. I am also able to customize the printInfo object of the third sheet. However, the third sheet is not displayed in the print preview or when printed. Also, when I try to print the specific index of the sheet I receive a blank sheet.

    Also, the Print_Area custom name of the third sheet is empty. Print_Area should not be empty since I have set the print area via designer.

  • Posted 27 February 2024, 7:20 am EST

    See attached for what the print preview looks like. The preview says that 5 sheets will be printed. However, we can only see 4 sheets.

  • Posted 27 February 2024, 5:10 pm EST

    Hi,

    I couldn’t find any attachment with your last response. However, I tested by creating a sample and it seems to be working fine at my end.

    You may refer to the following sample that I have used for testing: https://jscodemine.mescius.io/share/OzSEECspY0W_kgzaZf-PTg/?IsEmbed=false&Theme=Unset&PreviewDirection=0&IsEditorShow=true&IsExplorerShow=true&IsPreviewShow=true&IsConsoleShow=true&IsRunBTNShow=false&IsResetBTNShow=false&IsOpenInCodemineBTNShow=false&PanelWidth=20&PanelWidth=50&PanelWidth=30&defaultOpen={"OpenedFileName"%3A["%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    As you could see in the sample, when clicking the “Print All Sheets”, all sheets are shown in the preview as configured by the printInfo.

    Could you kindly share us a minimal working sample replicating the issue for us to investigate? You may also fork the above sample, modify it and share it with us.

    Regards,

    Ankit

  • Posted 28 February 2024, 12:26 am EST

    Good morning. Thank you for responding so quickly. Please see the attached sjs file. When I upload the sjs file to your demo the ‘WBS’ sheet is still hidden. So it doesn’t appear in the print preview. Are you able to view the WBS sheet in print preview on your end?

  • Posted 28 February 2024, 12:29 am EST

    Good morning. Thank you for responding so quickly. Please see the attached sjs file. When I upload the sjs file to your demo the ‘WBS’ sheet is still hidden. So it doesn’t appear in the print preview. Are you able to view the WBS sheet in print preview on your end?sanitizedTemplateForHelpTicket.zip

  • Posted 28 February 2024, 9:38 pm EST

    Hi,

    Thanks for sharing the “.sjs” file with us. I was able to replicate the issue at my end. However, after investigation, I found that there are some issue with the “.sjs” file. For example, if you “unhide” all the rows of the “WBS” sheet, then you won’t be able to scroll down the sheet, at the bottom.

    Also, if you export the “.sjs” file to the Microsoft Excel, Excel will also give the error. Also, performing the same action i.e., unhiding the rows of the “WBS” sheet, you won’t be able to scroll down the sheet.

    Could you kindly share the sample/steps through which the “.sjs” file is generated? The issue seems to be with the “.sjs” file. If you have generated the “.sjs” file from some Excel file, kindly do share the excel file with us. If you have applied the changes using SpreadJS “APIs”, kindly do share the sample with us so that we could investigate the sample/file and help you accordingly.

    Regards,

    Ankit

  • Posted 29 February 2024, 12:41 am EST

    Good morning,

    The reason you can’t scroll to the bottom of the WBS sheet if you unhide all rows is because rows 66-72 have been frozen. You can unfreeze them by using the ‘Unfreeze Panes’ option in designer. Having rows 66-72 frozen is an intended feature for our use case.

    The .sjs file was generated by importing an excel file to Designer. Then we saved the .sjs file. Now we use the base .sjs file as a template for new workbooks. So in Designer we clicked File → Import → and then selected the excel file. I am able to import the excel file into designer without receiving an error.

  • Posted 3 March 2024, 2:55 pm EST

    Hi,

    Thanks for the clarification on the frozen rows and columns. The issue I was talking about is that when you export the workbook to an excel file, Microsoft Excel shows an error opening the excel file.

    Also, the sheet “WBS” is not shown when calling the “print()” method. I have also tried setting the printArea to “$A$1:$AG$400”. I have escalated both the issue to the concerned dev team for further investigation. The internal tracking id for the same is: SJS-23067.

    I will let you know when there is more info on this from the dev team.

    Regards,

    Ankit

  • Posted 5 March 2024, 3:18 am EST

    Ankit,

    Thank you. I eagerly await your reply. Have a great day.

  • Posted 21 March 2024, 6:23 pm EST - Updated 21 March 2024, 6:28 pm EST

    Hi,

    Kindly refer to the two issues related to the file that you have shared.

    1. Printing Issue: The devs have mentioned that for the “WBS” sheet, the sheet’s printInfo.pageRange is “7”, but its printing only 2 pages, so it is not printed.

    To fix the printing result, you should clear the invalid pageRange before print, like the following code:

        document.getElementById('btn').onclick = function () {
            spread.getSheetFromName("WBS").printInfo().pageRange(""); // clear invalid pageRange before print
            spread.print();
        }

    Sample: https://jscodemine.mescius.io/share/0HnKUI9FtEa-VX_JcTg8cg/?IsEmbed=false&Theme=Unset&PreviewDirection=0&IsEditorShow=true&IsExplorerShow=true&IsPreviewShow=true&IsConsoleShow=true&IsRunBTNShow=false&IsResetBTNShow=false&IsOpenInCodemineBTNShow=false&PanelWidth=20&PanelWidth=50&PanelWidth=30&defaultOpen={"OpenedFileName"%3A["%2Fsrc%2Fapp.js"]%2C"ActiveFile"%3A"%2Fsrc%2Fapp.js"}

    2. Excel Export Error Message: The reason that exporting the Excel popup an error dialog is that in the “Schedule” sheet, Cell E64 has a data validator, and the error message exceeds the Excel error message length limit.

    You could refer to the following discussion related to Excel Data Validation Input Message Limit: https://answers.microsoft.com/en-us/msoffice/forum/all/excel-data-validation-input-message-limitation/10a57628-cbc1-4f77-907d-b43bbd79edfe

    I hope that clarifies both the issues.

    Regards,

    Ankit

  • Posted 1 April 2024, 5:32 am EST

    Ankit,

    This is very helpful. Thank you. Please tell the devs I said “Thank you” also.

  • Posted 1 April 2024, 3:02 pm EST

    Hi,

    Thanks for the feedback. I have shared it with the dev team.

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels