Cell size and word wrap lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- Ask · 2012-06-01 23:04 If I understand correctly, fpspreadsheet does not support setting cell sizes and word wrapping. Are there any plans for that? An estimate of the amount of work involved? I have mistakenly recommented fpspreadsheet to my students as a method to export reports generated by their applications to Excel -- now they all fail their assignment. I now have to either find a quick fix or cancel the assignment. ---------------------------------------------------------------------- felipemdc · 2012-06-03 16:21 For which format? xls or xlsx? ---------------------------------------------------------------------- Ask · 2012-06-13 04:30 Any one -- this was just a student project. Sorry -- I somehow missed your reply. I have already dropped the assignment I mentioned as impossible one. Maybe next year :-) ---------------------------------------------------------------------- felipemdc · 2012-06-13 06:54 I started investigating what would take to implement this on OpenDocument and: 1> There is no such thing as cell size. There is column size and row size, which one do you need? Both? This will need adding a list of rows and a list of columns to each worksheet. 2> Word-wrap seams easy to implement, it is just a another formatting setting for a cell ---------------------------------------------------------------------- felipemdc · 2012-06-13 07:21 I added support for word-wrap in OpenDocument in rev 2463 ---------------------------------------------------------------------- dcminus · 2013-08-15 08:27 Quote from: felipemdc on June 13, 2012, 08:54:24 am1> There is no such thing as cell size. There is column size and row size, which one do you need? Both? This will need adding a list of rows and a list of columns to each worksheet. I know this topic is old, but I think my question is related. I am trying to use TSWorksheetGrid for my app to import and present data to the user. I would like to resize my columns based on their content length. Is there a function to do this? Thanks in advance, DC PS.: Sorry if it is very trivial, just started to use Lazarus yesterday ---------------------------------------------------------------------- typo · 2013-08-15 12:58 Maybe this? Code: [Select]procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;   aRect: TRect; aState: TGridDrawState); begin   if StringGrid1.ColWidths[ACol] < Canvas.TextWidth(StringGrid1.Cells[ACol, ARow]) + 10  then     StringGrid1.ColWidths[ACol] := Canvas.TextWidth(StringGrid1.Cells[ACol, ARow]) + 10; end; ---------------------------------------------------------------------- dcminus · 2013-08-15 13:52 Brilliant! Just what I was after.  Thanks a lot typo!