Spreadjs Sheet Compression Issue

Posted by: seshareddy.kamaganiguntla on 30 January 2022, 10:24 pm EST

  • Posted 30 January 2022, 10:24 pm EST

    We are using SpreadJs JSON , to show the sheet . But sometimes sheet getting compressed , although we are doing autoFitColumn for every column. Any possible solution or fix for this?
  • Replied 31 January 2022, 8:24 pm EST

    Hi,
    We were unable to replicate the issue at our end. Please share a sample replicating the issue so that we can investigate at our end and assist you accordingly.

    I have used this demo to check for autoFitColumn and it seems to be working fine: https://www.grapecity.com/spreadjs/demos/features/workbook/json-serialization/purejs

    Regards.
  • Replied 9 February 2022, 5:03 pm EST

    Hi,
    Sorry for the late response , we are using code sample similar to it for AutoFit column.Is there anything wrong here, as it is causing , sheet compression issue sometimes

    let _oldFn = GC.Spread.Sheets.CellTypes.Base.prototype.getAutoFitWidth;
    GC.Spread.Sheets.CellTypes.Base.prototype.getAutoFitWidth = function () {
    let minWidth = DEFAULT_CELL_WIDTH;
    let width = _oldFn.apply(this, arguments as any);
    return Math.max(minWidth, width);
    };

    const initSpreadData = useCallback(
    (spread: GC.Spread.Sheets.Workbook) => {
    spread.fromJSON(sheetData.current);
    spread
    .commandManager()
    .setShortcutKey('', GC.Spread.Commands.Key.z, true, false, false, false);
    spread.options.allowContextMenu = false;
    spread.options.tabStripVisible = false;
    spread.options.showHorizontalScrollbar = true;
    spread.options.showVerticalScrollbar = true;
    spread.options.scrollbarMaxAlign = true;
    spread.options.scrollByPixel = true;
    spread.options.allowUserDragDrop = false;
    let sheet = spread?.getActiveSheet();
    sheet.suspendPaint();
    for (let i = 0; i < sheet?.getColumnCount() ?? 0; i++) {
    sheet.autoFitColumn(i);
    }
    sheet.options.rowHeaderVisible = false;
    sheet.options.colHeaderVisible = false;
    //sheet.options.isProtected = true;
    sheet.options.protectionOptions.allowEditObjects = false;
    sheet.showRowOutline(true);
    sheet.resumePaint();
    spreadRef.current = spread;
    setSpread(spread);
    },
    []
    );
  • Replied 10 February 2022, 11:26 pm EST

    Hi,

    We are still unable to replicate the issue at our end. We request you to share a sample (with Excel/json file) replicating the issue so that we can investigate at our end and assist you accordingly.

    You can also share your excel file/json file on our private portal by creating a new case on: https://www.grapecity.com/my-account/my-support

    Regards.
Need extra support?

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

Learn More

Forum Channels