Solved

Crystal Reports Database Update

Posted on 2003-11-28
3
249 Views
Last Modified: 2010-05-03
Ive started to use Crystal Reports 9 however I have a problem with the view control and printing, if I add another entry to the database the report is using the report doesn't see this unless I hit the refresh button on the report preview, even if I call the refresh commands from within VB it doesn't appear to update the data.

Ne help would be appreciated.
0
Comment
Question by:Terry Rogers
  • 2
3 Comments
 
LVL 1

Expert Comment

by:Sector10
Comment Utility
The refresh button only functions if you also add the login credentials for the database. The report that you are viewing contains only the data from the day you when you created the report.

To enable the report to also update the data when you press the refresh button you can use the following code:

Private Sub ReportViewer_RefreshButtonClicked(UseDefault As Boolean)
'To refresh the data you MUST login first!
Dim CRXTable As CRAXDRT.DatabaseTable
For Each CRXTable In m_Report.Database.Tables
   CRXTable.SetLogOnInfo Servername, "Database", UserName, Password
Next
End Sub

Happy Coding!

Paul
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 240 total points
Comment Utility
Is the data saved with the report?

Open the report
Click FILE
Ensure SAVE DATA WITH REPORT is not checked.

Or
Add a line

crRpt.DiscardSavedData to the VB program.

Replace crRpt with your report object

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Glad I could help

mlmcc
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now