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

saving a report to a database

edited February 2002 in General
When I am saving a report template to a database I need to save some
other data into some seperate colums of the table. I have set the
template.datapipeline, ...name, templatefield properties, but before I
call save to database, I would like to save a description into a column
name desc which is in the same table and on the same record as the
template. How do I store the values of other fields so that when I save
the report these other columns of data are stored also?

Comments

  • edited February 2002
    you can do that in beforepost event of that table.

    it will works...
    thanks...
  • edited February 2002
    Thanks for your reply, but this is a rather poor place to put changing data
    but if this is the best that there is I guess it will have to do. There
    should be a template.database.fieldbyname or
    template.database.tablenamefieldname.asstring := 'report description';

  • edited February 2002
    Actually, I did try this and of course it worked. The problem is that you
    have to rely on putting data in public variables and pulling this data into
    the fields just before posting. I would rather put all if the data in at one
    event or set of properties at one time and in one location. Surely Tom, Nard,
    or Jim will have a better solution. If this is not the case, I will use this
    event. Let's hear from Digital Metaphors on this.

  • edited February 2002
    Below you'll find an article which explains the public events of the
    Template object which you can use to customize the save process. From your
    description, it sounds like you need to use the OnSaveStart event.

    In terms of the data to be saved, it all comes down to the location of
    object containing the data. Is it in the same form where the OnSaveStart
    event handler is declared? If so, it's easy enough to retrieve it and set
    the database field value. If not you'll need to come up with an OOPy
    technique to do it...

    --
    Tom Ollar
    Digital Metaphors Corporation

    -------------------------------------------------------
    Tech Tip: Controlling Designer New, Save, Open actions
    -------------------------------------------------------

    There are several options for controlling the actions
    that occur when a user opens, saves, or creates a new report.

    1. Use Report.Template events: OnLoadStart, OnLoadEnd,
    OnSaveStart, OnSaveEnd and OnNew.

    These events are frequently used to add additional functionality - such
    as saving and reading additional meta data when a report loads. They are
    also used for performing initializations when a report loads or a new
    report is created.


    2. Use the TppDesigner.OnOpenDoc and OnSaveDoc.

    If you code event-handlers for these events, then the ReportDesigner
    will rely on your event-handler code to load and save reports rather
    than its own internal logic.

    3. Use the TppDesigner.Menu property to access the menu items and attach
    you own event-handlers.



    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com
    -------------------------------------------------------

    There are several options for controlling the actions
    that occur when a user opens, saves, or creates a new report.

    1. Use Report.Template events: OnLoadStart, OnLoadEnd,
    OnSaveStart, OnSaveEnd and OnNew.

    These events are frequently used to add additional functionality - such
    as saving and reading additional meta data when a report loads. They are
    also used for performing initializations when a report loads or a new
    report is created.


    2. Use the TppDesigner.OnOpenDoc and OnSaveDoc.

    If you code event-handlers for these events, then the ReportDesigner
    will rely on your event-handler code to load and save reports rather
    than its own internal logic.

    3. Use the TppDesigner.Menu property to access the menu items and attach
    you own event-handlers.



    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com
  • edited February 2002
    This will probably work best. I simply want to be able to save a description,
    a username, and some additional information when the report is save into the
    database. I am surprised that there are no additional array properties that
    would permit this. That said, this seems like a better place for me to do
    this work.

This discussion has been closed.