Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2009, 07:10 AM
Authorized User
 
Join Date: Nov 2007
Location: , , Ireland.
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Hughesie78
Default set SaveFileDialog to save crystal report

I have a button a form which opens a save file dialog and saves images.
I now want to add functionality to the button so that it saves a crystal report that im viewing in a crystalreportviewer which is also on my form.
How can I do this, ive tried accessing the report source property of the viewer but I cannot set the save as I have done with the .gif etc.
Here is my code, anyone got a solution
Private Sub Button2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
' Displays a SaveFileDialog so the user can save the Image
' assigned to Button2.
Dim saveFileDialog1 As New SaveFileDialog
saveFileDialog1.Filter = "JPeg Image|*.jpg|Bitmap Image|*.bmp|Gif Image|*.gif|All files (*.*)|*.*"""
saveFileDialog1.Title = "Save an Image File"
saveFileDialog1.ShowDialog()
Dim rptname As String
rptname = Me.CrystalReportViewer1.ReportSource
' If the file name is not an empty string open it for saving.
If saveFileDialog1.FileName <> "" Then
' Saves the Image via a FileStream created by the OpenFile method.
Dim fs As System.IO.FileStream = CType _
(saveFileDialog1.OpenFile(), System.IO.FileStream)
' Saves the Image in the appropriate ImageFormat based upon the
' file type selected in the dialog box.
' NOTE that the FilterIndex property is one-based.
Select Case saveFileDialog1.FilterIndex
Case 1
Me.button2.Image.Save(fs, _
System.Drawing.Imaging.ImageFormat.Jpeg)
Case 2
Me.button2.Image.Save(fs, _
System.Drawing.Imaging.ImageFormat.Bmp)
Case 3
Me.Button2.Image.Save(fs, _
System.Drawing.Imaging.ImageFormat.Gif)
Case 4
' I want to save the report being viewed in CrystalReportViewer1 as excel.

End Select
fs.Close()
End If
End Sub
__________________
Thank You
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
set Oracle procedure as source for a crystal report Hughesie78 Crystal Reports 0 May 20th, 2009 08:16 AM
How to set default format for crystal report as RT shikha09 BOOK: Professional Crystal Reports for VS.NET 0 May 29th, 2007 01:23 AM
Using SaveFileDialog to save SQL DB file jscammell VB Databases Basics 4 April 14th, 2007 10:02 AM
How to set password to exported Crystal Report jdaulagar Beginning VB 6 0 January 10th, 2007 04:19 PM
Save crystal report as image [URGENT] usamaalam Crystal Reports 1 February 18th, 2005 07:03 PM



All times are GMT -4. The time now is 10:06 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.