Crystal Report Viewer


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Crystal Report Viewer

  1. #1
    Join Date
    Mar 2007
    Location
    Vancouver, BC
    Posts
    18

    Crystal Report Viewer

    Hi Everyone,

    On a form I have a Checked List Box. I want to select multiple values as parameters to send to a Crystal Report. This code works fine if I only select one list item, but if I select two, it only sends the second one. Any suggestions? Thanks.

    Private Sub btnShowWorksheet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShowWorksheet.Click
    Dim intCounter As Integer = Nothing 'Counter fo "For...Next Loop"
    Dim myParameterFields As New ParameterFields() 'Collection of Parameters
    Dim myParameterField As New ParameterField() 'Parameters = Checked container ids
    Dim myDiscreteValue As New ParameterDiscreteValue() 'Transfers container id to parameter

    myParameterField.EnableAllowMultipleValue = True
    myParameterField.Name = "ContainerNumber" 'Name of field

    If cbxContainers.CheckedItems.Count <> 0 Then
    For intCounter = 0 To cbxContainers.CheckedItems.Count - 1 'For loop adds each
    myDiscreteValue.Value = cbxContainers.CheckedItems.Item(intCounter) 'checked container to
    myParameterField.CurrentValues.Add(myDiscreteValue) 'parameter group
    Next
    End If
    myParameterFields.Add(myParameterField) 'adds all parameters to 1 collection
    CrystalReportViewer1.ReportSource = "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Whiteboard\Whiteboard\OpeningWorksheet.rpt"
    CrystalReportViewer1.ParameterFieldInfo = myParameterFields
    CrystalReportViewer1.Refresh()
    End Sub

  2. #2
    Join Date
    Mar 2007
    Location
    Vancouver, BC
    Posts
    18
    Never mind, I figured it out. I just had to juggle a Dim statement. Thanks anyways!

Similar Threads

  1. Replies: 2
    Last Post: 01-27-2007, 07:28 AM
  2. alignment of report in crystal report viewer
    By jabbarsb in forum ASP.NET
    Replies: 1
    Last Post: 06-29-2006, 06:30 AM
  3. Working with Crystal Report Ver 10
    By AM003295 in forum VB Classic
    Replies: 4
    Last Post: 08-12-2005, 10:13 PM
  4. Replies: 1
    Last Post: 06-14-2002, 04:49 PM
  5. Replies: 2
    Last Post: 06-08-2002, 12:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center