Click here to Skip to main content
15,890,123 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: Problem with check box Pin
nazimghori21-Mar-09 18:23
nazimghori21-Mar-09 18:23 
AnswerRe: Problem with check box [modified] Pin
DaveAuld21-Mar-09 21:54
professionalDaveAuld21-Mar-09 21:54 
QuestionRe: Problem with check box Pin
nazimghori21-Mar-09 22:58
nazimghori21-Mar-09 22:58 
QuestionRe: Problem with check box Pin
nazimghori21-Mar-09 23:11
nazimghori21-Mar-09 23:11 
AnswerRe: Problem with check box Pin
DaveAuld21-Mar-09 23:52
professionalDaveAuld21-Mar-09 23:52 
AnswerRe: Problem with check box Pin
Henry Minute23-Mar-09 10:57
Henry Minute23-Mar-09 10:57 
QuestionRe: Problem with check box Pin
Leinad_3021-Dec-10 12:08
Leinad_3021-Dec-10 12:08 
Questionvb.net pass paraqmeters to crystal reports Pin
jazzgirl20-Mar-09 19:57
jazzgirl20-Mar-09 19:57 
How should I pass 2 parameters from a vb.net 2005 windows application to a crystal report that is written in version 11?
I am working on a Visual Basic.NET 2005 windows application. This application needs to call an existing crystal report written in version 11 and needs to pass two (2) parameters to the crystal report.
When I step though the code I think I am passing the first parameter, and I know that I am not passing the second parameter. I am getting an error message on the second when I step though the code.
My code is basically the following (except I do not know how to code the second parameter)
mports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Windows.Forms
Imports System.Data.SqlClient

Public Class vbCls

Dim cryRpt As New ReportDocument

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim cryRpt As New ReportDocument
Dim sql As String
Dim connetionString As String
Dim connection As SqlConnection
Dim adapter As SqlDataAdapter
Dim ds As New DataSet
Dim i As Integer
'located crystal report from
Dim strReportPath As String = "C:\TstReport.rpt"
connetionString = "Data Source=server3;Initial
Catalog=ProgTest;User ID=xxx;Password=xxxx"
connection = New SqlConnection(connetionString)
sql = "select * from test_table"

Try
connection.Open()
adapter = New SqlDataAdapter(sql, connection)
adapter.Fill(ds)
connection.Close()

cryRpt.Load(strReportPath)

Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue As New ParameterDiscreteValue

crParameterDiscreteValue.Value = 12345
crParameterFieldDefinitions = _
cryRpt.DataDefinition.ParameterFields
crParameterFieldDefinition = _
crParameterFieldDefinitions.Item("@Id")
crParameterValues = crParameterFieldDefinition.CurrentValues

crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.Refresh()

Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub

End Class


The error message I am getting every time I try to code a second parameter is pass is the following:
crystaldecisions.crystalreports.engine.ParameterFieldCurrentValueException: Missing parameter values
-->System.Runtime.InteropServices.ComException (0x8004100E): Missing paramter values.


Thnaks!
QuestionHow do i handle Group Hierarchy? Pin
r_mohd20-Mar-09 18:18
r_mohd20-Mar-09 18:18 
AnswerRe: How do i handle Group Hierarchy? Pin
Henry Minute21-Mar-09 9:57
Henry Minute21-Mar-09 9:57 
QuestionUsing functions in Access Modules using OLEDb ExecuteNonQuery Pin
Rob Beckinsale20-Mar-09 6:23
Rob Beckinsale20-Mar-09 6:23 
AnswerRe: Using functions in Access Modules using OLEDb ExecuteNonQuery Pin
Eddy Vluggen21-Mar-09 0:22
professionalEddy Vluggen21-Mar-09 0:22 
GeneralRe: Using functions in Access Modules using OLEDb ExecuteNonQuery Pin
Rob Beckinsale21-Mar-09 1:13
Rob Beckinsale21-Mar-09 1:13 
QuestionVB??????? Pin
jackjames1548620-Mar-09 6:18
jackjames1548620-Mar-09 6:18 
AnswerRe: VB??????? Pin
Jon_Boy20-Mar-09 7:24
Jon_Boy20-Mar-09 7:24 
AnswerRe: VB??????? Pin
Dave Kreskowiak20-Mar-09 10:21
mveDave Kreskowiak20-Mar-09 10:21 
AnswerRe: VB??????? Pin
Christian Graus20-Mar-09 11:08
protectorChristian Graus20-Mar-09 11:08 
Questiondll function and arguments Pin
Member 300016220-Mar-09 4:42
Member 300016220-Mar-09 4:42 
AnswerRe: dll function and arguments Pin
Dave Kreskowiak20-Mar-09 4:58
mveDave Kreskowiak20-Mar-09 4:58 
GeneralRe: dll function and arguments Pin
Jon_Boy20-Mar-09 5:07
Jon_Boy20-Mar-09 5:07 
GeneralRe: dll function and arguments Pin
Member 300016220-Mar-09 10:53
Member 300016220-Mar-09 10:53 
QuestionCOM Exception in VB6 to VB.NET conversion [modified] Pin
BREdwards20-Mar-09 2:37
BREdwards20-Mar-09 2:37 
QuestionHow do i capture httprequest or header? Pin
milansolanki19-Mar-09 23:53
milansolanki19-Mar-09 23:53 
AnswerRe: How do i capture httprequest or header? Pin
Dave Kreskowiak20-Mar-09 5:00
mveDave Kreskowiak20-Mar-09 5:00 
AnswerRe: How do i capture httprequest or header? Pin
tech60320-Mar-09 17:48
tech60320-Mar-09 17:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.