Sales Report Form

The MainModule already includes most of the functionality required for producing reports. Using the data module reportDM, it creates a PDF report on the server. The Sales Report Form shows the PDF report according to the target platform.

dSalesReport

This form exposes a property for receiving the filename (URL) of the PDF report before showing it. A full PDF Viewer (which can also download, print, and execute other actions) is already part of the uniGUI palette (available for both platforms).

unit _dSalesReportForm;
unit _dSalesReportForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics,
  Controls, Forms, uniGUITypes, uniGUIAbstractClasses,
  uniGUIClasses, uniGUIForm, uniGUIBaseClasses, uniURLFrame;

type
  TdSalesReportForm = class(TUniForm)
    UniPDFFrame1: TUniPDFFrame;
  private
    procedure SetPDFUrl(const Value : string);
  public
    property PDFUrl : string write SetPDFUrl;
  end;

function dSalesReportForm: TdSalesReportForm;

implementation

{$R *.dfm}

uses
  MainModule, uniGUIApplication;

function dSalesReportForm: TdSalesReportForm;
begin
  Result := TdSalesReportForm(UniMainModule.GetFormInstance(TdSalesReportForm));
end;

{ TdSalesReportForm }

procedure TdSalesReportForm.SetPDFUrl(const Value : string);
begin
  UniPDFFrame1.PdfURL := Value;
end;

end.