Crystal report Export Error

L

Leonard Danao

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 btnShowPDF_Click event is triggered
private void btnShowPDF_Click(object sender, System.EventArgs e)

{

string
strFName="c:/inetpub/wwwroot/rglHG/admin/administrator/surveyReport/prtPrvwS
ctnTempQstn/prtPrvwSctnTempQstn.pdf";

ExportToDisk(strFName);

Response.Redirect("prtPrvwSctnTempQstn.pdf");

}

private void ExportToDisk (string fileName)

{

DiskFileDestinationOptions diskOpts = new

DiskFileDestinationOptions();

//set the export format

// Report.ExportOptions.ExportFormatType = ExportFormatType.RichText;

crstRptPPSctnTempQstn1.ExportOptions.ExportFormatType =
ExportFormatType.PortableDocFormat;

// Report.ExportOptions.ExportFormatType = ExportFormatType.WordForWindows ;

crstRptPPSctnTempQstn1.ExportOptions.ExportDestinationType =
ExportDestinationType.DiskFile;

//set the disk file options

diskOpts.DiskFileName = fileName;

crstRptPPSctnTempQstn1.ExportOptions.DestinationOptions = diskOpts;

crstRptPPSctnTempQstn1.Export ();

}

Error in File
C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad532a41-baf3-4cb4-b7d0-fff07
43b6782.rpt: Access to report file denied. Another program may be using it.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details:
CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: Error in
File
C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad532a41-baf3-4cb4-b7d0-fff07
43b6782.rpt: Access to report file denied. Another program may be using it.

Source Error:

Line 96: crstRptPPSctnTempQstn1.ExportOptions.DestinationOptions =
diskOpts;
Line 97:
Line 98: crstRptPPSctnTempQstn1.Export ();
Line 99: }
Line 100:

Source File:
c:\inetpub\wwwroot\rglHG\admin\administrator\surveyReport\prtPrvwSctnTempQst
n\pgPPSctnTempQstn.aspx.cs Line: 98

Stack Trace:

[LoadSaveReportException: Error in File
C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad532a41-baf3-4cb4-b7d0-fff07
43b6782.rpt:
Access to report file denied. Another program may be using it.]
.F(String  , EngineExceptionErrorID 
)
.A(Int16 , Int32 )
.@(Int16 )

CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestCont
ext reqContext)
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export()
CrystalDecisions.CrystalReports.Engine.ReportDocument.Export()

rglHG.admin.administrator.surveyReport.prtPrvwSctnTempQstn.pgPPSctnTempQstn.
ExportToDisk(String fileName) in
c:\inetpub\wwwroot\rglHG\admin\administrator\surveyReport\prtPrvwSctnTempQst
n\pgPPSctnTempQstn.aspx.cs:98

rglHG.admin.administrator.surveyReport.prtPrvwSctnTempQstn.pgPPSctnTempQstn.
btnShowPDF_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\rglHG\admin\administrator\surveyReport\prtPrvwSctnTempQst
n\pgPPSctnTempQstn.aspx.cs:79
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1277
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top