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!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("UserComments").Text = "'"
+ Trim(Session("UComments")) + "'"
CrystalReportViewer1.ReportSource = oRpt
crjunk@.earthlink.net (crjunk) wrote in message news:<e45e90aa.0308061021.788041e6@.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!
Showing posts with label run. Show all posts
Showing posts with label run. Show all posts
Thursday, March 29, 2012
Wednesday, March 21, 2012
passing a GUID in the querystring
I need to pass a GUID into a page via the QueryString. If I do:
Dim myGUID as GUID
GUID = Request.QueryString("myGUID")
It won't run, and says that a value type of string cannot be converted to a GUID. I can't retype myGUID as a string, because I use it in a SQL Server Database call...It yells at me if try to do a query with it in there.
Am I doing something wrong? or is there just no way to pass a GUID through the querystring?
ThanksIf you pass the value on the url it will be in a string format. The following worked for me. Maybe this will help.
select * from table1 where uniqueID = cast('{5BEEAA61-394B-44F6-9AC8-A6EA5FC99490}' as uniqueidentifier)
You need to do the following:
Dim MyGuid As Guid = New Guid(Request.QueryString("myGuid"))
Dim myGUID as GUID
GUID = Request.QueryString("myGUID")
It won't run, and says that a value type of string cannot be converted to a GUID. I can't retype myGUID as a string, because I use it in a SQL Server Database call...It yells at me if try to do a query with it in there.
Am I doing something wrong? or is there just no way to pass a GUID through the querystring?
ThanksIf you pass the value on the url it will be in a string format. The following worked for me. Maybe this will help.
select * from table1 where uniqueID = cast('{5BEEAA61-394B-44F6-9AC8-A6EA5FC99490}' as uniqueidentifier)
You need to do the following:
Dim MyGuid As Guid = New Guid(Request.QueryString("myGuid"))
Subscribe to:
Posts (Atom)