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

TraCodeModule?

edited March 2011 in DADE
Hi Guys,

Not sure where this came from. I have a RB End User Report Template
via RBExplorer.

In one app it all opens OK.

In another app when I open a report I get a Error Reading Template
report, "Class TraCodeModule not found. Ignore the error and
continue?".

If I ignore the error it all seems to be working OK.

Where/why is this error occuring please?

Regards,

Ian

Comments

  • edited March 2011
    Hi Ian,

    The error indicates that the template was saved down with some RAP code
    (Code tab). If you enable RAP (add raIDE to your uses clause) the error
    should go away. Another option is to load the template at runtime and
    remove the RAP code and resave.



    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Thanks Nico,

    All sorted, although I think I lost a variable calculation when I
    saved a Template without raIDE available.

    Related, sorta, question.

    In the Templates they refer to tables like 'Invoice', 'Customer' &
    'Supplier'.

    I have changed the table names to plural. i.e. 'INvoices',
    'Customers' & 'Suppliers'.

    There are some 25 reports.

    What is the most efficient way to change these table names in the
    Templates please?

    Hmmm. I may have the same issue in the Dtata Dictionary. I shall
    have to check.

    Regards & TIA,

    Ian
  • edited March 2011
    Hi Ian,

    The easiest way would be to run through each template (as text) and
    alter the table names in code. If these templates are saved to
    database, which I assume they are, take a look at the following example
    on how to edit a template as text. Using this example, it should be
    easy to create a Delphi utility to search and replace certain values.

    http://www.digital-metaphors.com/rbWiki/End-User/Fundamentals/How_To...Edit_Templates_as_Text


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico Cizik (Digital Metaphors) wrote:

    Hi Nico,

    Will look at it. Saved a template as text and edited OK. Small
    problem, where are the 'Calc's saved? They didn't appear in the report
    template that I can see.

    Regards,

    Ian
  • edited March 2011
    Hi Nico,

    OK. Having a play with the example, and, per the instructions, I am
    getting the Invalid format error. I am using Advantage. The following
    is my top end...

    {Code Snippet}

    unit rbEditTemplatesAsText;
    {$I ppIfDef.pas}

    interface

    uses


    {x$DEFINE BDE} {remove the 'x' to enable Borland Database
    Engine (BDE) }
    {x$DEFINE TeeChart} {remove the 'x' to enable standard TeeChart}
    {x$DEFINE UseDesignPath} {remove the 'x' to use the design-time
    settings of Database object on this form}
    {$DEFINE DADE} { remove the 'x' to enable DADE }
    {$DEFINE CrossTab} { remove the 'x' to enable CrossTab }
    {$DEFINE RAP} { remove the 'x' to enable RAP }
    {$DEFINE CheckBox} { remove the 'x' to enable CheckBox }

    {$IFDEF DADE}
    daIDE,
    {$ENDIF}

    {$IFDEF BDE}
    daDBBDE,
    {$ENDIF}

    {$IFDEF CrossTab}
    ppCTDsgn,
    {$ENDIF}

    {$IFDEF RAP}
    raIDE,
    {$ENDIF}

    {$IFDEF CheckBox}
    myChkBox,
    {$ENDIF}

    {$IFDEF TeeChart}
    ppChrt, ppChrtDP,
    {$ENDIF}
    Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
    Dialogs, StdCtrls, ppBands, ppCache, ppClass, ppProd,
    daADS, ppReport, Db, DBTables, ppComm, ppRelatv, ppDB, ppDBPipe,
    ppDBBDE, ppTypes, adsdata, adsfunc, adstable, adscnnct;

    {EndCode Snippet}

    I have had nothing to do with Streams in the past so I am unsure what
    to look for in terms of units I need to add to the uses clause.

    Appreciate any advice/recomendation.

    Regards,

    Ian
  • edited March 2011
    Addenda - Would this be a compatability issue with using Delphi XE?
  • edited March 2011
    Hi Ian,

    Using Delphi XE should not make a difference. I just ran the original
    demo in Delphi XE without any problems.

    My guess is that this is a data access error. At what point in the demo
    code (which event) does the error occur? Are you able to execute the
    entire LoadTemplate routine without problems?


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2011
    Nico Cizik (Digital Metaphors) wrote:


    Hi Nico,

    I have found it falls over at the following routine in LoadTemplate.

    {convert the binary stream to text}
    ObjectBinaryToText(lBinaryStream, lTextStream);

    Yet to determine where/why in this routine.

    Regards,

    Ian
  • edited March 2011
    Hi Ian,

    Are you able to run the original demo (using Paradox)? Which version of
    ReportBuilder are you using?

    Sorry to move backward, I just want to find out if this is related to
    Advantage or something else.


    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

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