|
-
Aug 26th, 2003, 11:00 AM
#1
Thread Starter
Addicted Member
Refreshing Crystal Rpt
I use Crystal Rpt 8.0 via the Report Design Component in Visual Basic 6.
I am using the following method for calling up my reports:
VB Code:
With frmRptView
.Show
.CRViewer1.ReportSource = rptPrimDls3
.CRViewer1.ViewReport
End With
frmRptView is a form I use to call up all of my reports. The only thing on it is the CRViewer1 control.
My problem is that the report is not refreshing accordingly. If the user makes a change to the underlying table, which the report is based on, and then goes into view the report the change will not be reflected. It is only after the user exits the application and returns that the change will appear in the report.
Note: Doesn't seem to matter if I have the report set to 'Verify on Every Print' or not.
Thnx
Last edited by Jefftopia; Oct 23rd, 2003 at 09:02 AM.
-
Aug 27th, 2003, 11:56 AM
#2
Hyperactive Member
Have you tried adding....
if that does not work, try modifying the method you use to call your report. Usually, in all reports that "I" have encountered so far, you have this part (see 2 lines below) inside the form - frmRptView (Form_LOAD) itself. If you have it already, then try removing the 2 lines in your code.
VB Code:
.CRViewer1.ReportSource = rptPrimDls3
.CRViewer1.ViewReport
In my case, I usually just call the form and the report comes up.
VB Code:
frmRptView.Show 'YOU WILL BE LOADING THE FORM TO BE VIEWED ON THE SCREEN. ALL
'CRYSTAL RELATED EVENTS SHOULD BE PLACED
'OR INITIALIZED WITHIN THE FORM ITSELF.
Last edited by ARPRINCE; Aug 27th, 2003 at 12:22 PM.
-
Aug 27th, 2003, 04:42 PM
#3
Thread Starter
Addicted Member
Refresh Method
I tried adding CRViewer1.Refresh as suggested and received a Run-time error: Method 'Refresh' of object 'ICrystalReportViewer3' failed.
Until I can figure something else out, I set EnableRefresh button property to True. Now my users will have to use this button to update their report. Why can't I do what this button in Crystal Reports is doing in vb?
-
Aug 27th, 2003, 05:55 PM
#4
Hyperactive Member
not quite sure here...
is this a typo ?
object 'ICrystalReportViewer3'
do you somehow have more than one object on the page? Because everywhere else I am seeing CrystalReportViewer1...
Talk does not cook rice.
-Chinese Proverb
-
Aug 27th, 2003, 11:23 PM
#5
ICrystalReportViewer3 is a Crystal COM object.
These types of errors are usually caused by an invalid installation or corrupt registry. One or more of the crystal dlls may not have registered properly or could be the wrong version.
I am suprised the Refresh button on the Viewer control works.
-
Oct 14th, 2004, 06:35 PM
#6
Fanatic Member
...
I get the same error when I try to refresh my Viewer programmatically
so where is the solution for this issue?
-
Oct 14th, 2004, 08:14 PM
#7
See this other thread that I answered.
CR Refresh
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Dec 1st, 2005, 01:48 AM
#8
Hyperactive Member
Re: Refreshing Crystal Rpt
 Originally Posted by Jefftopia
I use Crystal Rpt 8.0 via the Report Design Component in Visual Basic 6.
I am using the following method for calling up my reports:
VB Code:
With frmRptView
.Show
.CRViewer1.ReportSource = rptPrimDls3
.CRViewer1.ViewReport
End With
frmRptView is a form I use to call up all of my reports. The only thing on it is the CRViewer1 control.
My problem is that the report is not refreshing accordingly. If the user makes a change to the underlying table, which the report is based on, and then goes into view the report the change will not be reflected. It is only after the user exits the application and returns that the change will appear in the report.
Note: Doesn't seem to matter if I have the report set to 'Verify on Every Print' or not.
Thnx
Try using CRViewer1.RecordSelectionFormula on your parameter so that every time a user presses the refresh button the report will look to the valu in the recordselectionformula.
Rate Me! Rate Me! Rate Me!
Time to fly.
Copyright GraysonSoft Inc. 2007
-
Dec 10th, 2005, 03:16 AM
#9
New Member
Re: Refreshing Crystal Rpt
you can refresh your report by closing the odbc connection before calling this code.
 Originally Posted by Jefftopia
I use Crystal Rpt 8.0 via the Report Design Component in Visual Basic 6.
I am using the following method for calling up my reports:
VB Code:
With frmRptView
.Show
.CRViewer1.ReportSource = rptPrimDls3
.CRViewer1.ViewReport
End With
frmRptView is a form I use to call up all of my reports. The only thing on it is the CRViewer1 control.
My problem is that the report is not refreshing accordingly. If the user makes a change to the underlying table, which the report is based on, and then goes into view the report the change will not be reflected. It is only after the user exits the application and returns that the change will appear in the report.
Note: Doesn't seem to matter if I have the report set to 'Verify on Every Print' or not.
Thnx
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
|