Solved

To refresh segate Crystal Report

Posted on 2002-04-11
8
404 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
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.
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…

839 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