|
-
Aug 3rd, 2005, 04:31 AM
#1
Thread Starter
Hyperactive Member
[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
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Aug 3rd, 2005, 04:56 AM
#2
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
-
Aug 3rd, 2005, 05:09 AM
#3
Thread Starter
Hyperactive Member
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
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Aug 3rd, 2005, 05:13 AM
#4
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
-
Aug 3rd, 2005, 05:21 AM
#5
Thread Starter
Hyperactive Member
Re: data saved with report
sorry to disturb u but again it showing error that "Cannot open SQL Server"
plz help
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Aug 3rd, 2005, 05:40 AM
#6
Thread Starter
Hyperactive Member
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.
On Error GoTo http://www.vbforums.com
Note :
1) Please use [vbcode]your code goes in here [/vbcode] tags when posting VB code.
2) Please mark thread as Resolved using the Thread Tools menu, if you got solution.
-
Aug 3rd, 2005, 12:15 PM
#7
Re: data saved with report
shirishdawane,
Then the problem is with your connection. Post what your connection code is.
DE.Connection1?
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
|