TprxADODataSet Options Impresion RB

De Pragma Wiki
Ir a la navegación Ir a la búsqueda

Descripción

El componente TprxADODataSet_Options_Impresion_RB (Componente ancestro para imprimir usando reportBuilder.) implementa la funcionalidad básica para los reportes diseñados con Report Builder.

Identidad

Declaración pipelines

Los pipelines son componentes de Report Builder que representan a cada dataset de una pantalla.

type
  TprxRB_Pipeline = class(TppDBPipeline)
  private
    FPRINT_SQL: TStringList;
    FPRINT_PARSER: Tfva_parser_fbn;
  protected
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;

    property    PRINT_SQL: TStringList read FPRINT_SQL write FPRINT_SQL;
    property    PRINT_PARSER: Tfva_parser_fbn read FPRINT_PARSER write FPRINT_PARSER;
  end;

Declaración

type
  TprxADODataSet_Options_Impresion_RB = class(TprxADODataSet_Options_Impresion)
  private
    FReportType: TprxClassImpresionReportBuilderType;
    FReportRB: TppReport;
    FReportList: TStringList;
    FDesignerRB: TppDesigner;

    FTexto_Imprimir: String;
    FTexto_Diseñar: String;
    FTexto_AgregarUnReporte: String;
    FTexto_AgregarUnComprobante: String;

    // 04/06/2019...

    FPRINT_SQL: TStringList;
    FPRINT_QRY: TprxADOQuery;
    FPRINT_DATASET: TDataSet;
  protected
    Pipelines: array[1..maxPipelines] of TprxRB_Pipeline; // TppDBPipeline;
    PipelinesCount: Integer;

    procedure   Set_argDataSet(aValue: TDataSet); override;

    function    NewReportName: String; virtual;

    function    Comprobante: String;

    function    StripReportName(var aCaption: String): Boolean;

    procedure   PrintReport(aReportName: String);

    procedure   PrintReportClick(Sender: TObject); overload;
    procedure   PrintReportClick(aCaption: String); overload;

    procedure   DesignReportClick(Sender: TObject); virtual;
    procedure   AddReportClick(Sender: TObject);

    property    ReportType: TprxClassImpresionReportBuilderType read FReportType write FReportType;
    property    ReportRB: TppReport read FReportRB write FReportRB;
    property    ReportList: TStringList read FReportList write FReportList;
    property    DesignerRB: TppDesigner read FDesignerRB write FDesignerRB;

    property    Texto_Imprimir: String read FTexto_Imprimir write FTexto_Imprimir;
    property    Texto_Diseñar: String read FTexto_Diseñar write FTexto_Diseñar;
    property    Texto_AgregarUnReporte: String read FTexto_AgregarUnReporte write FTexto_AgregarUnReporte;
    property    Texto_AgregarUnComprobante: String read FTexto_AgregarUnComprobante write FTexto_AgregarUnComprobante;

    property    PRINT_SQL: TStringList read FPRINT_SQL write FPRINT_SQL;
    property    PRINT_QRY: TprxADOQuery read FPRINT_QRY write FPRINT_QRY;
    property    PRINT_DATASET: TDataSet read FPRINT_DATASET write FPRINT_DATASET;
  public
    constructor Create(AOwner: TComponent); override;
    destructor  Destroy; override;

    function    ReportFolder: String;

    function    CargarDefinicion: Boolean; virtual;
  published
  end;

Implementación

function Comprobante: String

Si el dataset corresponde a un comprobante retorna el código del documento de impresión, lo tenemos que poner acá para que lo usen las clases derivadas de ésta.

procedure PrintReport(aReportName: String)

Imprime el reporte que estamos procesando.

procedure PrintReportClick(Sender: TObject)

Recibe instrucción de imprimir un reporte desde un menú, toma el nombre del reporte y llama a la función anterior.

procedure PrintReportClick(aCaption: String)

Similar anterior, pero recibe un string con el nombre del reporte como argumento.

procedure DesignReportClick(Sender: TObject)

Abre el diseñador de reportes para modificar el reporte.

procedure AddReportClick(Sender: TObject)

Abre el diseñador de reportes para agregar uno.

Uso

Se usa en las derivadas: