Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 14th, 2006, 02:07 AM
Registered User
 
Join Date: Jun 2006
Location: Kolkata, West Bengal, India.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rajasarkar
Default Exception has been thrown by the target of an invo

Hi,

I am facing an error while I am trying to export a crystal report file to pdf. The error is
"error: Exception has been thrown by the target of an invocation."
I am also enclosing the some code snippet:

Dim strExportFile as string = Server.MapPath(Request.ApplicationPath) & "\Report\" & fileName
now I am exporting to that folder "Report" which is physically in c:\inetpub\wwwroot\mywebapp\Report

I have given permission to that folder, but still receiving this error.

Please suggest.




Raja Sarkar
  #2 (permalink)  
Old June 15th, 2006, 02:00 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Judging from your code snippet and the error I don't have the foggiest idea why you are getting that error.

When I export from Crystal to PDF i do this:

        oStream = crDoc.ExportToStream(CrystalDecisions.Shared.Expor tFormatType.PortableDocFormat)
        Response.Clear()
        Response.Buffer = True
        Response.ContentType = "application/pdf"


        Response.BinaryWrite(oStream.ToArray)
        Response.End()
        oStream.Close()
        oStream = Nothing

Where crDoc = my crystal document.

"The one language all programmers understand is profanity."
  #3 (permalink)  
Old June 19th, 2006, 03:19 AM
Registered User
 
Join Date: Jun 2006
Location: Kolkata, West Bengal, India.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rajasarkar
Default

Thanks for the suggestion which is working fine.

But still I need to know the reason for this error. I am enclosing the whole code. Please help if possible.

If Len(Trim(ConfigurationSettings.AppSettings("report folder"))) > 0 then
strExportFile = trim(ConfigurationSettings.AppSettings("reportfold er")) & "\" & Session.SessionID.ToString + ".pdf"
Else
  strExportFile = Server.MapPath(Request.ApplicationPath) & "\Report\" & fileName
End If

Dim exportOpts As New ExportOptions
Dim diskOpts As New DiskFileDestinationOptions
exportOpts = rptItemPrint.ExportOptions
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
diskOpts.DiskFileName = strExportFile
exportOpts.DestinationOptions = diskOpts
Try
  rptItemPrint.Export()
Catch ex As Exception
  lblError.Text = ex.Message
  Exit Function
end Try

Raja Sarkar
 


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
error thrown by: Void AbortInternal() prv299 ASP.NET 2.0 Professional 1 June 12th, 2008 07:48 AM
exception is never thrown in body of try statement annumol Pro Java 1 February 11th, 2008 06:53 AM
Database does not update, no exception thrown hexOffender VB Databases Basics 5 November 24th, 2006 03:28 PM
Autosuggest Exception thrown jellie BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 March 14th, 2006 10:19 AM
Exception thrown Invalid_Viewstate r_ganesh76 ASP.NET 1.0 and 1.1 Professional 1 December 2nd, 2005 04:32 PM



All times are GMT -4. The time now is 03:29 PM.


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