Incorrect file format error

Posted by: marcio.shimoda on 18 October 2023, 7:46 am EST

  • Posted 18 October 2023, 7:46 am EST

    Hi!

    After some changes, some SJS files started to display the error message “Incorrect file format” when trying to open them.

    When attempting to open in SpreadJS Designer, I got the same error.

    While investigating the JSON files within the SJS, I found a NaN in the borderItems property inside the styles.json file.

    I changed it to 0, and the file started to open.

    Why is it showing this NaN?

    folder with sjs file.zip

  • Posted 18 October 2023, 10:28 pm EST

    Hi,

    I could see the issue with the .sjs file that you have shared with us. Could you kindly share the following info:

    1. Could you kindly clarify what do you mean by your statement “After some changes, some SJS files started to display the error message”. What are the changes you have made? Could you kindly explain the changes you have made and how exactly you have made all the changes?

    2. Also, kindly share the original .sjs file that you were using and the changes you have made so that we could investigate the issue at our end and could assist you accordingly.

    Please note that directly modifying the contents of the .sjs files (like changing the properties of the json files when extracting the .sjs file) is not recommended and it may bring unexpected result.

    A sample along with the steps reproducing the issue will be very helpful.

    Regards,

    Ankit

  • Posted 19 October 2023, 12:06 am EST

    Hi Ankit!

    Unfortunately, in this case, I don’t have this information. The user created this spreadsheet and has been working on it over the past few days. Therefore, they can’t precisely describe to me what changes caused this error.

    Regarding the modification of SJS properties, it is not our intended approach either, but for now, it was the only way to unlock the application. Do you have any suggestions for us to fix the file in these cases without the need for manual property adjustments?

  • Posted 20 October 2023, 1:23 am EST

    Hi,

    It is not recommended to make modifications to the file directly. Also, without the sample replicating the issue or the exact steps, we couldn’t comment on the nature of the issue and offer a solution for the fix.

    I couldn’t find a solution to fix this kind of files as directly changing these files may bring some other issues as well. The devs will also need a sample or steps to debug the cause and provide a solution to this issue. It would be really helpful if you could provide us a sample or steps to reproduce the issue.

    Regards,

    Ankit

  • Posted 20 October 2023, 4:16 am EST

    Hi, Ankit!

    Ok, I understand. But do you have any suggestions on what we could log? Since the user has access to the application and can make a wide range of changes, it would be impractical to create logs for every single action they take.

    As the error is related to borderItems, could it be related to cell customization? For instance, could be a specific style that the user is applying? Or perhaps, any style imported from an unsupported XLS?

  • Posted 22 October 2023, 10:48 pm EST

    Hi,

    I do understand that it would be really hard to log all the actions performed by the user.

    Yes, the issue might be related to cell customization, but it could only be verified when we have a sample and proper step.

    However, since, the issue seems to be related with the styling, you could try to log the actions related to cell customizations like applying the styles on the cell range. Also, if the user loads any particular “.sjs” file or “.xlsx” file and then they perform some actions, kindly share the original file also.

    Regards,

    Ankit

  • Posted 24 October 2023, 3:54 am EST

    Hi Ankit!

    We are running some tests in our application, but we’ve come across some difficulties.

    Can you let us know which tab that borderItem refers to?

    This information could make debugging a lot easier for us.

    Thanks in advance,

    Marcio

  • Posted 24 October 2023, 10:06 pm EST

    Hi Marcio,

    I couldn’t understand what you mean by the following line. Could you kindly elaborate?

    Can you let us know which tab that borderItem refers to?

    Regards,

    Ankit

  • Posted 25 October 2023, 5:44 am EST

    Hi Ankit

    The user’s SJS file has 7 sheets. Would it be possible to find out if the “borderItems” property refers to any of them? If so, which one?

  • Posted 25 October 2023, 7:59 pm EST

    Hi Marcio,

    We are sorry but how the json(s) are prepared and the mapping related to the creation of json(s) is not available public and currently we cannot find out the sheet to which the “borderItems” property refers to.

    Regards,

    Ankit

  • Posted 26 October 2023, 6:50 am EST

    Hi Ankit,

    We finally managed to find an SJS file that generates NaN in the borderItems property.

    I put it inside a folder and generated a compressed zip file:

    folder with sjs file 20231026.zip

  • Posted 26 October 2023, 6:20 pm EST

    Hi Marcio,

    Thanks for sharing the “.sjs” file with us. I was able to reproduce the issue with the latest version of SpreadJS v16.2.5 and hence I have escalated it to the concerned dev team for further investigation.

    The internal tracking id for the same is: SJS-20919. I will let you know when there is further information on this from the dev team.

    Regards,

    Ankit

  • Posted 2 November 2023, 11:54 pm EST

    Hi!

    Any updates on this topic?

  • Posted 5 November 2023, 9:37 pm EST

    Hi,

    The devs have mentioned that after deep checking, SpreadJS should not generate such “sjs” file, the borderItems type is not correct.

    The devs wanted to know how you have generated such “sjs” file. Could you kindly let us know the exact steps after which the user has generated the file? Without the exact steps, we couldn’t determine the exact cause of the issue.

    Regards,

    Ankit

  • Posted 5 November 2023, 11:21 pm EST

    As I explained previously, we cannot control this.

    Is it possible to at least implement a workaround to show a warning to the user when they attempt to save and encounter this situation? It would be more advantageous for us if they are unable to persist the changes rather than being able to save and then not being able to open the file later."

  • Posted 6 November 2023, 10:54 pm EST

    Hi Marcio,

    Without the sample replicating the issue, we cannot move ahead with the workaround or the fix. We had already escalated the issue to the dev team with the sjs file that you shared with me earlier.

    However, the devs have mentioned that SpreadJS cannot generate such kind of file. The developers wanted to know how exactly you have generated the file?

    Are you using the SpreadJS Designer’s UI to perform the actions and generate the file? Or are you using the APIs to perform the actions and then generate the sjs file. If you are using the APIs to perform the actions, kindly let us know the steps.

    We do understand that it is not possible to log all the actions but since it is related to the styling, could you kindly confirm what actions the user performs related to styling so that we could replicate the issue at our end?

    Even for the dev team, without a sample demonstrating the issue, they cannot provide a solution for that. Therefore, I request you to provide the steps or a sample that demonstrates the creation of the sjs file.

    Regards,

    Ankit

Need extra support?

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

Learn More

Forum Channels