467,134 Members | 1,090 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,134 developers. It's quick & easy.

Pass Session Variable Value to Crystal Report?

I've got an aspx page that allows the user to select different options
whenever they want to run a report. On this page, I have added an
additional text box for the user to enter in comments about the report
they are running.

I would like to be able to have the comments that the user has entered
to appear on the report that is generated. I thought that I might be
able to pass this text to the report by using a session variable but I
have had no luck. It doesn't matter if I use a session variable to
accomplish this.

Can someone tell me how I can the user's comments from the web form
appear on the report?

Thanks!
Nov 17 '05 #1
  • viewed: 4277
Share:
1 Reply
I figured out a way to accomplish this. I created a session variable
named UComments and stored the text that the user typed in it. On my
Crystal Report I created a blank formula field named UserComments I
next added the following code to my web form:

Dim oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocum ent
= New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()

'*** TELLING THE PROGRAM WHER THE REPORT IS LOCATED
'*** AND WHAT THE REPORT'S NAME IS. ***
oRpt.Load(Session("ReportLocation") & "Grant.rpt")

'*** CODE TO WRITE USER'S COMMENTS TO THE REPORT. ***
oRpt.DataDefinition.FormulaFields.Item("UserCommen ts").Text = "'"
+ Trim(Session("UComments")) + "'"

CrystalReportViewer1.ReportSource = oRpt
cr****@earthlink.net (crjunk) wrote in message news:<e4**************************@posting.google. com>...
I've got an aspx page that allows the user to select different options
whenever they want to run a report. On this page, I have added an
additional text box for the user to enter in comments about the report
they are running.

I would like to be able to have the comments that the user has entered
to appear on the report that is generated. I thought that I might be
able to pass this text to the report by using a session variable but I
have had no luck. It doesn't matter if I use a session variable to
accomplish this.

Can someone tell me how I can the user's comments from the web form
appear on the report?

Thanks!

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by JIsenstadt | last post: by
3 posts views Thread by hon123456 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.