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

Passthru functions are called multiple times

edited January 2011 in RAP
Hi DM,

I am in the process to dynamicly create an output filename.
See thread digital-metaphors.public.reportbuilder.general, 'Set TextFileName
with dynamic report data', dated 01/22/2011 for more information.
I created some passthru functions to get the data from the database as
needed.

The folling RAP code is using these new functions:

QueryID := QueryOpen(SQL);
if not QueryEof(QueryID)
then begin
Inkoopnr := VarToStr(QueryFieldByName(QueryID,'inkoopnr'));
Filename := Filename + ' - inkoopnr ' + Inkoopnr;
end;
QueryFree(QueryID);

All functions are RAP passthru functions.
The funny thing is that QueryFieldByName() is called twice while I would
expect it to be called only once.

Using RB11.08

Regards,
Jeroen R?ttink

Comments

  • edited January 2011
    Hi Jeroen,

    Which event did you end up using to make changes to the TextFileName (i.e.
    which RAP event is firing twice?).



    Regards,

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

    Best Regards,

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

    I am sorry. The RAP event is not fired twice, but only the
    QueryFieldByName() passthru function in the below code-snippet. So I don't
    think it's related to the RAP event which is OnFileDeviceCreate() by the
    way.

    Regards,
    Jeroen.

  • edited February 2011
    Hi Nico,

    Any news?

    Regards,
    Jeroen.

  • edited February 2011
    Hi Jeroen,

    I'm sorry about the late reply, I lost track of this thread.

    I'm a bit unclear about what exactly is happening. If I create a passthru
    function and call it once from RAP, it is only executed once during report
    generation. Are you saying that somehow the passthru function is being
    called twice without being called twice in RAP? Are you able to recreate
    this with any passthru function?



    Regards,

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

    Best Regards,

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

    Yes, that's what I am saying. I'll see that I can make a simple example but
    that will be next week.

    Regards,
    Jeroen.

  • edited February 2011
    Hi Nico,

    I created an example and sent it to support.

    Regards,
    Jeroen.

This discussion has been closed.