cancel
Showing results for 
Search instead for 
Did you mean: 

How to prompt Export-Format-Dialog from CRView2008

Former Member
0 Kudos

Hi all,

I'm using Vs.net2008+CR2008 component to construct a win-from app.

As the legacy system uses CR9 component, when user click "export" in CRViewer9, it uses following code:

CRAXDRT.Report.Export true (VB6 code) to pop-up an export dialog that contains "Format" dropdownlist with "pdf,rtf,ODBC,MS word..." as options and "Destination" dropdownlist with "Application,disk file, MAPI..." as options.

Because CR2008 changes these behaviors a lot, I can't find some API to bring up that similar dialog to allow use to export by choosing "Format" and "Destination". It seems the only way is to develop that form using C# manually and deal with all these functionality.

Since our users insist to ask that behavior the same as legacy system. Can anybody help on this? Is there a good approach to deal with my case?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Mark,

You are correct, they have changed the export prompts in the new .NET viewer. There is an Export button that will all the user to select the format but it no longer allows you to specify the destination other than to Disk.

You can use it or as you indicated you will need to build your own export UI and program each destination. Here's a sample using RAS that can get you going:

private void Export_Click(object sender, EventArgs e)

{

//export Rtf to mapi

CrystalDecisions.CrystalReports.Engine.ReportDocument repdoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

CrystalDecisions.Shared.DiskFileDestinationOptions diskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions();

CrystalDecisions.Shared.ExportOptions ExpOpts = new CrystalDecisions.Shared.ExportOptions();

CrystalDecisions.Shared.HTMLFormatOptions htmlopts = new CrystalDecisions.Shared.HTMLFormatOptions();

CrystalDecisions.Shared.MicrosoftMailDestinationOptions MailOpts = new CrystalDecisions.Shared.MicrosoftMailDestinationOptions();

//repdoc = rptClientDoc;

repdoc.Load("c:
report2.rpt");

ExpOpts = repdoc.ExportOptions;

ExpOpts.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.MicrosoftMail;

ExpOpts.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.RichText;

diskOpts.DiskFileName = "MyReport.rpt";

MailOpts.MailToList = "Don Williams";

MailOpts.MailSubject = "Attached is a PDF file - .net Export test ";

MailOpts.MailSubject = "This is the Subject";

//MailOpts.MailCCList = "John Doe";

MailOpts.UserName = "intl
dwilliams";

MailOpts.Password = "yourpassword";

ExpOpts.DestinationOptions = MailOpts;

repdoc.Export();

}

Also note the RDC is no longer shipped in CR 2008.

Thank you

Don

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

I believe you are using CR2008 with SP0 at least.

CRAXDRT seems to be a RDC component and RDC it is no longer available with CR2008 product.(I may be wrong about the CRAXDRT thing!)

Also, please note that whatever export option you are looking for please make sure that it is available from the designer. Most of them are available using the sdks. If you need anything different you need to use our API's and design them.

Does that help?

Regards,

AG.