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

Loading a report template from a database table

edited June 2014 in General
I am using Delphi XE2, ReportBuilder 14.08, IBObjects 5.5.x and Firebird
database 2.1.

I have a situation where I load a report template from a database table
using the TppReport.LoadFromDatabase method.

After I upgraded IBObjects from version 4 to version 5, I have an odd
situation where the LoadFromDatabase reports that the row containing the
report template is not found. However a second call to LoadFromDatabase
is successful.

So for the moment, to make it work I use the following code to run the
load method twice:
try
rbReportItem.template.loadfromdatabase;
except
rbReportItem.template.loadfromdatabase;

Not pretty, I know.

I don't know if this is a reportbuilder or IBObjects issue.

Any thoughts would be appreciated.

Regards,
Phil Horst

Comments

  • edited June 2014
    Hi Phil,

    This is not a known issue. You might try tracing into the
    TppTemplate.LoadFromSource routine to see exactly what is happening
    during the first call. My guess is that this is a field type issue.

    We did have to make some IBO 5 specific fixes to the daIBO plugin after
    it was released. If you are using DADE, I suggest downloading a trial
    edition of RB 15 and testing with the IBO plugin included with that version.

    Moving forward, we hope you will consider upgrading to the latest
    version of ReportBuilder to take advantage of these fixes as well as
    numerous other new features.

    http://www.digital-metaphors.com/rbWiki/General/What's_New/RB_15

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2014
    On 06/12/2014 12:12 PM, Nico Cizik (Digital Metaphors) wrote:

    Hi Nico,

    I traced through the RB code and everything looks good, as far as I can
    see.

    I am watching the line

    Result := FDataLink.DataSet.Locate(aFieldName, aKeyValue,
    lLocateOptions);

    in the function TppDBPipeline.Locate.

    The parameters in this locate look fine. But the first time this locate
    is executed it returns false.

    Using the Try - Except statement as mentioned earlier, I immediately
    execute the LoadFromDatabase method a second time. This time the locate
    statement returns a result of true.

    So I am still puzzled as to what might be happening between the first
    and second time the locate method is executed.

    Thanks,
    Phil
  • edited June 2014
    Hi Phil,

    ReportBuilder relies on the Locate routine to find the correct record
    when loading a template. You might need to trace further into the
    Delphi source and IBO source to see if there is a problem (error) when
    this is called. If there is no error returned and the Locate routine is
    simply returning False (which is clearly not correct), it may be an IBO
    issue.

    Best Regards,

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