Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 November 18th, 2003, 03:53 AM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing multiple values to Crystal Report

I've created a simple report with 1 parameter field "country" and 1 parameter field that allows multiple values "states". I added "country" to the Header and "states" to Details.

Now, I have written VB codes to pass parameters into the fields. "country" displays well but "states" only display the 1st one. This is the code I used:


    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim oRpt As New ReportDocument
        oRpt.Load(Server.MapPath("/TestingApp/CrystalReport1.rpt"),
OpenReportMethod.OpenReportByTempCopy)
        CrystalReportViewer1.ReportSource = oRpt

        Dim paramFields As ParameterFields =
CrystalReportViewer1.ParameterFieldInfo
        addValueToParameterFields(paramFields("country"), "Case 123")
        addValueToParameterFields(paramFields("states"), "123")
        addValueToParameterFields(paramFields("states"), "456")
        addValueToParameterFields(paramFields("states"), "789")

        CrystalReportViewer1.ParameterFieldInfo = paramFields
        CrystalReportViewer1.DataBind()
    End Sub

    Private Sub addValueToParameterFields(ByRef paramField As
ParameterField, ByVal val As String)
        Dim discreteVal As New ParameterDiscreteValue
        discreteVal.Value = val
        paramField.CurrentValues.Add(discreteVal)
   End Sub


Can someone tell me what is wrong?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing values to Crystal Report ctranjith Crystal Reports 9 November 9th, 2012 02:06 AM
How to pass multiple values from Crystal Report to vanitha Crystal Reports 2 June 5th, 2007 07:48 AM
crystal report passing multiple parameter noppanit C# 0 March 20th, 2007 12:32 PM
Passing Multiple Parameters to a Crystal Report Pr miruthula Crystal Reports 0 February 2nd, 2007 06:04 AM
passing parameter values to the crystal report connect2sandep Crystal Reports 0 December 20th, 2005 06:27 AM





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