Incorrect column gets hidden with column width zero

Posted by: pooja.bansal on 27 September 2023, 3:30 pm EST

  • Posted 27 September 2023, 3:30 pm EST

    Hello,

    In our application we have desktop client as well as web-client.

    In desktop client we are using Far Point and in web-client we are using Spread 16.2.0

    We are creating data in desktop client code using far point and then passing it into Spread js.

    Ex - In the template excel we have hidden column no - 12 and hence that column it is not showing up in desktop client. However, when we pass that data into spread it is hiding column number 11 and showing hidden column 12.

    Is there anything you can help us in this?

    Please reply asap.

    Regards

    Pooja Bansal

  • Posted 27 September 2023, 8:37 pm EST

    Hi Pooja,

    It seems like you are using the SpreadJS with the Grapecity’s SpreadJS Winforms. I hide a column using the SpreadJSWinforms, export the excel file and then load the exported excel file in the SpreadJS and it seems to be working fine at my end.

    I have used the Spread WinForms Version 16.2.20231.0 (16.2.0) and the SpreadJS Version V16.2.3 (latest version).

    I have attached the excel file generated by the Spread WinForms and then loading the excel file in the SpreadJS at hosted SpreadJS Designer: https://www.grapecity.com/spreadjs/designer/index.html

    Could you kindly try with the latest version of the Spread WinForms and the SpreadJS?

    If the issue still persists for you, kindly share us a minimal working sample replicating the issue so that we could investigate the issue at our end and could assist you accordingly. Also, mention the steps to reproduce the issue.

    Regards,

    Ankit

    winforms_export.zip

  • Posted 27 September 2023, 8:39 pm EST

  • Posted 2 October 2023, 2:54 pm EST

    Hello,

    On basis of which property it hides the column in Far Point and Spread Js. We can check that and compare.

    Regards

    Pooja Bansal

  • Posted 2 October 2023, 11:51 pm EST

    Hi Pooja,

    In the Spread Winforms, you could use the visible property of the Column class to get/set whether the column is visible. For example, refer to the following code snippet snippet:

            private void Form1_Load(object sender, EventArgs e)
            {
                // Check if the column with index 3 is hidden
                //fpSpread1.ActiveSheet.Columns[3].Visible
                
                // Hide the Column with Index 3
                fpSpread1.ActiveSheet.Columns[3].Visible = false;
            }
    

    You could refer to the attached WinForms Sample in which the Column with index 3 is hidden and you could export the excel file.

    In case of SpreadJS, you could use the getColumnVisible() method to check whether a column in the specified area is displayed. Refer to the following code snippet:

    
    document.getElementById("btn").addEventListener("click", function() {
        let activeSheet = spread.getActiveSheet();
        console.log("Column A Visible: " + activeSheet.getColumnVisible(0));
        console.log("Column D Visible: " + activeSheet.getColumnVisible(3));
    })

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

    In the sample, import the exported excel file from WinForms and click on the “GetColumnVisible” to check if the column is visible. I have used the SpreadJS Designer to ease the import/export of excel file. The same works if you use only the SpreadJS( without the designer).

    References:

    SpreadJS getColumnVisible method: https://www.grapecity.com/spreadjs/api/v15/classes/GC.Spread.Sheets.Worksheet#getcolumnvisible

    Spread WinForms Visible Property: https://www.grapecity.com/spreadnet/docs/latest/online-win/FarPoint.Win.Spread~FarPoint.Win.Spread.Column~Visible.html

    Regards,

    Ankit

    HideColumnFpSpread.zip

Need extra support?

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

Learn More

Forum Channels