Solved

Limiting the Export types in a C# Crystal Reports Viewer

Posted on 2003-12-03
7
756 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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 …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 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

21 Experts available now in Live!

Get 1:1 Help Now