unit uEditorFacturasClienteReport;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, uEditorPreview,
{  frxExportImage, frxExportPDF, frxDCtrl, frxClass, frxDMPExport, frxGradient,
  frxChBox, frxCross, frxRich, frxChart, frxOLE, frxBarcode,
}
  JvAppStorage, JvAppRegistryStorage, JvComponentBase,
  JvFormPlacement, ImgList, PngImageList, StdActns, ActnList, ComCtrls,
  TB2ExtItems, TBXExtItems, TBX, TB2Item, TB2Dock, TB2Toolbar, pngimage,
  ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uIEditorFacturasClientePreview,
  JvExComCtrls, JvStatusBar, frxExportText, frxExportRTF, frxExportMail,
  frxExportXLS, frxExportImage, frxExportPDF, frxClass, frxDCtrl, frxGradient,
  frxChBox, frxCross, frxRich, frxOLE, frxBarcode;

type
  TfEditorFacturasClientePreview = class(TfEditorPreview, IEditorFacturasClientePreview)
    TBXItem58: TTBXItem;
    procedure actExportarRTFExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;


implementation

{$R *.dfm}

uses
  uFacturasClienteReportController, uIntegerListUtils, uDialogUtils;

procedure TfEditorFacturasClientePreview.actExportarRTFExecute(Sender: TObject);
var
  I: Integer;
begin
  // inherited; <- No llamar al padre
  if not Assigned(Controller) then
    raise Exception.Create('No se ha asignado el controlador necesario');

  for I := 0 to ListaID.Count - 1 do
    if (Controller as IFacturasClienteReportController).ExportToWord(ListaID[I]) then
      ShowInfoMessage('La factura se ha exportado correctamente.');
end;

end.
