[RESOLVED] data saved with report
This below code I am using to call report of prescription. I am using crystal report 8.0 & database is ACCESS 2000.
but my problem is that when I add one more record into database it unable to display that record. I mean it only shows the data which is saved with that report. I tried with removing tick from "saved data with report" option but that give another error that "cannot connect SQL Server".
In short my report is not "Refreshing" whenever I call that report so plz tell me is there any procedure to refresh that report at run time.
VB Code:
frmreport.CRreport.Connect = DE.Connection1
frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
frmreport.CRreport.Destination = crptToWindow
frmreport.CRreport.WindowParentHandle = frmreport.hWnd
frmreport.CRreport.SelectionFormula = str
Screen.MousePointer = Default
frmreport.CRreport.Action = 1
Re: data saved with report
shirishdawane,
Add
VB Code:
[B]frmreport.DiscardSavedData[/B]
frmreport.CRreport.Connect = DE.Connection1
frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
frmreport.CRreport.Destination = crptToWindow
frmreport.CRreport.WindowParentHandle = frmreport.hWnd
frmreport.CRreport.SelectionFormula = str
Screen.MousePointer = Default
frmreport.CRreport.Action = 1
Re: data saved with report
but where to write it coz i have tried as u told then it gives error
"Compile error : Invalide use of proparty"
VB Code:
frmreport.CRreport.DiscardSavedData
frmreport.CRreport.Connect = DE.Connection1
frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
frmreport.CRreport.Destination = crptToWindow
frmreport.CRreport.WindowParentHandle = frmreport.hWnd
frmreport.CRreport.SelectionFormula = str
Screen.MousePointer = Default
frmreport.CRreport.Action = 1
Re: data saved with report
shirishdawane,
Sorry, I am sleepy. Here is the correct code.
VB Code:
[B]CRreport.DiscardSavedData[/B]
frmreport.CRreport.Connect = DE.Connection1
frmreport.CRreport.ReportFileName = App.Path + "\rptprescription.rpt"
str = "{presciption.dateofvisit} = '" & DTPicker1.Value & "' and {presciption.pname} = '" & cmbpatientname.Text & "'"
frmreport.CRreport.Destination = crptToWindow
frmreport.CRreport.WindowParentHandle = frmreport.hWnd
frmreport.CRreport.SelectionFormula = str
Screen.MousePointer = Default
frmreport.CRreport.Action = 1
Re: data saved with report
sorry to disturb u but again it showing error that "Cannot open SQL Server"
plz help
Plz any1 help.. data saved with report
I have searched in this forum but i have not got any satisfactory answer if any one knows plz tell me only this part of my project is remainig & i have to finish it by today itself otherwise my boss will kill me.
Re: data saved with report
shirishdawane,
Then the problem is with your connection. Post what your connection code is.
DE.Connection1?