Archive Report from Archive file
I am working with Report builder Version 6 and Delphi version 6
I wanted to read the latest archive report generated but all I am getting is
the same report. again and again
what am I doing wrong here?? please help
field)created into the following path successfully. C:\tem\archive.rtm
const ArchiveFile = 'C:\temp\archive.rtm';
procedure TfrmMainMenu.BbtnLoadReportClick(Sender: TObject);
var TempStream : TMemoryStream;
begin
TempStream := TMemoryStream.Create;
( stores data in dynamic memory}
if MessageDlg('Print Selected Field. Are you sure?',mtConfirmation,[mbYes,
mbNo],0) = mrYes then
begin
with dbgLoadTemplate.SelectedField do
{select the field from DBGrid}
dmLetterHead.sqlLettersTemplate.SaveToStream(TempStream);
{Get the Blob field and save into memorystream}
TempStream.SaveToFile(ArchiveFile);
{Save the file into Archive path in the locakl machine}
ppReportLoadTemplate.ArchiveFileName := (ArchiveFile);
ppReportLoadTemplate.Print;
{Print report with report builder component}
TempStream.free;
end;
end;
Note I can load the report at design time manual. not at run time
any help appreciated
Sharma
I wanted to read the latest archive report generated but all I am getting is
the same report. again and again
what am I doing wrong here?? please help
field)created into the following path successfully. C:\tem\archive.rtm
const ArchiveFile = 'C:\temp\archive.rtm';
procedure TfrmMainMenu.BbtnLoadReportClick(Sender: TObject);
var TempStream : TMemoryStream;
begin
TempStream := TMemoryStream.Create;
( stores data in dynamic memory}
if MessageDlg('Print Selected Field. Are you sure?',mtConfirmation,[mbYes,
mbNo],0) = mrYes then
begin
with dbgLoadTemplate.SelectedField do
{select the field from DBGrid}
dmLetterHead.sqlLettersTemplate.SaveToStream(TempStream);
{Get the Blob field and save into memorystream}
TempStream.SaveToFile(ArchiveFile);
{Save the file into Archive path in the locakl machine}
ppReportLoadTemplate.ArchiveFileName := (ArchiveFile);
ppReportLoadTemplate.Print;
{Print report with report builder component}
TempStream.free;
end;
end;
Note I can load the report at design time manual. not at run time
any help appreciated
Sharma
This discussion has been closed.
Comments
As a test, try creating a query to get the desired single archive record
instead of relying on the grid to point at the correct record in the
dataset. See if you can load them that way. Otherwise, I would suggest
upgrading to RB 7 and use the DBArchiveReader component.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com