Solved

Crystal Report Not Refreshing

Posted on 2001-07-20
7
414 Views
Last Modified: 2012-08-14
I have a VB application with Crystal Reports incorporated through ActiveX components.  When I run the CRViewer the Report which connects through ODBC with AS400 back-end is not refresh to the latest changes in the backend.  I must enable Crystal Report's refresh button so users can refresh the data.  I have already disable 'Save Data with Report' in Crystal Report Designer prior to importing the report into VB.  When I click on refresh button the report is refresh with the latest data. Should I include VB code in the CRViewer so the report gets refresh automatically once is loaded ?
How do I do this ?  Please provice sample code.

Thank you.
0
Comment
Question by:Ogueds
7 Comments
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6303566
Add a Timer control to your project and add this code

Private Sub Form_Load()
  With Timer1
    .Interval = 60000  'set to trigger every 1 minute (it's max value)
    .Enabled = True
  End With
End Sub

Private Sub Timer1_Timer()
  CRViewer1.Refresh  <-- Call the refresh here
End Sub
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6304039
Prior to calling the CRViewer1.ViewReport method, set these properties:

CRViewer1.DisplayToolbar = True
CRViewer1.EnableRefreshButton = True

This will allow your users to refresh the data on demand.
0
 
LVL 1

Accepted Solution

by:
Aaron_Young earned 50 total points
ID: 6304180
Use the "DiscardSavedData()" method of the Report Object prior to displaying the report.  This will Discard any saved data (if any) and force a refresh.

If you want to "continually" refresh the reports data whilst it's displayed then any of the methods already suggested should work fine, I'd probably opt. for enabling the Refresh button and letting the User decide when a Refresh is necessary.

Regards,

- Aaron.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Expert Comment

by:NellaiSiva
ID: 6304434
Hi

It is very simple. Set the Crystal Report OCX property "DiscaredSaveData" to true. This will solve your problem.

siva
0
 
LVL 12

Expert Comment

by:DRRYAN3
ID: 6304864
NellaiSiva -

Your account was created in March - you should know how things work around here by now.  Do not propose an answer unless you are more than 100% sure it is correct.  Yours is not.  Not only have you misspelled the property name, but your proposed answer repeats Aaron_Young's comment.

Oqueds - please REJECT the proposed answer.
0
 

Expert Comment

by:ComTech
ID: 6304971
Proposed answer rejected.

ComTech
Community Support Moderator
0
 

Expert Comment

by:ComTech
ID: 6304972
From EE Policy:

Advice for Experts on Providing Solutions Through Comments or Answers Experts may post solutions to your question in the form of a comment or answer, so be sure to check every email notification as soon as it arrives. Often, an Expert posts the solution to your problem as a comment because it is early in the collaboration process and other issues may be involved. In addition, it is common etiquette in some topics areas to always post comments and not answers. There are several reasons behind this thinking:

Questions do not become prematurely locked and the collaboration process is not inhibited when the question
is indexed as open for proposed solutions. The question-asker has the power to select the best solution rather than one that is simply suggested as an answer.

Watch out for unclear or multiple-part questions. You can send a comment to the member requesting that they rephrase or break up the question before you submit an answer.
If you don't know the answer, leave the question for someone else.

If you are unsure of your solution, post it as a comment rather than an answer. Members can accept comments as solutions and award points for them. You are only responsible for providing one reasonable answer.
You may review information about a member, including their grading history, by clicking on their member name.
If you're having a problem with a Member, you can refer it to us.


Thank you,
ComTech
Community Support
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…
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…

743 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

9 Experts available now in Live!

Get 1:1 Help Now