Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvStringGrid
Using TAdvStringGrid printer settings dialog combined with printer selection.

This code snippet shows how you can show the print setup dialog for users after which the printer selection is done.
procedure TForm1.PrintGrid;
begin
  AdvGridPrintSettings.Form.Caption := 'Print overview';
  AdvStringGrid.PrintSettings.FitToPage := fpAlways;
  AdvStringGrid.PrintSettings.Orientation := poLandscape; // initialize to default poLandscape
  if AdvGridPrintSettings.Execute then
  begin
    Printer.Orientation := AdvStringGrid.PrintSettings.Orientation;
    if PrinterSetupDialog.Execute then
    begin
      AdvStringGrid.PrintSettings.Orientation := Printer.Orientation;
      AdvStringgrid.Print;
    end;
  end;
end;