Visible property

Posted by: thomas-starkweathercircor-com on 8 September 2017, 3:17 pm EST

  • Posted 8 September 2017, 3:17 pm EST

    FpSpread1.Sheets(1).Visible = False;

    If I have a sheet that I do not want the users to see I can use the Visible property. However, I am having issues when using this.

    I have a sheet that has calculated data that is displayed on the main sheet. I want the users to interact with the main sheet without seeing the sheet that has the calculations on it. When I set this sheet Visible to false my program will crash when interacting on the main sheet.

    If I set visible to true on the calculation sheet everything works.

    Is there a mechanism that allows me to block access to the entire sheet that will still allow it to function?
  • Replied 8 September 2017, 3:17 pm EST

    Ankita,


    If you have 3 sheets and sheet 1 has formulas that are dependent on items that are on sheet 3 can you hide sheet 3 and have all the formulas on sheet 1 working.

    THus the question: Does the visible property have any impact on the sheet outside of not showing it. Does the sheet index numbers all stay the same? My application is a very large spreadsheet attached to a fairly large application. THus it is complicated getting samples of what is occurring.

    If I have time I will try to make a small sample with this behavior.

    Thanks
  • Replied 8 September 2017, 3:17 pm EST

    Hello Thomas,

    I would like you to know that there are no issues on setting the 'Visible' property of a Sheet to 'False' even if that sheet is used as a reference sheet(used in formulas) in some other sheet in Spread.

    Also the sheet indexing does not change on hiding the sheet i.e. on setting the 'Visible' property of a Sheet to 'False'.

    Kindly refer the attached sample depicting the same.

    Regards,
    Ankita
    2015/01/Spread_SheetVisible.zip
  • Replied 8 September 2017, 3:17 pm EST

    Hello Thomas,

    I was unable to replicate the mentioned issue at my end. Kindly refer the attached sample for the same. The application did not crash on setting the "Visible" property of a referenced sheet to 'false'.

    I would request you to please modify the attached sample and send it back to us so that we may replicate the issue at our end and hence help you further in this issue.
    2015/01/Spread_Load1.zip
  • Replied 8 September 2017, 3:17 pm EST

    Ankita,

    Try this...

    Have your spread sheet with multiple sheets.

    fpspread.Sheets[1].Visible = False;
    fpspread.ActiveSheet = 1;
    cstr[0] = fpSpread.ActiveSheet.GetText(2, 2); // THIS STATEMENT CRASHES....


    I want to hide the sheet from the user from seeing. But I need to extract information from this sheet. Both formulas, and data to fill comboboxes on sheet[0]....

    Thanks
  • Replied 8 September 2017, 3:17 pm EST

    fpSpread3.ActiveSheetIndex = 0;
    FarPoint.Win.Spread.CellType.ComboBoxCellType cbcell = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
    fpSpread3.Sheets[1].Visible = true;
    fpSpread3.ActiveSheetIndex = 1;
    cstr[0] = fpSpread3.ActiveSheet.GetText(60, 5);
    cstr[1] = fpSpread3.ActiveSheet.GetText(61, 5);
    cstr[2] = fpSpread3.ActiveSheet.GetText(62, 5);
    cstr[3] = fpSpread3.ActiveSheet.GetText(63, 5);
    cstr[4] = fpSpread3.ActiveSheet.GetText(64, 5);
    cbcell.Items = cstr;
    fpSpread3.Sheets[1].Visible = false;
    fpSpread3.ActiveSheetIndex = 0;
    fpSpread3.ActiveSheet.Cells[33, 8].CellType = cbcell;


    If I set the visible to true than get the GetText then set to false I do not get the error....

    Thus I guess having the Visible set to False you do lose functionality in code..
  • Marked as Answer

    Replied 8 September 2017, 3:17 pm EST

    Hello Thomas,

    I am really sorry to mention but I was unable to replicate the mentioned issue. I was able to access the data on the sheet for which the 'Visible' property was set to 'false'.

    Please refer the attached sample which I have modified according to the above code you provided.

    I would request you to please modify the attached sample such that it produces the issue so that we may replicate the same at our end and hence provide you a solution.

    Regards,
    Ankita
    2015/01/Spread_SheetVisible_Modified.zip
Need extra support?

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

Learn More

Forum Channels