p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
I forgot my password Register Now
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2009, 08:10 AM
Authorized User
Points: 301, Level: 6
Points: 301, Level: 6 Points: 301, Level: 6 Points: 301, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 09:16 AM
How to set default format for crystal report as RT shikha09 BOOK: Professional Crystal Reports for VS.NET 0 May 29th, 2007 02:23 AM
Using SaveFileDialog to save SQL DB file jscammell VB Databases Basics 4 April 14th, 2007 11: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 06:50 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc