Solved

Crystal Reports Database Update

Posted on 2003-11-28
3
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 101

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 101

Expert Comment

by:mlmcc
ID: 9842731
Glad I could help

mlmcc
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
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…
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

636 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