Solved

Crystal Report Not Refreshing

Posted on 2001-07-20
7
423 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 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library 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…

696 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