ppTextPipeline question
I am getting an access violation if i run a report and immediately run
another report when the first one has finished. I think the reason is
because the file i am using as the textpipeline filename is still being used
by the first report.
How do i sort of reset the textpipeline so it doesn't link to the last file.
I tried
ppTextPipeline.Close;
ppTextPipeline.Open;
but i just get loads of pages printed that are not required so i know this
is not the right thing to do.
Here is my existing code
procedure TfrmMainForecast.Build12MonthTextFile;
var
sFileName : string;
ReportTextFile : TextFile;
iRow,iCol : integer;
begin
// set the file name
sFileName := GetForecastDirectory + TwelveMonthForecastTextFile;
// clear the memo
ReportMemo.Clear;
// loop through the 12 month stringgrid and put into text file
for iRow := 1 to ForecastGrid1.RowCount -1 do begin
// Build the line of data
ReportMemo.Lines.Add(BuildThe12MonthDataRow(iRow));
end;
// save the the text file
ReportMemo.Lines.SaveToFile(sFileName);
// assign this file to the Text Pipeline
ppTextPipeline.FileName := sFileName;
end;
many thanks
John Shobbrook
another report when the first one has finished. I think the reason is
because the file i am using as the textpipeline filename is still being used
by the first report.
How do i sort of reset the textpipeline so it doesn't link to the last file.
I tried
ppTextPipeline.Close;
ppTextPipeline.Open;
but i just get loads of pages printed that are not required so i know this
is not the right thing to do.
Here is my existing code
procedure TfrmMainForecast.Build12MonthTextFile;
var
sFileName : string;
ReportTextFile : TextFile;
iRow,iCol : integer;
begin
// set the file name
sFileName := GetForecastDirectory + TwelveMonthForecastTextFile;
// clear the memo
ReportMemo.Clear;
// loop through the 12 month stringgrid and put into text file
for iRow := 1 to ForecastGrid1.RowCount -1 do begin
// Build the line of data
ReportMemo.Lines.Add(BuildThe12MonthDataRow(iRow));
end;
// save the the text file
ReportMemo.Lines.SaveToFile(sFileName);
// assign this file to the Text Pipeline
ppTextPipeline.FileName := sFileName;
end;
many thanks
John Shobbrook
This discussion has been closed.
Comments
reports demo project? See demos #131-135, 138
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
now.
I got this tip from a previous reply.
Thanks
John