Skip to Content
0
Former Member
Nov 12, 2012 at 01:03 PM

CrystalReportViewer AllowedExportFormats ignored CR Server 2011

559 Views

Hi All,

Got a bit of a weird problem with the viewer that comes with .NET runtime stuff for VS 2010. For some reason the AllowedExportFormats property is being completely ignored.

Utilities.Report objReport = new Utilities.Report(ReportID);

ReportClientDocument doc = objReport.ReportSource();

CrystalReportViewer1.EnterpriseLogon = objReport.Session();

CrystalReportViewer1.ReportSource = doc;

CrystalReportViewer1.LogOnInfo = objReport.Connection();

CrystalReportViewer1.AllowedExportFormats = (int)CrystalDecisions.Shared.ViewerExportFormats.NoFormat;

The above code is from me .NET 4 app which displays the report as expected. However, when you click the export button on the toolbar every format (including RPT which is actually what I want to remove) is still listed.

My wrapper class of Utilties.Report uses RAS (on a CR Server 2011) to get the report like so:

ReportAppFactory rptAppFactory = (ReportAppFactory)ceSession.GetService("RASReportFactory").Interface;

rptClientDoc = rptAppFactory.OpenDocument(this.ReportID, 0);

Any ideas would be appreciated.

Cheers.