when i try to export the report to pdf format in button click event it gives me LOGON error.I am using push method to create the report .The code to create the report is written in page load

Calling this function in button click event
Sub ExportToPDF()


Dim crExportOptions As New ExportOptions

Dim crReportDocument As New ReportDocument

Dim crDiskFileDestinationOptions As DiskFileDestinationOptions

Dim ExportPath As String

Dim ExportedFileName As String

Session("ReportName") = " CrystalReport1"

Dim rpt1 As New CrystalReport1

Session.Add("ActiveReport", rpt1)

crReportDocument = Session.Item("ActiveReport")

ExportPath = Request.PhysicalApplicationPath + "ReportOutput\"

If System.IO.Directory.Exists(ExportPath) = False Then

System.IO.Directory.CreateDirectory(Request.PhysicalApplicationPath + "ReportOutput\")

End If

crDiskFileDestinationOptions = New DiskFileDestinationOptions

crExportOptions = crReportDocument.ExportOptions

ExportedFileName = Session("ActiveReport").ToString & ".pdf"

crDiskFileDestinationOptions.DiskFileName = ExportPath & ExportedFileName

With crReportDocument.ExportOptions

.ExportDestinationType = ExportDestinationType.DiskFile

.ExportFormatType = ExportFormatType.PortableDocFormat

.DestinationOptions = crDiskFileDestinationOptions

End With


Response.Redirect("ReportOutput\" & ExportedFileName, True)

Catch exp As Exception

Response.Write("<script>alert('Error - ExportToPDF: " & Err.Description & "');</script>")


End Try

End Sub

7/5/2005 7:43:22 PM
asp.net.crystal-reports 7043 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 25

Check to make sure ASPNET (or NetworkService) has MODIFY permissions on the export directory.
If my post is your answer, please mark it as the answer. It will bring good karma.

Crystal Alliance
My Blog
Florist Blogs
7/6/2005 1:18:20 PM

Similar Artilces:

Converting Crystal Reports 9 report to Crystal Reports .NET report
I have a web page that is supposed to display a crystal report.  The report is fully written and functional in crystal 9 (non-.Net)  .  Is there a way to convert my .rpt so that I can just include it in the new web site? why you don't try to compile project with .net and include your report. then if crystal report is power tool will suggests you with conversation tool    My blog is here.Please remember to 'Mark as Answer' if this post answered your question! Wow it really was that easy!  I just added the old crystal report into my .NET proj...

How to create Report Letter with multiple pages in C# and Crystal Report.Net using VS2008
Hi experts, I’d like to have some helps from you guys. I need to create an app with C# and Crystal Report.Net using VS 2008 for a Landscape & Nursery company.  The company will send out coupon letters to some customers who purchased something from the company within past 12 months. Users will get customers’ info from database using zip code. I have a drop-down control to populate all the eligible zip codes. The following 8 data fields will be retrieved from database; FirstName, LastName, Address1, Address2, City, State, ZipCode, and PreviousPurchased. I have a pre-defined Crystal R...

Creating Reports using Crystal Reports for Visual Studio .NET
Hi i am trying to create a crystal report using C# coding but instead of creating a web application under new project i decided to choose create an asp.net website with C#. The problem is i get:- The report you requested requires further information. --------------------------------------------------------------------------------XP\SQLEXPRESS  Server name:    Database name:    User name:    Password:    All data is present except my password when i enter it, it works fine and the report works too with no problems. How do i ...

Export Crystal Report to Crystal Report format
I looked at some sample code provided by crystaldecisions, and they have the ability to export a web crystal report to a crystal report. I was assuming that this would cause the local instance of Crystal reports on the client machine to be invoked. I tried this in my project, and I get the following error: Error Encountered by Crystal Web Report Server -------------------------------------------------------------------------------- The error message returned is: Connection to Report Server Failed. It creates the file as an .rpt file in the directory it should. Do I need a dif...

Error wheb run report created by Crystal report V10
Dear All:  when i run asp.net page contain crystal report, error message appper C:\DOCUME~1\VRB9EL~1\ASPNET\LOCALS~1\Temp\temp_5e2f9fd3-9032-4a21-8594-7eda91f8f800.rpt:Operation not yet implemented. could you help me in this   B.R. Mohammed...

creating reports in Visual studio 2005 using Crystal report
hi: i was trying to create a report using crystal report in visual studio 2005 and i was unable to link my database to the report.rpt can anyone please tell me the steps how to connect my database to the crystal report or any link that may help me.     very ugently. thank you for your support...

"Logon failed error on Crystal Reports" when using oracle at backend and crystal reports
I am using VS.NET 2003 and oracle 8i database at backend. When I connect DB by ADO it connects and show tables and after making the report when I try to view it in browser there is an error of Logon failure on crystal reports. I am using VB.NET and ASP.NET. Kindly reply me soon. All in all I want to show reports in crystal reports from oracle 8i database. Haroon. can you post your code where you load the report--------------------------------------------------Sincerely,Michael ReyerosPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if...

Export Crystal report to PDF report
Hello, Does anyone knows how to export the Crystal report (.rpt) to the PDF report in c#?  Thanks  http://www.beansoftware.com/ASP.NET-Tutorials/Export-Crystal-Reports-To-PDF.aspxhttp://visualbasic.ittoolbox.com/groups/technical-functional/visualbasic-l/programmatically-exporting-from-crystal-report-to-pdf-using-vb-1480987http://www.codeproject.com/KB/vb/JatsArticle1.aspx  Don't say thanks rather mark my reply as "Answer" if it helps you ,Doing so u'll get points tooamiT jaiNC#.NET Articles Hi, You can use the following  rptDoc.ExportToHttpRespons...

Create a Report using Report Viewer
Dear .NET PROZ!! Anyone good at dealing with Report Viewer?? I knew we need to create a (report.rdlc) to implement with aspx page (report_view.aspx). Any good recommended site?? Actually i got a sample page which binding date into the report.rdlc to view customer details page by page. Then i wish to modify the report.rdlc to view product details page by page. So I had modify the data bind in my report_view.aspx but dunno how to set the value into the report.rdlc page?? Any ideas?? visit this linkhttp://dotnetjunkies.com/Article/790775A0-C493-46D8-ABE0-40CA588D33D3.dcik&...

the report is created with version of crystal reports which
 HI, I have a project which is developed by the thrid party, Its been bough by our company as a partialy developed one as our company was not satisfied with the developing company. Our company hired me to finish up the project. I am a beginer, This project also contains a crystal reports, when i click the crystal report in the project solution it says " The report is created with version later then the version you are running, some functions may not be supported" .I am using Visual studio 2005 and i see the version of crystal reports as 10.2 in the assembly reffernce.Plea...

Crystal Report give error "Load Report Failed"
Helloi in my Project I m using Crystal report,My Crystal report is Export in PDFi Have 150 fileapplication is first file export in pdf,then second file export pdf,in same say may be 30-40 file export in pdfbut after they give error load report faild, why this error will come.for run that application agian i have closed my VS and start again applicationwhy this will happen?  Nothing is really over,untill the moment stop trying for it...Amitsp(MCTS,MCP)sqlreporting.blogspot.com...

Crystal Reports error exporting to a pdf. Use to work now it gives error.
Our website generates numerous reports using crystal reports 8.5 and VS 2005. They have always worked in the past and just today they started giving an error. We tried unistalling CR and reintalling but it still didn't help. It says the error is on the line that exports the file. In SQL it shows that user for that report logging in and shows a select statement but it does not generate the report. The reports are stored in a temp folder and then displayed back to the browser. We deleted all the files in the temp folder and still no luck. We can open CR and run the report from there. We ra...

trying to create a pdf using crystal reports
I found an article on creating pdf using crystal reports. I created a report file called crystalreport1 - just basic retrieval of some data. this code is in my webpage - references the report. I am getting an error (syntax) on the crreport.exportTostream - the export to stream is undefined. what do I need to do to have that method for my report? is there a public function I need to create in the report object - what code?? thanks Dim crreport As New CrystalReport1() crreport.SetDataSource(reader) 'Change the output stream of the current for...

Are there other reporting tools other than reporting services and crystal reports
Has anyone had any experience with any reporting tools other than Reporting services and Crystal reports? If so, is there one that you would strongly recommend? Or, are these two the top choice on the market for report generation from .NET? I have heard some moaning and groaning about reporting services. Specifically in regards to the amount of time needed to design a report. Crystal reports seems kind of difficult to me, as I don't have any training with it. Basically I am looking for a reporting tool that is easy to use, and can be used from .NET....

Web resources about - when i try to export the report to pdf format in button click event it gives me LOGON error.I am using push method to create the report .The code to create the report is written in page load - asp.net.crystal-reports

Fear of a mass shooting can breed its own anxiety
Rebecca Recco, an art educator in Charleston, West Virginia, recently walked through a new school and into one of the most beautiful and light-filled ...

2015 College Football Bowl Schedule And TV Info – When, Where, And Who Is Playing
Championship Saturday is officially over, and that means Selection Sunday is upon all football fans around the country. The 2015 college football ...

Islamic State claims responsibility for Aden assassination
Los Angeles Times Islamic State claims responsibility for Aden assassination Los Angeles Times Yemenis inspect the scene of a car bomb attack ...

Report: Police check if Charlotte slayings, SC death related
CHARLOTTE, N.C. (AP) — Police continue their investigation into the shooting deaths of three people in Charlotte and, according to one media ...

Arnold Schwarzenegger: Climate Change Hard On The Brain, Global Warming Fight Needs China And U.S. To ...
According to former California governor Arnold Schwarzenegger, climate change science is very difficult for the average brain to understand. ...

Former President Jimmy Carter Announces He's Cancer-Free
Jimmy Carter has announced that his latest scan showed no signs of cancer. According to the Atlanta Journal-Constitution , the 91-year-old former ...

The Best & Worst Sketches from Ryan Gosling’s ‘Saturday Night Live’
Kicking off the final three episodes of Saturday Night Live that we’ll get in 2015, The Notebook and Drive star Ryan Gosling took the stage at ...

Donald Trump Tries To Ride Anti-Muslim Sentiment To The Presidency, Can He Be Stopped?
As the people of San Bernardino struggle with the devastating shooting that the FBI recently deemed an act of terror, politicians on both sides ...

Morgan Freeman’s Plane Crash Leaves Actor And SJ30 Jet Pilot, Jimmy Hobson, Unscathed
A private plane carrying actor Morgan Freeman and pilot Jimmy Hobson made an emergency crash landing in Tunica, Mississippi on Saturday. Fortunately, ...

Here Are 5 Rather Loud Christmas Music Alternatives To Help Brighten Your Holiday Season
Ah, its Christmas music time once again! The holidays are upon us, ladies and gentlemen, and along with the holiday season comes the much loved/loathed ...

Resources last updated: 12/6/2015 11:09:31 PM