[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Crystal Report Not Refreshing

Posted on 2001-07-20
7
Medium Priority
?
431 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
[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
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 150 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
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!

 

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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…
Suggested Courses

650 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