* * *

Author Topic: fpSpread: Hide worksheet  (Read 260 times)

kjteng

  • Full Member
  • ***
  • Posts: 126
fpSpread: Hide worksheet
« on: July 10, 2018, 10:26:27 am »
I tried to set soHide option however the worksheets are hidden only when I open it in msOffice.   Is there a way to hide worksheet in fpSpread ?

wp

  • Hero Member
  • *****
  • Posts: 4743
Re: fpSpread: Hide worksheet
« Reply #1 on: July 10, 2018, 11:26:51 am »
In the new svn version the WorkbookTabControl has a new property "ShowAllSheets" which you must set to false in order to hide the "hidden" sheets.
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

kjteng

  • Full Member
  • ***
  • Posts: 126
Re: fpSpread: Hide worksheet
« Reply #2 on: July 11, 2018, 12:43:52 pm »
Problems with the workbooktabControl and Hidden worksheet:-
 
1.
When a sheet is marked hidden,  worksheetGrid does not hide it immediately.
I have to save the workbook and re-open it in order to see the effect.
what is the correct method to do this ?

2. 
fpspread allows all worksheets to be marked as 'hidden' (In Excel/open office at least one sheet must be visible)
If all worksheets are hidden, the last viewed worksheet would be displayed (with no tab title) in the workbookTabControl when the workbook is opened.
Use demo prgram attached: click [Hide All]->[Save]->[Open]

3.
Use demo, click [Show All]->[Save]->[Open] to unhide all sheets first then
Goto sheet 1, click [Hide current sheet]->[Save]->[Open]
Now the workbooktabControl displays Sheet2, Sheet3 and Sheet4 tabs. However the content of each tab is not correct. example sheet2 tab is showing content of sheet1 etc

Please help.

kjteng

  • Full Member
  • ***
  • Posts: 126
Re: fpSpread: Hide worksheet
« Reply #3 on: July 12, 2018, 06:55:38 pm »
Show and Hide methods (SVN6560) tested. They work fine.
Thanks
« Last Edit: July 13, 2018, 03:44:20 am by kjteng »

wp

  • Hero Member
  • *****
  • Posts: 4743
Re: fpSpread: Hide worksheet
« Reply #4 on: July 13, 2018, 02:53:53 pm »
Fixed also the problem in the TabControl that the tabindex is no longer equal to the worksheet index if there are hidden worksheets. This had caused problems when tabs of a TabControl showing such a workbook were clicked or renamed.
« Last Edit: July 19, 2018, 03:45:29 pm by wp »
Lazarus trunk / fpc 3.0.4 / all 32-bit on Win-10

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus