?
Solved

Crystal Report Not Refreshing

Posted on 2001-07-20
7
Medium Priority
?
436 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 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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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
Course of the Month16 days, 16 hours left to enroll

864 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