Ability to add delete and modify workbook custom properties

Posted by: dean.kinnear on 4 January 2023, 12:51 pm EST

    • Post Options:
    • Link

    Posted 4 January 2023, 12:51 pm EST - Updated 4 January 2023, 12:58 pm EST

    Does spread js have the ability to read, write and/or modify a workbook’s custom document properties?

  • Posted 4 January 2023, 8:38 pm EST

    Hi,

    If I understand correctly, you want to change the Excel custom property in spreadJS. If that is the case, then it would not be possible to edit this in spreadJs. We are sorry for the inconvenience.

    Further, if it is not your question, please explain more about the use case that you want to implement so that we can have a better understanding of the issue and help you accordingly.

    Regards,

    Avinash

  • Posted 28 March 2023, 2:36 am EST

    Would it be possible to request this as a feature?

    Thanks,

    Dean

  • Posted 29 March 2023, 2:23 am EST

    Hello,

    We have created an enhancement request for this feature. We will keep you updated regarding any progress on this. We will update you regarding this as we get any information from the team. The internal ID for this issue will be SJS-17605.

    regards,

    Avinash

  • Posted 11 October 2023, 3:45 pm EST

    Hi,

    The team informed us that if you import an Excel file into SpreadJS and then export it, the custom property info will not be lost, as SpreadJS only supports lossless editing for custom file properties. There is a small bug related to this that the team found, and they will be fixing it in the next biweekly release (October 12th, this Thursday). However, it does appear that you want to edit these properties in the Designer or by using API, which is something we don’t have planned, and the priority is low as nothing else in SpreadJS uses these properties.

    Regards,

    Avinash

  • Posted 16 October 2023, 10:30 pm EST

    Mostly we just want to read the custom properties.

  • Posted 17 October 2023, 9:21 pm EST - Updated 17 October 2023, 9:27 pm EST

    Hi,

    Please note that SpreadJS preserves the custom properties of the xlsx file when xlsx files are imported and then exported. However, SpreadJS does not support APIs/UI for reading/editing of custom properties of xlsx file as mentioned in the previous reply.

    If you want to read the custom properties of the xlsx file then you can parse the xml of the xlsx file and get the custom properties. The xlsx file is basically a zipped folder and the custom properties are saved in “docProps/custom.xml” file of the unzipped folder of the xlsx file.

    Please refer to the attached sample and gif for more understanding.

    sample: https://jscodemine.grapecity.com/share/ikZGzGvjtkSbHcfYlS7RWw/?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["%2Findex.html"]%2C"ActiveFile"%3A"%2Findex.html"}

    In the attached sample, the “jszip” and “x2js” javascript packages are used. The jszip is used to unzip the excel file and get the xml file with custom properties and the x2js package is used to convert the xml to json so that custom properties could be read easily.

    Regards

Need extra support?

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

Learn More

Forum Channels