Jump to content
We've recently updated our Privacy Statement, available here ×

How to insert a value into a report from a different sql query?


Go to solution Solved by yama818,

Recommended Posts

Hi Folks:

I have a report for new orders.  There are several folks that order items.  I need  allow the person to select their email address from a list and have it inserted into the report in the email section (see pic please).

I already have a parameter on the report to limit it to just one order number.  The email address is not part of the query that fills out the report.

So my question is:

Should I do a subreport or variable that would allow the user to select the email address (which is then inserted into the report)?  Any ideas would be appreciated,

Thank you,

Matthew

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Solution

This may not be the best way to do it, but I was able to achieve this by using the table component.
Tie a new dataset to the table component and write SQL to return only one item in this dataset.
ex) select email from email_table where id = $P{xxxx}

preview image
preview_image.png.a3a019c8e248ef3048a56cd2d7732ece.png


Design image
main_report_design.png.044a5ac382942640f57bfb6de4dedc7e.png
table_compornent_design.png.cdf102d7d6b618b4b0481914469ab67c.png

 

I hope this is helpful.

 

 

Link to comment
Share on other sites

Thank you Yama818  for the idea.  I think that will work though I still have not got it working yet.  I can get the table to return an email that I set in the SQL.  If I set a parameter though nothing is returned.  (Set the parameter in the table like below:

rQGGQX4.png

I set the same parameter (Just called "EMAIL") in the main report so it will as for it but doesn't pass it to the table.  I'm probably doing something stupid.  Once I upload it to the server I want to have a pick list so they can choose the email.  Thank you for any advice or help :)

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...