Jump to content

How to pass subreport field values as main report parameter in main report sql


bharath7leo

Recommended Posts

How to pass subreport field values as main report parameter in main report sql?

Main report Query

------------------------

SELECT
     PERSONS."ID" AS PERSONS_ID,
     PERSONS."NAME" AS PERSONS_NAME,
     PERSONS."CITY" AS PERSONS_CITY
FROM
     "SYSTEM"."PERSONS" PERSONS  where PERSONS."ID" = $P{parm}

Sub report query

----------------------

SELECT
     EMAIL_ADDRESSES."ID_PERSON" AS EMAIL_ADDRESSES_ID_PERSON
  FROM
     "SYSTEM"."EMAIL_ADDRESSES" EMAIL_ADDRESSES

 

How to pass EMAIL_ADDRESSES_ID_PERSON to $P{parm}? Please help..

Thanks,

Bharath M.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Hi Bharat

 

You could follow these steps to return tehe field as param in the main report through subreport

1. In the main report identify teh subreport element 

2. Then click on the subreport element  and see the properties of the element

3. When you will scroll down in the properties menu then at the last you will find a option called RETURN VALUES

4. Now here you can define the return value and you can get the value in the main report

 

Hope that it helps.

Thanks,

Ankur Gupta

Link to comment
Share on other sites

For multiple values,

I think what you can do is that put the subreport element in the detail band so that each time value is returned from the subreport and each time the value can be used in the report

This might work,please try it out and let me know

 

Hopw that it helps

Thanks,

Ankur Gupta

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...