473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C++ .NET/windows form viewer help

Hi, all...

I posted this in the Crystal Decisions user forums with no solution,
so here goes:

I have created a managed c++ dll that contains a crystal reports
viewer constructed with the windows form viewer and the native crystal
libraries included in vs.net. I want my users to be able to export a
displayed report to a file, and as luck would have it the default
crystal reports viewer has an export button that opens a 'save as'
type dialog. However, I want to limit my users to exporting to pdf
type files only.

I have tried various things like setting the ExportFormatType on the
report document, but the default 'save as' dialog still allows the
user to export to Word, Excel, etc. I suspect that I am close to
having this problem solved, but I'm missing something. Can anyone
help???

Thanks,
Dean
Nov 16 '05 #1
1 1930
Hello Dean,

I reviewed your post carefully, and now I'd like to share the following
information with you:

1. I recommend you create a "Save File" dialog of you own (by using
System.Windows.Forms.FileDialog class) to limit the use to select pdf file
type, and then export the Crystal Report to a pdf file with the following
code snippet:

//------------------code snippet--------------------------
ExportOptions exportOpts = new ExportOptions();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();

exportOpts = myRPT.ExportOptions;

diskOpts.DiskFileName = @"C:\...pdf";

exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;

exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;

exportOpts.DestinationOptions = diskOpts;

myRPT.Export();
//----------------------end of-------------------------------

2. According to the Crystal Decision at
http://support.crystaldecisions.com/...fault.asp_sele
ctlist, it states that you get two Crystal incidents with the purchase of
Visual Studio .NET. I suggest that you can contact Crystal Technical
Support to check whether there are any methods that you can use to limit
file types in its "Save As" dialog (say, by modifying registry values).

If the file type values are hard-coded in Crystal Report, you may need to
call FindWindow() to get the Window Handle to its "Save As" dialog, and
then modify the dialog manually. This should be the last resort.

Please feel free to let me know if you have any problems or concerns.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! ¨C www.microsoft.com/security
This posting is provided ¡°as is¡± with no warranties and confers no rights.
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave | last post by:
I need to add the ability to drag from a Windows Form and drop into a non dotNet application. For example, having a generated image in my app that I wish to drag out into explorer as a friendly way...
2
by: ~dr-sci-fi | last post by:
hi all, i want to use "Windows Picture Viewer and Fax Viewer" in my c# app to manipulate images, picture viewer is found as a DLL (shimgvw.dll) in System32 folder of WinXP. can some one tell...
4
by: Dean Poling | last post by:
Hello, all... I am attempting to write a managed c++ dll that will open a crystal report in the windows form viewer. For various reasons, I need to be able to write this in C++ w/MFC as opposed...
5
by: Jason Huang | last post by:
Hi, In my ASPNet C# Windows Form, how do I open a Crystal Report without using a Crystal Report Viewer? And in this situation, how do I pass parameter value? Thanks for help. Jason
5
by: Dean Slindee | last post by:
I have looked everywhere I can think of for the .exe name of the Windows Picture and Fax Viewer. Anybody know what it's named? Thanks, Dean Slindee
10
by: Sylvain Audet | last post by:
Hello! We have a Windows application that is using Crystal Reports reports containing Barcode fonts. Those reports are called through reflection into a Crystal Report Viewer and we need to have...
17
by: Jon B | last post by:
Hi All! I have a ASP.NET 2.0 site that works on the Windows 2000 Server. However, when I tried to view this site on my local Windows XP machine, I get "Server Unavailable". If I switch the...
1
by: zman77 | last post by:
Hi. I have a windows service that I wrote in C#. After I successfully compile it, I install it using InstallUtil, then run it with the net start command. I am trying to either log some stuff to a...
0
by: dotnets8n | last post by:
Good day! I have such problem. I must play the PowerPoint presentation in my application. Several ActiveX components (f.e. EDraw Office Viewer) can do that but if the MS Office is not installed,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.