944,165 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 2204
  • VB.NET RSS
Jan 8th, 2007
0

Refreshing a crystal report with parameters

Expand Post »
PLEASE HELP >>>QUICKLY


The code works fine the first time but when I click a different client I get the same report doesnt change... any help what so ever will be greatly appreciated......
thanks in advanced

[ Private Sub ddlfullname_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlfullname.SelectedIndexChanged

'medical.SelectionFormula = "{medical_records.client_id} ={?client_id}"
' medical.ReportSource = "C:\Inetpub\wwwroot\WebApplication2\crystalreportmedical.rpt"


Dim client_id As String
'client_id = ""
client_id = ddlfullname.SelectedItem.Value
cmdnamebyids.Parameters("@client_id").Value = client_id

ConfigureMedicalReport()
ConfigureclaimsReport()
'medical.ReportSource = "C:\Inetpub\wwwroot\WebApplication2\crystalreportmedical.rpt"
SqlConnection2.Open()
Dim dreader As SqlClient.SqlDataReader
dreader = cmdnamebyids.ExecuteReader(CommandBehavior.SingleRow)
If dreader.Read() Then
fname.Text = dreader(1)
lname.Text = dreader(3)
hphone.Text = dreader(10)
mdcondition.Text = dreader(17)
address.Text = dreader(4)
repfname.Text = dreader(8)
replname.Text = dreader(9)
city.Text = dreader(5)
state.Text = dreader(6)
zip.Text = dreader(7)
diagnosedate.Text = dreader(18)
cancerpolicyco.Text = dreader(19)
agentname.Text = dreader(21)
policynumber.Text = dreader(22)
dateofpurchase.Text = dreader(20)
TextBox1.Text = dreader(15)
End If
dreader.Close()
SqlConnection2.Close()



End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
With cmdupdates
.Parameters("@client_id").Value = ddlfullname.SelectedItem.Value
.Parameters("@attorney_notes").Value = TextBox1.Text
End With
SqlConnection2.Open()
cmdupdates.ExecuteNonQuery()
SqlConnection2.Close()

End Sub

Private Sub ConfigureMedicalReport()
' medical.ReportSource = ("C:\Inetpub\wwwroot\WebApplication2\crystalreport1.rpt")
Dim rptmedical As New ReportDocument
'rptmedical.Dispose()

Dim pvcollection As New CrystalDecisions.shared.ParameterValues
Dim pdvclientid As New CrystalDecisions.Shared.ParameterDiscreteValue



Dim tbcurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tlicurrent As CrystalDecisions.Shared.TableLogOnInfo

rptmedical.Load("C:\Inetpub\wwwroot\WebApplication2\crystalreportmedical.rpt")
rptmedical.Refresh()
For Each tbcurrent In rptmedical.Database.Tables
tlicurrent = tbcurrent.LogOnInfo
With tlicurrent.ConnectionInfo
.ServerName = "WEBSERVER"
.UserID = "dax"
.Password = "whitfield"
.DatabaseName = "cancer"
End With
tbcurrent.ApplyLogOnInfo(tlicurrent)
Next tbcurrent

pvcollection.Clear()
rptmedical.DataDefinition.ParameterFields("client_id").ApplyCurrentValues(pvcollection)

pdvclientid.Value = ddlfullname.SelectedItem.Value
pvcollection.Add(pdvclientid)
rptmedical.DataDefinition.ParameterFields("client_id").ApplyCurrentValues(pvcollection)

medical.ReportSource = rptmedical]
Similar Threads
dax
Reputation Points: 10
Solved Threads: 0
Newbie Poster
dax is offline Offline
3 posts
since Dec 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: POP before SMTP authentication
Next Thread in VB.NET Forum Timeline: To read color highlighted text in word document from vb.net





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC