Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
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 October 26th, 2004, 05:29 AM
Registered User
 
Join Date: Aug 2004
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








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





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