473,320 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Export crystal to pdf in asp.net page

I am generating a Crystal report in an asp.net application
and keep getting the following error message when I try to
export the report to pdf format.

"CrystalDecisions.CrystalReports.Engine.LogOnExcep tion:
Logon failed"

I have crawled everywhere on the web and have found a lot
written about this problem but all info relates to binding
your report to sql server. In my case I am binding to an
xml file.

It is driving me insane !!!
If I just display the crystal report in a viewer on a
webpage it works fine. Its only when I try to export it
that I have the problem. I have already given the ASP.net
user write privs to the folder.
Heres my code :
<code>
Dim crReportDocument As ReportDocument
Dim crExportOptions As exportoptions
Dim crDiskFileDestinationOptions As diskfiledestinationoptions
Dim Fname As String
crReportDocument = New ReportDocument
crReportDocument.Load("C:\inetpub\wwwroot\TTPresen tation\reports\timesheetReport1.rpt")
Fname = "C:\inetpub\wwwroot\TTPresentation\reports\" &
"test" & ".pdf"
crDiskFileDestinationOptions = New
DiskFileDestinationOptions
crDiskFileDestinationOptions.DiskFileName = Fname
crExportOptions = crReportDocument.ExportOptions
With crExportOptions
..DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType =
ExportDestinationType.DiskFile .ExportFormatType =
ExportFormatType.PortableDocFormat
End With
crReportDocument.Export() Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(Fname)
Response.Flush()
Response.Close()
System.IO.File.Delete(Fname)
</code>

I can honestly say that this problem is the most annoying I
have ever had.

Help me or put me out of my misery.
Nov 19 '05 #1
0 1204

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Colin Graham | last post by:
Error when attempting to export Crystal Report as PDF document asp.net. I get the following error. Error in File...
6
by: Robin Cushman | last post by:
Hi all, I need some help -- I'm working with an A2K database, using DAO, and am trying to read records into a Crystal Report and then export it to a folder on our network as an Excel...
1
by: John | last post by:
Hi. Sir: Does anyboday know how to export subreport data using the export button in crystal report tool bar? We have a main report including a on-demand report. When we click the on-demand...
0
by: Vadim Vulfov | last post by:
My task was to create Crystal Report on ASP.NET page to display different date depending on to textboxes From Date and To Date. I created stored procedure in SQL with two parameters from_date and...
0
by: Leonard Danao | last post by:
Anyone have any ideas as to why this is happenning. There are no other versions of Crystal installed aside from the one that came with vs2003 enterprise. the error happens when the...
0
by: Henry | last post by:
I have written an ASP/VB.Net application via VS 2003 (Crystal V9) that uses MS Access 2000 as its database. I can export reports that have no linked sub reports for printing. However, I'm unable...
4
by: Jay | last post by:
Is there a FREE way to export a datagrid (or entire page) to a PDF file? I've heard a lot about Crystal, Reporting Services, etc, however, I need a FREE method to accomplish this using notepad......
3
by: Brad | last post by:
In a Vista/IIS7 asp.net app, a coded crystal report export is crashing IIS7....but it works just fine in visual studio's cassini web server. And if I create a web form and use the crystal...
0
by: netlady | last post by:
Hi, can someone help me or share his or her idea why I am always getting a blank web page whenever I click the export button or the navigational next toolbar of the crystalreportviewer in .net ? I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.