Skip to main content
Table of Contents

TTMSFNCDataGridPrintIO Class

Non-visual component that prints a grid to the system printer. Set DataGrid and call Print.

API unit family: TMSFNCDataGridPrintIO Inherits from: TTMSFNCCustomDataGridPrintIO

Syntax

GeneratedPascalC++
TTMSFNCDataGridPrintIO = class(TTMSFNCCustomDataGridPrintIO)
class PASCALIMPLEMENTATION TTMSFNCDataGridPrintIO : public TTMSFNCCustomDataGridPrintIO

Remarks

Use Options to control page fitting and header repetition and OnRowIsPageBreak for manual page breaks. For PDF output with the same layout options use TTMSFNCDataGridPDFIO.

Properties

Name Description
DataGrid Grid control whose content is printed. (inherited from TTMSFNCCustomDataGridPrintIO)
Options Grid-specific print options (scaling, fit to page, repeated fixed rows and columns) plus the inherited page, header and footer settings. (inherited from TTMSFNCCustomDataGridPrintIO)
Renderer Renderer that is printed when Print is called without arguments. Set automatically when DataGrid is assigned; assign it directly to print a standalone renderer. (inherited from TTMSFNCCustomDataGridPrintIO)
Version Component version string in Major.Minor.Release.Build format. (inherited from TTMSFNCCustomDataGridPrintIO)

Events

Name Description
OnRowIsPageBreak Occurs for every row before printing starts, so the application can force a page break before that row. (inherited from TTMSFNCCustomDataGridPrintIO)

Usage examples

Send a DataGrid to the system printer

Use TTMSFNCDataGridPrintIO to print the grid with fixed-row repetition and fit-to-page scaling.

Send a DataGrid to the system printerPascal
procedure TForm1.FormCreate(Sender: TObject);
begin
  PrintIO.DataGrid := Grid;

  // Repeat fixed rows/columns on every printed page so each sheet has headers.
  PrintIO.Options.RepeatFixedRows    := True;
  PrintIO.Options.RepeatFixedColumns := True;

  // Default: scale the content to fit the printable page width.
  PrintIO.Options.FitToPage := True;
end;

procedure TForm1.PrintButtonClick(Sender: TObject);
begin
  PrintIO.Print;
end;

Read the related guide

Used by