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

return value back to main thread??

edited July 2003 in General
This is quite tricky but I'll try to give a shot at it anyway. I'm curious
if it is possible for a report to return a value back to the main thread
(e.g. postmessage or parent). What I have in mind is I could write a script
on a report that I can click on, and onclick, it will bring me to a
different report. Wait, I know it can already do that provided that it is a
subreport within the report. What I would like is to open a different report
from the database.

What I have in mind to archive this is maybe the report can return a value
from back to the main form and the main form can perform the processing.

While I'm at it, would it be possible to put a bookmark in a report? :)

Thanks..

Comments

  • edited July 2003
    As for the values being transferred from one report to another - I guess you
    would need to use RAP for this. Then you can write some methods like
    SetGlobalValue and GetGlobalValue that actually keep those values in the
    global form variables.
    As for the bookmarks - I don't quite understand what do you mean, but I
    guess you would need to play with 2-pass reports for that.

  • edited July 2003
    Hi Calvin,

    Try creating the whole thing without the use of threads first and see if you
    can get every thing working. You might try using the OnDrawCommandClick
    event for a component in your report allow a user to click on an item during
    preview. In this event you can do anything from preprocessing some data or
    loading another report object. Below is a small example.

    http://www.digital-metaphors.com/tips/SpawnNewReport.zip

    Then you will need to create a thread descendent with an OnClick event
    defined. This way the thread descendent can notify the main thread when a
    click event has occured. Take a look at the ppBackgroundPrintQueue.pas and
    ppBackgroundPrintThread.pas files for a good example of how threads can be
    used with ReportBuilder. You will probably need to create something similar
    to this.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2003
    Wow. Cool. That's the thing I need to do. Do you have an example on RAP
    script? (can't go compiling my application everytime there is a new report
    rite. :) Thanks.

  • edited July 2003
    Hi Calvin,

    RAP includes access to the OnDrawCommandClick event. The only problem would
    be accessing other report objects in Delphi. You could do this using a
    PassThru function created in Delphi. See the ReportBuilder Developer's
    guide for examples of how to create RAP PassThru functions. Also, if you
    still need to get these reports working in separate threads, you might want
    to take a look at the delphi help on the TEvent object.

    --
    Best Regards,

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