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

Streaming Template BLOB to RBViewer...

edited April 2007 in General
We want to provide our users with a standalone viewer (with toolbar to
print) so that they can avoid opening the Designer to preview and print
reports.

The plan is...
1. List the template names (using the Name column) from the rbItem data
table.
2. When the user selects a template name from the list (above step), we
want to stream the BLOB field to the viewer to display the report.

Does anyone have code snippets that perform this?

Thanks, Patrick

Comments

  • edited April 2007


    Patrick,

    This should do it:

    ms2:=TMemoryStream.Create;
    TBlobField(Query.FieldByName('Doc')).SaveToStream(ms2);
    ms2.Position:=0;
    ppReport.Template.LoadFromStream(ms2);
    ms2.Free;

    Make sure that ppReport.Template.Format is set to ftASCII

    Ken
  • edited April 2007

    - One option is to use RB Server Edition which includes ClientReport and
    ClientReport Explorer components that can be used to build a Windows
    thin-client app that can preview and print reports that are generated on the
    server. The report server can run on the same machine or a different machine
    than the server. The report server can use your existing report explorer
    database and dynamically discover new reports that you add.

    - To build your own solution, I would consider honoring Folder and Item
    structure. If you want to ignore that and just list the the reports from the
    rbItems you could use any Delphi data-aware controls - just as do for other
    parts of your application.

    - The Viewer can display Page objects. It cannot load a report template. So
    perhaps what you really mean is that you want to use a TppReport to load a
    template from the rbItem table. See the Templates thread of the Tech Tips
    newsgroup for articles on how to do this. The Report.Template object
    properties, methods, and events can be used to bind the template to plItem
    datapipeline.



    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.