|
-
Nov 6th, 2002, 04:24 AM
#1
Thread Starter
New Member
Refreshing Data
I have build a repor using crystal report. But from my vb application I want to show the newest change for my data. How can I refresh the data if there were any changes ? Thanks
-
Nov 6th, 2002, 05:28 AM
#2
New Member
help reduired
hi friend....i am also trying to do the same thing..if u have found any solution just post it to [email protected]
-
Nov 7th, 2002, 12:41 AM
#3
Hyperactive Member
If you are using a Crystal control it's
VB Code:
CrystalReport1.DiscardSavedData = True
Other ways of displaying a report will have similar methods
FW
-
Nov 7th, 2002, 02:24 PM
#4
Hyperactive Member
How about in the form where you have your Viewer add a timer and then refresh the report using the method of the CRViewer control...
That have worked for me a few times that I've used...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Nov 9th, 2002, 10:38 AM
#5
Lively Member
Refresh
Well well, the crystal report control, ocx etc. should have a refresh property .
In your code specify the following!
WindowShowRefreshBtn = True
If you do this then you can refresh the report data by clicking on the refresh button just like the refresh button in Crystal. The latest data will then be shown!
Hope this helps.
Do, or do not. There is no 'try'.
-
Jun 13th, 2003, 07:36 PM
#6
Lively Member
Originally posted by D12Bit
How about in the form where you have your Viewer add a timer and then refresh the report using the method of the CRViewer control...
That have worked for me a few times that I've used...
How can this be achieved? Could you please present more details.
It would be a great help.
Thanks
Last edited by NewbieVB2003; Jun 13th, 2003 at 07:40 PM.
-
Jul 11th, 2003, 12:26 PM
#7
Lively Member
ok..
if you are using the ocx then this is the code to use ......
CrystalReport1.WindowShowRefreshBtn = True
if you are using the viewer then use this......
CRViewer1.EnableRefreshButton = True
Do, or do not. There is no 'try'.
-
Nov 26th, 2003, 11:47 AM
#8
Member
Originally posted by NewbieVB2003
How can this be achieved? Could you please present more details.
It would be a great help.
Thanks
i had to resort to using a Timer. This is annoying, sluggish and inefficient.
---------------
Private Sub CRViewer1_DownloadFinished(ByVal loadingType As CRVIEWERLibCtl.CRLoadingType)
Timer1.Enabled = True
End Sub
---------------
... Where Timer1 with a interval value say... 100 and will call CRViewer1.refresh
I have been working on this for the past few days and puzzled by it and was coded by someone else before me. Efforts have been focused on streamlining and fix efficiency problems without causing accidental cascading collapse of the original program.
I've tried the Report.DiscardSavedData but gave me an error. CrViewer1.Refresh in turn would tell be report has not finished loading... so back to the timer again. Of course i have unchecked the "Saved Data with Report" under file in CR in .RPT prior to importing into VB's .DSR.
I am bummered....
Here my specs.
VB6 + Crystal Report 7 with .DSR files within my project.
Here's my code. If anyone has an answer, please advice. Thanks beforehand.
-----------------
Option Explicit
Dim Report As New rpt_Sale
Private Sub CRViewer1_DownloadFinished(ByVal loadingType As CRVIEWERLibCtl.CRLoadingType)
frm_Wait.Visible = False
End Sub
Private Sub Form_Load()
DoEvents
Me.WindowState = vbMaximized
frm_Wait.Visible = True
frm_Wait.lbl_Wait_Status.Caption = "Loading Data and Generating Report..."
DoEvents
Report.SelectPrinter Printer.DriverName, str_ReportPrinter, Printer.Port
Report.PaperOrientation = crLandscape
Report.PaperSize = crPaperA4
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
End Sub
Private Sub Form_Resize()
CRViewer1.Top = 0
CRViewer1.Left = 0
CRViewer1.Height = ScaleHeight
CRViewer1.Width = ScaleWidth
Me.WindowState = vbMaximized
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call EnableMaintForm(True)
End Sub
-------------------
Last edited by W01fgang; Nov 26th, 2003 at 12:11 PM.
-
Nov 27th, 2003, 04:23 PM
#9
Hyperactive Member
Blast! from the past!
I have found the solition for this a long tima ago...
first you have to set in your report NOT to save report data
after that you can use the
Report.DiscardSavedData ...
if you set both...then you are AOk! ...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Nov 29th, 2003, 07:15 PM
#10
Member
I have finally found out why in all of heaven that i couldn't refresh the report viewer on earlier project...
after researching though various forums and CR websites, here's some common issues and methods. hope they will help:
1. CRViewer1.Refresh
2. Report.DiscardSavedData
3. Uncheck "Saved Data with Reports" in the report via >File>Option
Well.. they all didn't work for me.... because i did not Set Report to NOTHING upon exit! for a second i felt a chill as if i am closer to the primates than homosapiens. Thanks all hints people.
Here's my code:
-----------------------------
Option Explicit
Dim Report As New rpt_Sale_Top10
Private Sub CRViewer91_DownloadFinished(ByVal loadingType As CRVIEWER9LibCtl.CRLoadingType)
frm_Wait.Visible = False
End Sub
Private Sub Form_Load()
DoEvents
Me.WindowState = vbMaximized
frm_Wait.Visible = True
frm_Wait.lbl_Wait_Status.Caption = "Loading Data and Generating Report..."
Set Report = Nothing
Set Report = New rpt_Sale_Top10
DoEvents
Report.SelectPrinter Printer.DriverName, str_ReportPrinter, Printer.Port
Report.PaperOrientation = crPortrait
Report.PaperSize = crPaperA4
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
End Sub
------------------------
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
|