Solved

To refresh segate Crystal Report

Posted on 2002-04-11
8
406 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
[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
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exit a vb6 apps when a calling it apps closes 15 63
Hide vba in gp 7 127
how to know if my Checkbox is True in VB6.0? 9 71
VBA Replace Function - What am I missing? 3 52
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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…

710 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