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

GroupheaderBand2 Before Print

edited June 2015 in General
Hello,

I have a report with 2 groups and try to write a procedure
GroupHeaderBand2BeforePrint - event.
All runtime.
I open the report, create the before-print, compile save, all OK.

Then, when I print the report I get error : "Ubable to load BeforePrint
code for GroupHeaderBand2, no object with this name found".

This all is runtime, and the template is saved in the database.

Is this a bug ? Is there a work around ?

(The message also apears if there is no code (only comment) so it has
nothing to do with the code I try to write in the handler.)

regards,

Dirk Janssens.

Comments

  • edited June 2015
    Hi Dirk,

    Occasionally this behavior can occur when there is a naming conflict
    between multiple TppReport objects. To avoid the issue, be sure there
    in only one TppReport on each form/datamodule in your application.

    If this does not solve the issue, you can try clearing the template and
    freeing all the report modules before loading a new one.

    ppReport.Template.New;
    ppReport.FreeModules;

    //load new template...

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2015
    Additional to my previous post :

    I just downloaded the latest version : 16.02 for Delphi 2007. Same issue.

    I also tried :

    - adding the event, compile the report, save to disk.
    - REstart program, read the report from disk --> the event is not fired .
    Oen report in designer, compile, print-->same error ..

    - removed one group : same error (only "Ubable to load BeforePrint code for
    GroupHeaderBand1, no object with this name found".


    regards,

    Dirk Janssens.

  • edited June 2015
    Hi Nico,

    The report is cerates just before loading the template :

    Report := TppReport.Create(self);
    Report.Template.DatabaseSettings.DataPipeline := plItems ;
    Report.Template.DatabaseSettings.TemplateField := 'TEMPLATE';
    Report.Template.DatabaseSettings.NameField := 'REPORTNAME';
    Report.Template.SaveTo := stDatabase ;
    Report.Template.Format := ftASCII ;
    Report.Template.DatabaseSettings.Name := ReportName ;
    Report.Template.LoadFromDatabase ;

    HowEver, the designer is tied to a TppReport that is on the form.

    I put your code after I close the report-explorer, and now the error is
    gone, but the event is not fired (!?)

    any ideas ?

    regards,

    Dirk.




  • edited June 2015
    I think your answer solved it...
    I do some more testing and let you know, OK ?

    thanks so far !!

    regards,

    Dirk.


    "Dirk Janssens" schreef in bericht news:5575bf13$1@mail....

    Hi Nico,

    The report is cerates just before loading the template :

    Report := TppReport.Create(self);
    Report.Template.DatabaseSettings.DataPipeline := plItems ;
    Report.Template.DatabaseSettings.TemplateField := 'TEMPLATE';
    Report.Template.DatabaseSettings.NameField := 'REPORTNAME';
    Report.Template.SaveTo := stDatabase ;
    Report.Template.Format := ftASCII ;
    Report.Template.DatabaseSettings.Name := ReportName ;
    Report.Template.LoadFromDatabase ;

    HowEver, the designer is tied to a TppReport that is on the form.

    I put your code after I close the report-explorer, and now the error is
    gone, but the event is not fired (!?)

    any ideas ?

    regards,

    Dirk.




  • edited June 2015
    Hi Nico,

    Consider it "solved" !

    thanks a lot !

    regards,

    Dirk Janssens.




    "Dirk Janssens" schreef in bericht news:5575c9ed@mail....

    I think your answer solved it...
    I do some more testing and let you know, OK ?

    thanks so far !!

    regards,

    Dirk.


    "Dirk Janssens" schreef in bericht news:5575bf13$1@mail....

    Hi Nico,

    The report is cerates just before loading the template :

    Report := TppReport.Create(self);
    Report.Template.DatabaseSettings.DataPipeline := plItems ;
    Report.Template.DatabaseSettings.TemplateField := 'TEMPLATE';
    Report.Template.DatabaseSettings.NameField := 'REPORTNAME';
    Report.Template.SaveTo := stDatabase ;
    Report.Template.Format := ftASCII ;
    Report.Template.DatabaseSettings.Name := ReportName ;
    Report.Template.LoadFromDatabase ;

    HowEver, the designer is tied to a TppReport that is on the form.

    I put your code after I close the report-explorer, and now the error is
    gone, but the event is not fired (!?)

    any ideas ?

    regards,

    Dirk.




This discussion has been closed.