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

Export to HTML in stream

edited September 2015 in Devices

Hi all,
Upgraded recently from RB7 (Delphi 7) to RB15 (Delphi XE5). I used to
export reports in HTML format to a stream using Pragnaan, I see now in
RB15 there is a ppHTMLDevice, so I was trying to use it, although I
can't find any example code, not on the rbwiki anyhow. I just followed
the pattern that the PDF and XLS devices use. Here's what I have, but I
get an error "EInOutError with message 'Unable to create Directory'
which leads me to think I don't have something set to use the stream,
although I did set the OutputStream.


lHTMLDevice:=TppHTMLDevice.Create(nil);
try
///settings
//lHTMLDevice.HTMLSettings:=ppReport1.HTMLSettings; //doesn't have
settings
lHTMLDevice.OutputStream := zStream;
lHTMLDevice.Publisher := ppReport1.Publisher;
// generate the report
ppReport1.PrintToDevices;
finally
lHTMLDevice.Free;
end;

Any idea what I'm missing?

Comments

  • edited September 2015
    Hi Dan,

    Exporting HTML to stream is very restricted due to the fact that HTML
    frequently relies on accompanying files (images, fonts, css) in order to
    display correctly.

    A text-only report using very standard fonts should however be able to
    export to an HTML stream correctly using our HTML device. I updated the
    HTML device to support this for the latest version of RB 16 in a patch.

    Registered users of RB 16 can email support@digital-metaphors.com to
    receive the patch.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.