Results 1 to 4 of 4

Thread: DR7.0 SQL statement subreport

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Nijeveen
    Posts
    219

    Default DR7.0 SQL statement subreport

    I have a report with a subreport based on sql statement. (Header and subreport on OrderLines)
    How to add filter that only the orderlines records from that actieve header select
    My Header.Id is a Function in my subreport as global

    Wim

  2. #2
    Join Date
    Apr 2016
    Location
    New Zealand
    Posts
    276

    Default Re: DR7.0 SQL statement subreport

    I usually declare global vars in the main report and then in the same section as your subreport, I'd assign these global vars to what I need, in your case its the Header.id i guess.

    Something like this, create a function and put this inside. Place the function just before the subreport object in your main report.

    Code:
    dim id as global
    let id = {Header.id}
    Edit: I don't know if this matters but I usually make sure that the function object where I assign the global var is defined before the subreport. Go to report explorer panel (on the right hand side) and use the arrows (or Alt+Arrow Key) to arrange accordingly.

    and then inside the subreport's Filter function, I'd do something like

    Code:
    return (
      {subreport.id} = id // <-- this is the Global variable we declared in the main report
    )
    Regards,
    Rol

  3. #3
    Join Date
    Mar 2009
    Location
    Nijeveen
    Posts
    219

    Default Re: DR7.0 SQL statement subreport

    Thanks Rol ,

    The filter function is clear
    But that's not my question, I want add that filter on my sql script for that subreport.
    I know about option of sql ? parameter but how to change that to my ID nummer of the Headerrecord

    Wim

  4. #4
    Join Date
    Feb 2009
    Location
    Hengelo, Netherlands
    Posts
    9,141

    Default Re: DR7.0 SQL statement subreport

    Wim,

    You currently cannot do that as you can not change the parameter value of a sub-report while reading and formatting pages. It is on the list for research.
    Regards,
    Data Access Worldwide
    Vincent Oorsprong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •