fpspreadsheetgrid - Printing lazarus / 49-FPSpreadsheet ---------------------------------------------------------------------- seghele0 · 2021-11-26 12:48 Lazarus 2.0.10 + Windows 11. Would like to print the 'sWorksheetGrid'. The content of the 'xlsx' file has several pages. Can someone help me with the necessary code? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,  Printers, PrintersDlgs,  fpstypes, fpspreadsheetctrls,fpspreadsheetgrid, fpsopendocument,  fpsutils, fpspreadsheet, fpsallformats;type  { TForm1 }  TForm1 = class(TForm)     ButtonLOADXLSX: TButton;     Button2: TButton;     ButtonPrintGO: TButton;     PrintDialog1: TPrintDialog;     sWorksheetGrid1: TsWorksheetGrid;     procedure ButtonLOADXLSXClick(Sender: TObject);     procedure Button2Click(Sender: TObject);     procedure ButtonPrintGOClick(Sender: TObject);  private    var Nameworksheet : String;  public  end; var  Form1: TForm1;  MyDir : String; implementation {$R *.lfm} { TForm1 }procedure TForm1.Button2Click(Sender: TObject);begin  Close;end; procedure TForm1.ButtonLOADXLSXClick(Sender: TObject);begin  Nameworksheet:= '1.xlsx';  sWorksheetGrid1.LoadFromSpreadsheetFile(Nameworksheet);end; procedure TForm1.ButtonPrintGOClick(Sender: TObject);begin  if PrintDialog1.Execute then  begin    // ????????  end;end;end. ---------------------------------------------------------------------- wp · 2021-11-26 13:11 Printing of a worksheet is not supported by fpspreadsheet directly. Of course, you can print it like you would print a stringgrid (e. g. https://www.swissdelphicenter.ch/en/showcode.php?id=769). But note that this does not handle the special cases of all the cell formats, merged cells, embedded images, headers, footers, etc. ---------------------------------------------------------------------- seghele0 · 2021-11-26 13:31 I'll try it. Thanks.