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

Folder_id problem

edited January 2003 in End User
Hello. I'm using Report Builder v6.02 enterprise with Delphi 5 enterprise. I
have RB_FOLDER & RB_ITEM in an Interbase 6.0 database, with the triggers for
the ID's assigned. In a form in my application, I create & edit the report
model with a combo to select which one to edit and two buttons to create a
new one and edit the selected in the combo.

It works OK when editing an existing model and saving it. But my problem
is when I select Save As in the menu, and enter a new Name for it. First it
shows me all the reports defined in the RB_ITEM table, with no separation
between folders. When I accept a new name, it shows an error saying: "Field
'FOLDER_ID' must have a value". I tried to assign some fields in a
BeforeInsert event of tblItem, but It doesn't fill the blob field with the
actual report.

What am I doing wrong? Thank you very much.

Daniel Alvarez
NETLAN S.A.

Comments

  • edited January 2003
    Hi Daniel,


    you should use event 'BeforePost' or 'AfterInsert' for assigning values to fields.

    regards,
    Chris Ueberall;
  • edited January 2003
    Sorry. I mistyped. I was trying this by using after insert for asigning this
    fields:

    ds['FOLDER_ID'] := folder_id; // Put the folder_id of the report being
    edited
    ds['ITEM_TYPE'] := 1;
    ds['MODIFIED'] := Double(Now);

    It saves OK, but when I go to the table, I find that some fields stayed
    blank, such as item_size and template. It doesn't save the report in the
    blob!!!

    Daniel


  • edited January 2003
    I'm using AfterInsert for asigning the field values, but I doesn't fill the
    blob field with the report yet.
    What can It be happening?
    Thanks.

    Daniel

  • edited January 2003
    Perform a test to make sure the database tables are created correctly by
    using the Report Explorer end user demo to connect to your Interbase
    database. Did you use our SQL script located in the RBuilder installation
    directory for your database?

    You should be able to say SaveToDatabase on the template and it will save
    the template based on the configuration
    of the database settings. Search in ppRptExp.pas to see where the report
    explorer saves folders.

    In ppTmplat.pas, the template is streamed and saved directly to the blob
    field of the new record:
    ...
    else if (aSaveToType = stDatabase) then
    begin

    if not FDatabaseSettings.DataPipeline.Active then
    FDatabaseSettings.DataPipeline.Open;

    {edit existing record, or add a new record, if needed}
    if LocateRecord then
    begin
    FDatabaseSettings.DataPipeline.Edit;

    end
    else
    begin
    FDatabaseSettings.DataPipeline.Insert;

    FDatabaseSettings.DataPipeline.SetFieldValue(FDatabaseSettings.NameField,
    FDatabaseSettings.Name);

    end;

    {call OnSaveEnd event}
    DoOnSaveEnd(lSaveStream);


    FDatabaseSettings.DataPipeline.SetFieldFromStream(FDatabaseSettings.Template
    Field, lSaveStream);

    FDatabaseSettings.DataPipeline.Post;

    end;



    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.