Home Datapipelines

TppTextPipeline - data file not closed after report

edited November 2002 in Datapipelines
I am creating a text file from within my application, it is then closed
before producing a report using a TppTextPipeline. All is well except when
the report is closed, the text file is not. I am unable to then overwrite
the file.

Using Win '98, Delphi 5 and reportBuilder 5.56

Any help welcome. Thank you.

--
John Dinning

Comments

  • edited November 2002
    Take a look at the main reports demo # 135 - it does exactly this. Can you
    run this demo? We aren't able to reproduce the problem with the demo.
    Perhaps you could try to use our approach or provide us with some code to
    see what it is that you are doing? The approach in demo 135 works, so if you
    could follow this technique to get it working that that would be the first
    step to take before trying to debug your approach.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited November 2002
    Thanks for the reply. I looked at demo 135 and found the only major
    difference between and what it and I were doing, was that the form with the
    report and textpipeline on it was dynamically created and destroyed each
    time the report was run in the demo.
    I have followed this approach and it works fine.
    It appears the text file is not closed unless the form (and therefore the
    report) is destroyed and freed. Could this be the case?

    Thanks again and regards,
    John.


  • edited November 2002
    Place a breakpoint in TppFileDataStream.Close to see if it is getting called
    after you are done printing. This is where the file stream is freed and the
    text file should be closed automatically.

    You shouldn't need to open the file before printing, since the pipeline will
    do this internally. You can also try closing the file after the print is
    over. Use the TppTextPipeline's OnClose event to close the file.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.