Solved

To refresh segate Crystal Report

Posted on 2002-04-11
8
402 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 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

17 Experts available now in Live!

Get 1:1 Help Now