Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 26th, 2004, 05:29 AM
Registered User
 
Join Date: Aug 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing parameter from asp.net to crystal report

I have a crystal report that takes in a single parameter(discrete value) of string data type.
i have to integrate this report with the aspx page.In the aspx form i have a dropdown that holds the parameter values which is passed to the crystal report.
Now depending on the selected item from the dropdown i have to display the records in the report.

This report in the crystal report environment works fine(as in is intended to), and returns the correct number of records.
But when the same report is integrated with the aspx page.
The records repeat itself 4 times for parameters and one of the formula field doesn't display the data at all.

i could not figure out what the problem is.
any help is highly appreciated.

the following is the code that i have written while passing the paremeters.


Dim crpt As New CrystalDecisions.CrystalReports.Engine.ReportDocum ent()
crpt.Load(Server.MapPath("cr_reports/tpa_receivables-Programmewise.rpt")

Dim paramfields As New CrystalDecisions.Shared.ParameterFields()
Dim paramfield As New CrystalDecisions.Shared.ParameterField()
Dim discrtvalue As New CrystalDecisions.Shared.ParameterDiscreteValue()
Dim newlogoninfo As New CrystalDecisions.Shared.TableLogOnInfo()
Dim crtable As CrystalDecisions.CrystalReports.Engine.Table

newlogoninfo.ConnectionInfo.ServerName = Application("servername")
newlogoninfo.ConnectionInfo.DatabaseName = Application("dbname")
newlogoninfo.ConnectionInfo.UserID = Application("dbuser")
newlogoninfo.ConnectionInfo.Password = Application("dbpwd")

For Each crtable In crpt.Database.Tables
                crtable.ApplyLogOnInfo(newlogoninfo)
Next

discrtvalue.Value = dropdownlst.selecteditem.value
paramfield.ParameterFieldName = "myfieldname"
paramfield.CurrentValues.Add(discrtvalue)
paramfields.Add(paramfield)

CrystalReportViewer1.ParameterFieldInfo = paramfields
CrystalReportViewer1.ReportSource = crpt



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crystal report passing multiple parameter noppanit C# 0 March 20th, 2007 12:32 PM
Passing runtime parameter to Crystal Report renishl Crystal Reports 1 May 30th, 2006 12:38 AM
passing parameter values to the crystal report connect2sandep Crystal Reports 0 December 20th, 2005 06:27 AM
Crystal report, passing parameter suni_kutty Crystal Reports 2 October 7th, 2004 03:13 AM
passing parameter to crystal report.net shamala Crystal Reports 2 August 19th, 2004 02:04 AM



All times are GMT -4. The time now is 11:50 PM.


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