|
-
Aug 1st, 2007, 06:28 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Record Selection according to Textbox value
I am working with Crystal Reports XI along with VS2005. I am opening my report document from the CrystalReportsViewer.
Following is the code for it:
Code:
Option Strict On
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class OrderForm
Private Sub OrderForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ConfigureCrystalReports()
End Sub
Private Sub ConfigureCrystalReports()
Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
myConnectionInfo.ServerName = "xxxx"
myConnectionInfo.DatabaseName = "xxxx"
myConnectionInfo.UserID = "xxxxx"
myConnectionInfo.Password = "xxxxx"
SetDBLogonForReport(myConnectionInfo)
End Sub
Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo)
Dim myTableLogOnInfos As TableLogOnInfos = CrystalReportViewer1.LogOnInfo()
For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos
myTableLogOnInfo.ConnectionInfo = myConnectionInfo
Next
End Sub
End Class
Now, i want to open the record from the table 'Order' (which is in Oracle DB) where the orderno is equal to the textbox value in my OrderBooking.vb. Where should i pass the SQL command ? in the CR or VB ?
Last edited by LuxCoder; Aug 1st, 2007 at 06:32 AM.
-
Aug 3rd, 2007, 02:51 AM
#2
Addicted Member
Re: Record Selection according to Textbox value
for example that field in report is textbox
so u will do the following
cr.selectionformula="{Report1.textbox}='"& textbox1.text &"'
if it does not work then let me know
Thanks and Regards,
Muhammad Abbas
-
Aug 3rd, 2007, 03:43 AM
#3
Thread Starter
Hyperactive Member
Re: Record Selection according to Textbox value
what should i declare cr as ??? and where should both the codes be written ?
-
Aug 3rd, 2007, 03:57 AM
#4
Thread Starter
Hyperactive Member
Re: Record Selection according to Textbox value
I have used the following code:
vb Code:
Private Sub OrderForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim cr As New ReportDocument
ConfigureCrystalReports()
cr.RecordSelectionFormula = "{orderform.orderno}='" & Booking.TextBox1.Text & "'"
End Sub
It gives me "invalid report file path" error.
-
Aug 9th, 2007, 06:40 AM
#5
New Member
Re: Record Selection according to Textbox value
It looks like you need to set the Reportsource property of your reportdocument object.
-
Aug 10th, 2007, 04:29 AM
#6
Thread Starter
Hyperactive Member
Re: Record Selection according to Textbox value
i have done that too... it did nt work !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|