Solved

Crystal Reports Database Update

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 78
Hide vba in gp 7 104
How to make an ADE file by code? 11 93
transition to visual .net from vb6 5 36
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

790 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