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
Solved

Crystal DiscardSavedData() method in C#

Posted on 2006-07-10
9
1,072 Views
Last Modified: 2013-08-17
I am writing a c# program that loads a report into the Crytsal viewer and displays it on a form.
I want to be able to invoke the DiscardSavedData method to force the report to always do a new query.
I understand that this is a method of the report object but the intelisense in VS 2005 doesn't show the method

I am using VS 2005 with Crystal XI.

my code is like this
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
public bool SetReportName(string strReportName)
{
bool bRes=false;
m_ReportName=strReportName;
m_oRpt = new ReportDocument();
try
{
m_oRpt.Load(m_ReportName);
bRes=true;
}
catch (Exception e)
{
MessageBox.Show(e.Message);
return bRes;
}
return bRes;
}

'''''''''''''''''''''''''''''''''''''''''''''''''''''''
Elsewhere in the project I show the form and populate the viewer with the report ibject
// set the viewer source that actually displays the report
cvf.crystalReportViewer1.ReportSource = m_oRpt;

I was expecting to be able to do m_oRpt.DiscardSavedData() but the method isn't available.
I suspect that I am using the incorrect ReportDocument type but all the examples I have seen use this technique.
Can anyone advise please?

Thanks

0
Comment
Question by:ieg
9 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 17077597
Check if it is on the viewer object.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17077610
Did you try just typing it in?

Are you using CR XI or the Crystal that comes with VS?  If it is the standalone version did you update to Release 2 of CR XI?

mlmcc
0
 

Author Comment

by:ieg
ID: 17088307
Thanks for the reply.
I am using Crystal XI and it is updated to Crystal SP2.

I tried just typing the method in and ignoring the fact that it wasn't in the intellisense but when the project was built I got an error about an unsupported method.

I am assuming that whilst I have Crystal XI on the system it will have overwritten any components that VS2005 would have come with with the ones from SP2.

Do you have an example of this method being used in a C# program - if I could compare a working sample with my code I might be able to work out what is going on?

Thanks

Andy
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 17096588
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 17104776
Glad i could help

mlmcc
0
 

Author Comment

by:ieg
ID: 17106237
Hi mimmc,
I did some more browsing on the Business Objects site and there are other downloads specifically for Crystal XI and c# - thanks for pointing me in the right direction

Andy
0
 

Expert Comment

by:Antothottungal
ID: 22246183
try to use the following command
rptDoc.ReportOptions.EnableSaveDataWithReport = False
where rptDoc is Reportdocument
0
 
LVL 1

Expert Comment

by:mikesExpertExchange
ID: 39405035
@mlmcc: the link above just takes me to a SAP main page, no specific examples in C#. can you post some links with specific examples?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 39417295
Ask a new question.  SAP has totally change their web site and it will take some time to find them

mlmcc
0

Featured Post

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.

Question has a verified solution.

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

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

809 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