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

Data from one pipeline as parameters for another.

edited May 2015 in RAP
Hi,

We have a particularly complicated report in RB 14, where we allow the user to select a type of date range as a parameter ("This week", "This term", "This year") and then work out a start and end date for that range based on data in a pipeline, and use those values as parameters for another pipeline. For example, "Term_Dates" is a pipeline containing start and end dates for the current school term:

If(CurrentDate <= Term_Dates['Term 1 Second Half End']then
begin
TermStart := Term_Dates['Term 1 First Half Start'];
TermEnd := Term_Dates['Term 1 Second Half End'];
end else If(CurrentDate <= Term_Dates['Term 2 Second Half End']then
begin
TermStart := Term_Dates['Term 2 First Half Start'];
TermEnd := Term_Dates['Term 2 Second Half End'];
end else
begin
TermStart := Term_Dates['Term 3 First Half Start'];
TermEnd := Term_Dates['Term 3 Second Half End'];
end;

We then use TdaSQLBuilder to add TermStart/TermEnd as parameters to another pipeline. The problem is that we can't find a suitable place to put this logic. If we put it in BeforeOpenDataPipelines then the source pipeline contains no data. If we put it in AfterOpenDataPipelines it's too late to set the parameters. Is there some way we can open Term_Dates early to get values from it, or reopen our other pipeline later and pass the parameters in then?

Thanks,

Steve Branley


--------------= Posted using GrabIt =----------------
------= Binary Usenet downloading made easy =---------
-= Get GrabIt for free from http://www.shemes.com/ =-

Comments

  • edited May 2015
    Hi Stephen,

    You can extend RAP with custom functions. Below is an rbWiki link. You could
    try implementing a function that receives the DataPipeline as a parameter,
    along with the term name and returns the dates. For example,
    GetDateRange(myDataPipeline, 'ThisWeek', lStartDate, lEndDate);

    http://www.digital-metaphors.com/rbWiki/RAP/Extending_RAP/Overview


    Best regards,

    -
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.