Solved

To refresh segate Crystal Report

Posted on 2002-04-11
8
401 Views
Last Modified: 2010-05-02
I am running  Segate crystal report from VB application , but I  didn't get the updated data from the report , only what I saved on crystal report . I want refresh it with the data in MSAccess .
I am using the code
 crystalreport1.action=0
 before thise I want to use any code... ?
I know their is a  refresh button in the report , but I want it using vbcode
0
Comment
Question by:yasinmon
8 Comments
 
LVL 18

Expert Comment

by:bobbit31
ID: 6934708
what version of crystal?

are you using the crviewer control?

if so, you can do crviewer1.refresh
0
 
LVL 2

Expert Comment

by:damion69
ID: 6934821
You want to set the action = 1


crystalreport1.action=1

Before that you need to set you logon information ect.
0
 
LVL 18

Accepted Solution

by:
mdougan earned 50 total points
ID: 6935013
Either in the Crystal IDE Report designer, uncheck the option under the file menu that says "Save Data With Report".

Or, in VB, before setting the action = whatever, say:

Report1.DiscardSavedData = True
Report1.Action = ......
0
 
LVL 5

Expert Comment

by:kcm76
ID: 6935767
mdougan is right. i too had the same problem in the initial stages.

in crystal ActivexControl The default value of DiscardSavedData will be false. Make it true and Run the report.

to mdougan: I dont think **save data with report** will work.

KCM
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 100

Expert Comment

by:mlmcc
ID: 6935816
Another way is to edit the report and turn off the sve data with report flag and then save the report.  That way you will never have saved data with the report.  I do that for all my reports (over 75) and I always get the latest data.

mlmcc
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6935910
kcm76 and mlmcc, that is what I was saying

"in the Crystal IDE Report designer, uncheck the option under the file menu that says "Save Data With Report"."

As far as I know, the way it works is that if you leave that checked (it is the default) then the data is saved when you run the report through the Crystal IDE.  But, if you never save it through Crystal, you don't have to do anything in VB.  However, if you have saved the data through Crystal, you can discard it in VB with the DiscardSavedData flag.
0
 
LVL 2

Expert Comment

by:damion69
ID: 6937056
You can have the data saved with the report and still run it. I have a scheduling tool that I use that workes off of saving the report with data, and then I pass it dates daily, and it reruns the report will all the parameters that I had saved it with, but updates the report with new data. I know for a fact it can be dont, I am doing it. The main issue he is having is the crystalreport1.action=0 if it is 0 then it isnt going to do anything. It has to be set to 1 and this is also in the samples from the crystal website...
0
 

Author Comment

by:yasinmon
ID: 6942698
your absolutly correct , both your suggetions will work
 i mean "savedatawithreport" also work
thank you for your valuable information
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

746 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

10 Experts available now in Live!

Get 1:1 Help Now