views:

759

answers:

4

In Crystal Reports Viewer (2008) for ASP.Net, when you click on the Export button, the Export dialog shows up with File Format options:

  • Crystal Reports (RPT)
  • PDF
  • Microsoft Excel(97-2003)
  • Microsoft Excel(97-2003) Data-Only
  • Microsoft Word (97-2003)
  • Microsoft Word (97-2003) Editable
  • Rich Text Format (RTF)
  • XML

etc..

Does anyone know how to remove some of these options so that end users wouldn't see it?

+1  A: 

We've ran into this same issue and ended up rolling our own export page and limited the selection there.

It works great, but I would have expected more from Crystal Reports!

mattruma
+1 I do the same...but I expect nothing but the worst from Crystal.
dotjoe
A: 

Hello, From what I was able to find, you could try to create your own export button option, removing the given button option and adding your own to the asp page. You would need to start by dragging the button onto the page and double clicking it to auto generate the code. From there add the code

crystalReportViewer1.ExportReport ()  

Once this code is in it will use the default settings for the export options, however if you want to change the export options within that button then you have to manually code it.

' Declare variables and get the export options.
Dim exportOpts As New ExportOptions()
Dim diskOpts As New DiskFileDestinationOptions()
Dim excelFormatOpts As New ExcelFormatOptions()
exportOpts = Report.ExportOptions

' Set the excel format options.
excelFormatOpts.ExcelTabHasColumnHeadings = true

exportOpts.ExportFormatType = ExportFormatType.Excel
exportOpts.FormatOptions = excelFormatOpts

' Set the export format.
exportOpts.ExportFormatType = ExportFormatType.Excel

exportOpts.ExportDestinationType = ExportDestinationType.DiskFile

' Set the disk file options.
diskOpts.DiskFileName = fileName
exportOpts.DestinationOptions = diskOpts

Report.Export()

MSDN SITE

This link gives you the same code posted above. It show how to do it in Visual Basic code. therefor in your aspx.vb code you would have to manually enter the the types of formats you want.

Justin Gregoire
Thanks for the response. I would like to use the inbuilt export options rather than writing my own (Though, I don't find it difficult to do so).
arakkots
@arakkots Not a problem. If i do come across anything else I will be sure to update my post.
Justin Gregoire
A: 

You might be able to control the export options by removing the export DLLs. Search for crxf_*.dll in the Business Objects\Common\\bin directory.

Craig
A: 

I have the same problem.. I need to Restrict the Some Export options, using the inbuilt Export Button rather than writing my own code. Can anyboby help?

Viajy