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, TBXExtItems, TBX, 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: TTBXItem;
    procedure actExportarRTFExecute(Sender: TObject);
  end;


implementation

{$R *.dfm}

uses
  uAlbaranesClienteReportController;

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

  AListaID := TStringList.Create;
  try
    AListaID.CommaText := Self.ListaID;
    for I := 0 to AListaID.Count - 1 do
      (Controller as IAlbaranesClienteReportController).ExportToWord(StrToInt(AListaID[I]));
  finally
    FreeAndNIL(AListaID);
  end;
end;

end.
