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

Read stream error (not BDE!)

edited August 2006 in General
Hi,

I got this message: 'Read stream error' when merging several reports
into one. I searched this newsgroup but only found BDE related problems.

When debugging I found the error to occur in:

procedure TkuRAFMerge.RenumberAndCopyPages

ss.CopyFrom(fs,rbp.FPageSize);

At that time the rbp.FPageSize is -12

It only seems to happen when there is a lot of text on a page because
for other reports (same report other data) it works.

It's a pretty urgent problem because running in a live environment.

--
Thanks in advance,

Stijn Verrept.

Comments

  • edited August 2006
    Hi Stijn,

    kuRAFMerge is not part of ReportBuilder. It is a third party utility
    provided for free by Kevin Ugan. We have not heard of this issue using the
    kuRAFMerger. You may try contacting Kevin and finding out if he has any
    information about the error. If not, please create a small simple
    application that demonstrates this behavior and I can download the
    kuRAFMerger and take a look at it for you. Send the test app in .zip format
    to support@digital-metaphors.com.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    Nico Cizik (Digital Metaphors) wrote:


    I found out what the problem was. With some data parts of the reports
    where empty which caused the program to crash.

    If you add this line:

    if fs.Size = 0 then Continue;

    at:

    procedure TkuRAFMerge.OpenInputStreams;
    var
    ii,iHeaderSize: Integer;
    fs: TFileStream;
    fID: Array[1..4] of Char;
    begin
    FInputStreams.Clear;
    FInputStreams.Capacity:=FSourceFiles.Count;
    FTotBytes:=0;
    FTotPages:=0;
    For ii:=0 to FSourceFiles.Count-1 do
    begin
    //open each input file and add size to TotBytes to be processed
    If Trim(FSourceFiles[ii])='' Then Continue;
    fs:=TFileStream.Create(FSourceFiles[ii],fmOpenRead or
    fmShareDenyWrite);
    if fs.Size = 0 then Continue;

    FTotBytes:=FTotBytes + fs.Size;

    t works. Thanks!

    --
    Kind regards,

    Stijn Verrept.
This discussion has been closed.