473,545 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ExportFormatTyp e 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 1937
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.FileDialo g 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() ;
DiskFileDestina tionOptions diskOpts = new DiskFileDestina tionOptions();

exportOpts = myRPT.ExportOpt ions;

diskOpts.DiskFi leName = @"C:\...pdf" ;

exportOpts.Expo rtFormatType = ExportFormatTyp e.PortableDocFo rmat;

exportOpts.Expo rtDestinationTy pe = ExportDestinati onType.DiskFile ;

exportOpts.Dest inationOptions = 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
3036
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 to save it. I have tried creating the object that I place into the DoDragDrop() by inheriting the COM interfaces IDropSource and IDataObject...
2
6802
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 me how can i use it in my C# app? TIA
4
2348
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 to C#. The code below is called when the user doubleclicks an entry in a tree control. The first time the user doubleclicks this entry, the code...
5
3028
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
16443
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
8292
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 the Barcode fonts to be self-installed at runtime whenever a report is viewed. I tried the following steps: Public Shared Sub InstallFonts()
17
5073
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 Windows XP IIS back to ASP.NET 1.1 then I get the Configuration Error (which is understandable because I'm trying to run an ASP.NET 2 site with 1.1...
1
12205
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 file, or to the Event Viewer in windows. Nothing has worked for me so far. I am looking for help. This is the relevant code: public...
0
1190
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, they become useful. So, I need a way to view the PPT/PPS file without Office installed. The only application that can do this is MS PowerPoint...
0
7484
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7415
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7928
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7440
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5344
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.