Solved

To refresh segate Crystal Report

Posted on 2002-04-11
8
405 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
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!

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

685 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