473,395 Members | 2,436 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Passing Parameter from VB to CR

Good Day Guys! I have a new problem with my program. i've already created my report in crystal. within my report it has parameter (myinvoice) that the user needs to input. after that ive attached that report tom my reportviewer. i also added a textbox in my form where my value for the parameter is assigned. the problem now is the data being generated by the CR does not match with the parameter stated in my textbox.
heres my code:
Private Sub frmReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = invoice
Dim txtvalue As String
txtvalue = TextBox1.Text
Dim myreport As New rptinvoice
myreport.SetParameterValue("myinvoice", txtvalue)
End Sub


TIA
Dec 10 '07 #1
5 1490
debasisdas
8,127 Expert 4TB
Try to change the event from form load to any button click event after form load.
Dec 10 '07 #2
Try to change the event from form load to any button click event after form load.
sir,
the value of invoice is inherited from the other form. thats why i've created the code in the for load event. once i call my report form it will generate the report base on the parameter assinged to my textbox.
Dec 10 '07 #3
still waiting for your advices.
Dec 11 '07 #4
Shashi Sadasivan
1,435 Expert 1GB
have you used the debugger to find out what is the value of the variable txtvalue being sent to your crystal report document?
Dec 11 '07 #5
have you used the debugger to find out what is the value of the variable txtvalue being sent to your crystal report document?
ive already revised my code but still it didnt work. ive already tried assigning a value to the sql command instead of a textbox1.text but still it didnt work. i desperately need your help guys.

Private Sub frmReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = invoice
Dim rpt As New rptinvoice

Try
connection.Open()
Dim dat3 As SqlDataAdapter = New SqlDataAdapter("select a.*,b.* from inv_hdr a,inv_dtl b where a.invoice = '" & TextBox1.Text & "' and b.invid = a.invoice ", connection)
Dim dt3 As New DataSet
dat3.Fill(dt3, "sinv")
rptviewer.ReportSource = rpt

Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
connection.Close()
End Try
End Sub
Dec 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
5
by: Andy | last post by:
Hi Could someone clarify for me the method parameter passing concept? As I understand it, if you pass a variable without the "ref" syntax then it gets passed as a copy. If you pass a...
6
by: wiredless | last post by:
What is the advantage of passing an interface type? according to UML (visio) when i reverse engineer existing code to a UML diagram I get the error "UMLE00046: sample : - An interface cannot...
11
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
2
by: diffuser78 | last post by:
I wrote a small app in wxPython using wxGlade as designer tool. wxGlade brings and writes a lot of code by itself and thats where my confusion started. Its about parameter passing. Here is my...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
by: amazon | last post by:
I have web service that acceping following parameters.. postev.PostEvent(authentication as ws.authentication, name as string,id as string, exdate as date, parameter() as ws.nameparametervaluepair...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
12
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
4
by: Deckarep | last post by:
Hello fellow C# programmers, This question is more about general practice and convention so here goes: I got into a discussion with a co-worker who insisted that as a general practice all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.