By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,281 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Crystal report Export Error

P: n/a
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.ExportFormatT ype =
ExportFormatType.PortableDocFormat;

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

crstRptPPSctnTempQstn1.ExportOptions.ExportDestina tionType =
ExportDestinationType.DiskFile;

//set the disk file options

diskOpts.DiskFileName = fileName;

crstRptPPSctnTempQstn1.ExportOptions.DestinationOp tions = diskOpts;

crstRptPPSctnTempQstn1.Export ();

}

Error in File
C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad5 32a41-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.LoadSaveRep ortException: Error in
File
C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad5 32a41-baf3-4cb4-b7d0-fff07
43b6782.rpt: Access to report file denied. Another program may be using it.

Source Error:

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

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

Stack Trace:

[LoadSaveReportException: Error in File
C:\DOCUME~1\ITSDEV~1\ASPNET\LOCALS~1\Temp\temp_ad5 32a41-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.FormatEngin e.Export(ExportRequestCont
ext reqContext)
CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export()
CrystalDecisions.CrystalReports.Engine.ReportDocum ent.Export()

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

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

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain() +1277

Nov 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.