Solved

Crystal Reports Database Update

Posted on 2003-11-28
3
251 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
ID: 9837756
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
ID: 9838596
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
ID: 9842731
Glad I could help

mlmcc
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

813 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

13 Experts available now in Live!

Get 1:1 Help Now