Recent

Author Topic: Auto-Fit multiple columns  (Read 8321 times)

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Auto-Fit multiple columns
« Reply #15 on: January 30, 2018, 12:44:02 pm »
Nice. Any special reason why the standard TBitmap is not enough? Not sure whether "if Worksheet.IsMerged(Cell) then continue" is correct - I think this skips the base of the merged block. Probably better to use "if Worksheet.IsMerged(Cell) and not Worksheet.IsMergeBase(Cell) then continue".

Hafedh TRIMECHE

  • New Member
  • *
  • Posts: 32
Re: Auto-Fit multiple columns
« Reply #16 on: January 30, 2018, 12:59:13 pm »
The code is recovered from the procedure:
Code: Pascal  [Select][+][-]
  1. procedure TsCustomWorksheetGrid.AutoAdjustColumn(ACol: Integer);
  2.  
Code: Pascal  [Select][+][-]
  1. for cell in Worksheet.Cells.GetColEnumerator(GetWorkSheetCol(ACol)) do
  2.   begin
  3.     // Merged cells are not considered for calculating AutoColWidth -- see Excel.
  4.     if Worksheet.IsMerged(cell) then
  5.       continue;                                      
  6.  

TBGRABitmap is replaced by TBitmap. I guessed that TBGRABitmap is best in term of performance.

Would the PDF export functionality be added to FPSpreadsheet package?

Regards.

wp

  • Hero Member
  • *****
  • Posts: 11916
Re: Auto-Fit multiple columns
« Reply #17 on: January 30, 2018, 01:24:29 pm »
The code is recovered from the procedure:
Code: Pascal  [Select][+][-]
  1. for cell in Worksheet.Cells.GetColEnumerator(GetWorkSheetCol(ACol)) do
  2.   begin
  3.     // Merged cells are not considered for calculating AutoColWidth -- see Excel.
Ah, I remember...

Would the PDF export functionality be added to FPSpreadsheet package?
Certainly not to the basic fpspreadsheet package, I try to keep packages as slim as possible. But another dedicated package would be worth considering. Unfortunately I don't have the time at the moment-

 

TinyPortal © 2005-2018