unit uEditorPedidosProveedorReport;

interface

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

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


implementation

{$R *.dfm}

uses
  uPedidosProveedorReportController;

procedure TfEditorPedidosProveedorPreview.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 IPedidosProveedorReportController).ExportToWord(StrToInt(AListaID[I]));
	finally
	  FreeAndNIL(AListaID);
	end;
end;

end.
