Refreshing a crystal report with parameters

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2006
Posts: 3
Reputation: dax is an unknown quantity at this point 
Solved Threads: 0
dax dax is offline Offline
Newbie Poster

Refreshing a crystal report with parameters

 
0
  #1
Jan 8th, 2007
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]
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC