Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

ppTextPipeline question

edited July 2003 in General
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

Comments

This discussion has been closed.