Wrox Programmer Forums
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2004, 11:57 AM
Authorized User
 
Join Date: Oct 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web-Based Printing

I'm using WROX's Professional Crystal Reports for Visual Studio .NET 2nd Edition to try to create my first CR.NET application for a major project at work. I've got most things figured out, but have printing and exporting to take care of at this time.

On page 182 there is a description of how to print the report by pushing it into an adobe acrobat plug-in.

After following the instructions to the letter on two separate files, I'm getting the same error message. Can anyone help me overcome this spot? Am I right in thinking that the program using the file at the time of this error is my own program? HELP!!

:(

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\TLENIN~1\ASPNET\LOCALS~1\Temp\temp_156 75fa6-0611-46d1-8cee-760821443e02.rpt: Access to report file denied. Another program may be using it.

Source Error:


Line 55: End With
Line 56:
Line 57: myReport.Export()
Line 58:
Line 59: Response.ClearContent()


Source File: c:\inetpub\wwwroot\web_viewer_print\WebForm1.aspx. vb Line: 57

Stack Trace:


[LoadSaveReportException: Error in File C:\DOCUME~1\TLENIN~1\ASPNET\LOCALS~1\Temp\temp_156 75fa6-0611-46d1-8cee-760821443e02.rpt:
Access to report file denied. Another program may be using it.]
   .I(String , EngineExceptionErrorID )
   .D(Int16 , Int32 )
   .C(Int16 )
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export(ExportRequestContext reqContext)
   CrystalDecisions.CrystalReports.Engine.FormatEngin e.Export()
   CrystalDecisions.CrystalReports.Engine.ReportDocum ent.Export()
   web_viewer_print.WebForm1.PDF_Button_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\web_viewer_print\WebForm1.aspx. vb:57
   System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(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()




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

 
Old October 15th, 2004, 05:13 PM
Authorized User
 
Join Date: Oct 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Finally got this one figured out. Instead of placing the code for loading the report in a form load event, I moved it into the Page_init event. I did end up having to copy my code for logging into data tables over again into the export section, but finally got it to work properly. Another key here was help from WROX tech Ian Hays:

Have you set the folder containing the web app permission for ASP.NET? In order to do this go to the folder that contains your web app and right click on it and go to properties. Click on the security tab and click add. Then click locations and select the location that you want and click okay. In the text box labeled "Enter the object names to select" type in "ASPNET" and click okay.

After these changes, I got past my hurdle. If you're struggling with this one, I recommend you do Ian's fix first, then if there are other hurdles, consider doing what I did.

 
Old November 14th, 2004, 10:48 PM
Authorized User
 
Join Date: Nov 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!






Similar Threads
Thread Thread Starter Forum Replies Last Post
web based scanning jayanthg20 ASP.NET 1.0 and 1.1 Basics 1 March 10th, 2009 12:05 PM
Console Based Printing to Printer jaybinod BOOK: Professional C#, 2nd and 3rd Editions 0 December 26th, 2005 07:06 AM
Web based database jake Classic ASP Basics 3 February 5th, 2005 11:05 AM
Web Based DB reyboy Pro VB Databases 0 May 6th, 2004 12:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.