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

Saving and Loading a completely Code-Generated Report to and from the Database

edited May 2004 in End User
Hi all,


SITUATION:
I am using Delphi 6 Ent with RB 7.3 connecting to MS-SQL2000 via SQL-Direct

I have a "Data Inquiry" utility in my application which is a set of Datasets
which have Master/Detail links on certain fields,

The utility has an "Auto Report" function which takes the viewed Dataset and
generates an automatic report from scratch,
putting in all the regions, memos, labels and dbtext as well as sub-reports
for the linked datasets.

I have got all of this to work correctly, except that because I know of no
way to "auto-resize" the report field etc. so that they will always
fit on the page, I allow the user to alter the widths of the components on
each report (Main Report+Sub-Reports) until they are satisfied with
the result in the previewer.

THE PROBLEM:
I have enabled the user to save the Report Template to the database, - works
fine, but if I try load the report from the database I get an Access
Violation, is this because of the Datapipelines or what?
What are the issues or precautions around saving the template to the
Database?
Is there any magical way of resizing / scaling a report to magically fit on
the page?

Thanks in advance
-DMitchell

Comments

  • edited May 2004

    1. There are some articles in the Tech Tips newsgroup on creating reports in
    code and on working with templates.

    In general you want to make that all objects are Owned by the form or
    datamodule that contains the report. This includes the Datasets, the Report,
    the Bands, the Labels, etc. ReportBuilder uses standard Delphi streaming.

    Start by creating a simple blank report and test saving it. Then
    incrementally add more complexity, testing at each step.

    2. There is no magical way to size the objects to fit on the page.



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


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2004

    Please do not post attachments to the newsgroups.

    Please create a simple, minimal example that demonstrates what you are
    trying to accomplish. The example should be a Delphi project that we can
    compile and run here. Please use only standard Delphi components and
    ReportBuilder. Email in zip format to support@digital-metaphors.com.



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

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited May 2004
    Hi Nard,

    Thanks for the response, I have attached a copy of the report as saved to
    disk.
    There are no DataPipelineName properties saved but the DataField property
    has been saved?

    I thought I would just hand you this as a "shot in the dark", to see if you
    could pick up anything blatantly obvious in the file

    Thanks again
    - DMitchell

  • edited May 2004
    Humble apologies, will send mail

    -DMitchell

This discussion has been closed.