Solved

Crystal Reports Database Update

Posted on 2003-11-28
3
258 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

738 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