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

Background Printing and Stream

edited November 2003 in General
Hi all.
Could you guys give an example on how to print a report to a pdf file and
then stream it back to the user? I would like to save the report design to
file , and when the user requests, load it and print to a pdf file and send
the web response with the pdf streamed. I'm working on a websnap
application with rb7.0 and Textradevices.

Thanks a lot.

Comments

  • edited November 2003
    any tips? (:

    --
    Lynn, City of Sin. You never come out the way you went in...
  • edited November 2003
    Check out the internet demo on the download page. It shows you
    how to print to a stream and send it back to the browser.

    www.waler.com/download.htm

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited November 2003
    Does the file get created? Did you set the devicetype and allowprintofile properties
    on the report? You are eligible for a free upgrade to the latest version if you
    are interested.

    James Waler
    Waler Ltd
    http://www.waler.com
  • edited November 2003
    Hi James.
    Actually I use ReportBuilder 5.x and TExtraDevices 1.7, and I think those
    demos have features not available for me. Do you think that I could just
    print to a file (directly) and them assign the file to a TFileStream back to
    the user? I tried that but nothing comes out and I don't get any errors
    either.

    Thanks.

  • edited November 2003
    var
    Output : TFileStream;
    begin
    ppReport1.TextFileName := 'WebTest.pdf';
    ppReport1.Print;
    Output := TFileStream.Create('WebTest.pdf',fmOpenRead,fmShareDenyNone);
    Output.Position := 0;
    Response.Title := 'PDFOutput';
    Response.ContentType :='application/pdf';
    Response.CustomHeaders.Add('Content-Disposition=; ' +
    'filename="YourPDFFile.pdf"');
    Response.ContentStream := Output;
    Response.SendResponse;






  • edited November 2003

    but now how do I load my "reportfile.rtm" file?

This discussion has been closed.