Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 11th, 2006, 03:24 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default parameter from URL

I have a crystal report on a web server which is based on a stored procedure with a parameter. I need to capture the value of the parameter from a url that I will be giving to a user to use to link into the report viewer. I have used servername/myintranet/viewername?variable=value and I get server error which states parameter field value not found.

 
Old September 11th, 2006, 03:39 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It depends on how you are using the reports viewer; are you trying to directly pass the value into the report? Is it a single value?

If it is a single value you may want to try this:

                        strCurrentValue = Request("someValue")
                        crParamDiscreteValue = New CrystalDecisions.Shared.ParameterDiscreteValue
                        crParamDiscreteValue.Value = strCurrentValue
                        crCurrentValue.Add(crParamDiscreteValue)
                        crDef.ApplyCurrentValues(crCurrentValue)

Where crParamDiscreteValue is type of: CrystalDecisions.Shared.ParameterDiscreteValue
crCurrentValue is type of: CrystalDecisions.Shared.ParameterValues
and crDef is type of: CrystalDecisions.CrystalReports.Engine.ParameterFi eldDefinition

hope this helps.

"The one language all programmers understand is profanity."
 
Old September 11th, 2006, 03:50 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you I am passing a single value and placing the variable name in the url after the name of the crystal viewer i.e. servername/myintranet/viewername.aspx?variable=value. I understand you to say that the included code needs to go into the code behind of the viewer. I will look forward to further wisdom on this topic from you. Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to parse a parameter out of a URL onClick() CodeBugger Javascript How-To 2 May 9th, 2008 02:27 PM
Passing parameter in URl alamoudi ASP.NET 2.0 Professional 3 May 4th, 2007 06:13 AM
Passing parameter in URl alamoudi ASP.NET 1.x and 2.0 Application Design 0 May 2nd, 2007 02:10 AM
Masking parameter values within url. aguivera JSP Basics 0 August 2nd, 2006 01:26 PM
URL Parameter bubberz BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 25th, 2005 03:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.