Arquivos *.rtm em tempo de excução

Delphi

22/01/2004

:cry: Amigos estou lendo um arquivo *.rtm em tempo de excução e não consigo jogar as informações nas lables deste arquivo.
Alguem saberia me dizer como posso fazer isso.
Antecipadamente agradeço qualquer resposta.


Targinosilveira

Targinosilveira

Curtidas 0

Respostas

Aroldo Zanela

Aroldo Zanela

22/01/2004

Colega,

Você pode detalhar melhor sua dúvida?


GOSTEI 0
Targinosilveira

Targinosilveira

22/01/2004

Caro amigo Aroldo ai vai o codigo com explicações de como estou procedendo, se vocês puderem me dar uma força sera muito importante pra mim, também acredito que pra toda comunidade Delphiana pois poderes deixar nossos softwares mais leves sem entregar-mos de mao beijada os nossos arquivos de relatorios gerados pelo ReportBuilder.

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ppComm, ppRelatv, ppProd, ppClass, ppReport, ppBands, ppCache, ppDB, ppVar, ppCtrls; type TForm1 = class(TForm) Button1: TButton; RpGeral: TppReport; ppDetailBand1: TppDetailBand; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure RpGeralBeforePrint(Sender: TObject); procedure ppDetailBand1BeforePrint(Sender: TObject); private { Private declarations } DLLITS : THandle; TempFileList : TStringList; public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin TempFileList := TStringList.create; //----------------------------------------------- //- Le A DLL com os Arquivos com extensao (*.rtm) //- do ReportBuilder //----------------------------------------------- DLLITS := LoadLibrary(´DLLITSFIS.DLL´); end; procedure TForm1.Button1Click(Sender: TObject); var ResSt : TResourceStream; TempFile, TempPath : pchar; begin //---- Chama o arquivo ´DECLARAFISCAL´ em forma de relatorio //---- do Builder IF DLLITS=0 then exit; ResSt := TResourceStream.Create(DLLITS, ´DECLARAFISCAL´, pchar(´RTM´)); try // Get the name of a valid Temporary filename is the // Windows´ default temp file name GetMem(TempPath, MAX_PATH); GetMem(TempFile, MAX_PATH); GetTempPath(MAX_PATH, TempPath); GetTempFileName(TempPath, ´RES´, 0, TempFile); // Make the file a .RTM file so TMediaPlayer can // use the correct multimedia handler StrCopy(TempFile, StrCat(TempFile, ´.RTM´)); // Add the temporary file to out temp files list // so we can delete the file one the program closes. TempFileList.add(string(TempFile)); // Finally save the resource to the temp file... ResSt.SaveToFile(string(TempFile)); // ... and open it with MediaPlayer RpGeral.Template.FileName:=string(TempFile); RpGeral.Template.LoadFromFile; //?????????????????????????????????????????????????????? //?? P E R G U N T A //?????????????????????????????????????????????????????? //?? Como devo proceder para passar valores para as //?? Label´s dentro do arquivo com extensao (*.rtm) //?? antes de imprimir. //?? Ja procurei fazer referencia a uma label, mas no //?? momento da compilacao o Delphi nao a reconhece. //?? //?? EX: Lb_Razao.Caption:= ´Dados Variaados´; //?? //?????????????????????????????????????????????????????? RpGeral.PrintReport; finally FreeMem(TempPath); FreeMem(TempFile); ResSt.free; end; end; procedure TForm1.RpGeralBeforePrint(Sender: TObject); begin RpGeral. lb_razao.Caption:=´ooooo´; end;



GOSTEI 0
POSTAR