unit uEditorAlbaranesClienteReport;

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,  SpTBXItem, TB2Item, TB2Dock, TB2Toolbar, pngimage,
  ExtCtrls, JvExControls, JvComponent, JvNavigationPane, uIEditorAlbaranesClientePreview,
  JvExComCtrls, JvStatusBar, frxDMPExport, frxGradient, frxChBox, frxCross,
  frxRich, frxOLE, frxBarcode, JvAppStorage, JvAppRegistryStorage,
  JvComponentBase, frxExportText, frxExportRTF, frxExportMail, frxExportXLS;

type
  TfEditorAlbaranesClientePreview = class(TfEditorPreview, IEditorAlbaranesClientePreview)
    TBXItem58: TSpTBXItem;
    procedure actExportarRTFExecute(Sender: TObject);
  end;


implementation

{$R *.dfm}

uses
  uAlbaranesClienteReportController, uDialogUtils;

procedure TfEditorAlbaranesClientePreview.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 IAlbaranesClienteReportController).ExportToWord(ListaID[I]) then
      ShowInfoMessage('El albarán se ha exportado correctamente.');    
end;

end.
