Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Limiting the Export types in a C# Crystal Reports Viewer

Posted on 2003-12-03
Medium Priority
Last Modified: 2008-02-07
Hi all,

    Is there any way you can limit the export types in a Crystal Reports export dialog box ? Ive written a viewer in c#/.Net which works well, but I would like to limit the export options available to the user, say to PDF and XLS....


Question by:adders99
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
  • 3
  • 3

Expert Comment

ID: 9867557
static drop down box with the two option, depending on selected value set your exportoption value accordingly.


Author Comment

ID: 9867603
Sorry, I should have said, Im using the standard Crystal Report component for .net which comes with its own toolbar, export option etc, so Im not actually building a drop down myself.....I was hoping to avoid creating one, just wanted to restrict the existing one.

Expert Comment

ID: 9867635
can you post some code, im not too sure what you are using.
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.


Author Comment

ID: 9867676
Im not sure what I can post as its a standard visual control you paste onto a form. I know I can specify the export type, and export like that, but I need to allow the user to select from a list. So, in the example below, Ive added code behind an 'EXPORT' button to export in Excel format, but Id like the user to choose from a controlled list...

// Declare variables and get the export options.
ExportOptions exportOpts = new ExportOptions();
ExcelFormatOptions excelFormatOpts = new ExcelFormatOptions ();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = ReportInstance.ExportOptions;

// Set the excel format options.
excelFormatOpts.ExcelUseConstantColumnWidth = true;
exportOpts.ExportFormatType = ExportFormatType.Excel;
exportOpts.FormatOptions = excelFormatOpts;

// Set the disk file options and export.
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = "C:\\temp.xls";
exportOpts.DestinationOptions = diskOpts;

ReportInstance.Export ();

Accepted Solution

mnye earned 100 total points
ID: 9867729
Yeah I think you're going to have to create your own dropdown.  I dont see any other way around that.  its pretty simple though.

<asp:dropdownlist id="ddlExport" runat="server"
   <asp:listitem value=1>Excel</asp:listitem>
   <asp:listitem value=2>PDF</asp:listitem>

then set up another routine for the pdf export in your code behind and check the value of ddlExport to determine which routine to use.

LVL 101

Expert Comment

ID: 9868734
Is this from a machine with Crystal installed or for the client machines.

From a VB application you can limit the export options by not including the export dlls in the installation.  The viewer looks for the dlls to populate the dropdown.  Don't know if that works with c# and .Net.


Author Comment

ID: 9873040
ahhh...interesting idea. Its on the client machines, so I might check that one out.

cheers guys


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

730 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