Solved

Limiting the Export types in a C# Crystal Reports Viewer

Posted on 2003-12-03
7
759 Views
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....

cheers

Adam
0
Comment
Question by:adders99
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

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

hth
matt
0
 

Author Comment

by:adders99
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.
0
 
LVL 7

Expert Comment

by:mnye
ID: 9867635
can you post some code, im not too sure what you are using.
thanks
matt
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:adders99
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 ();
0
 
LVL 7

Accepted Solution

by:
mnye earned 50 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>
</asp:dropdownlist>

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.


hth
matt
0
 
LVL 100

Expert Comment

by:mlmcc
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.

mlmcc
0
 

Author Comment

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

cheers guys

Adam
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now