?
Solved

passing of value from combobox to crreport

Posted on 2005-02-28
2
Medium Priority
?
190 Views
Last Modified: 2010-04-23
hi experts
i am new to the crystal reports , i had taken two combo boxes and a button on a form onclicking that button i should go to another form where i kept the crystalviewer.i want to get the values from the combo boxes and display on my crystal report.
thanks in advance
0
Comment
Question by:Olivetech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 13419584
Are you trying to use the combobox values as parameters or just to fill in text fields?  Do you need to know how to get the values to your crystalviewer form or have you already got that covered?
0
 
LVL 27

Accepted Solution

by:
planocz earned 750 total points
ID: 13420193
You have to pass your values to the CR report thru parameters that you have setup on the CR report side.

sample for datea and a ID ....

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared

    Public myReport As New ReportDocument        'Gobal Report Doc

    Private Sub Parmas(ByVal myReport)
        ' Objects used to set the parameters in the report
        Dim pvCollection As New ParameterValues
        Dim pdvID As New ParameterDiscreteValue
        Dim pdvStartName As New ParameterDiscreteValue
        Dim pdvEndName As New ParameterDiscreteValue

        Try
            '********************************* ID **********************************
            ' Set the discreet value to the Start Date.
            pdvID.Value = sID
            ' Add it to the parameter collection.
            pvCollection.Add(pdvID)
            ' Apply the current parameter values.
            myReport.DataDefinition.ParameterFields("Id").ApplyCurrentValues(pvCollection)    'Id <---Name on the CR report

            '********************************* Start Date **********************************
            pdvStartName.Value = sDBStartDate
            pvCollection.Add(pdvStartName)
            myReport.DataDefinition.ParameterFields("Start Date").ApplyCurrentValues(pvCollection)

            '********************************* End Date **********************************
            pdvEndName.Value = sDBEndDate
            pvCollection.Add(pdvEndName)
            myReport.DataDefinition.ParameterFields("End Date").ApplyCurrentValues(pvCollection)
        Catch Exp As ParameterFieldException
            MsgBox("Incorrect Parameter Field." & vbNewLine & "In Parmas Procedure Code", _
                    MsgBoxStyle.Critical, "Load Report Error")
        Catch Exp As InvalidArgumentException
            MsgBox(Exp.Message & vbNewLine & "In Parmas Procedure Code", MsgBoxStyle.Critical, "General Error")
        Catch Exp As Exception
            MsgBox(Exp.Message & vbNewLine & "In Parmas Procedure Code", MsgBoxStyle.Critical, "General Error")
        End Try
    End Sub
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question