Reports to PDF URGENT!!!



Hi

I've installed my asp.net on a win2003,
I 've give permissions to c:\windows\temp to IIS_WPG, so I can see reports
on the crystal web-viewer and it works just fine.
My problem shows up when I try to expor a report to PDF or excel or
whatever, I got this error

========================
Error en archivo
C:\WINDOWS\TEMP\temp_e64e745d-cff0-4c57-96c2-4ce0c58084ff.rpt: Denegado el
acceso al archivo del informe. Es posible que esté abierto en otro programa.
========================
I guess I can translate ,something like this:
File's error C:\WINDOWS\TEMP\temp_e64e745d-cff0-4c57-96c2-4ce0c58084ff.rpt:
Access denied It may be used by another program

I do the exportation to c:\inetput\wwwroot\mySite\Exports, this folder have
the same permissions than c:\inetput\wwwroot\mySite

I don't think that there is a problem on the code, because it works fine on
my development's computer, any way, the exportation to pdf is made for a
class that have a method name and part of the code of that method is
showed below

Dim crExportOptions As CrystalDecisions.shared.ExportOptions
Dim crDiskFileDestinationOptions As
CrystalDecisions.shared.DiskFileDestinationOptions

Dim sFname As String
Dim sDownUrl As String
sDownUrl = System.Web.HttpContext.Current.Request.Url.Scheme &
System.Web.HttpContext.Current.Request.Url.SchemeDelimiter &
System.Web.HttpContext.Current.Request.Url.Host &
System.Web.HttpContext.Current.Request.ApplicationPath

''Pass the populated dataset to the report


' Primero debemos crear una nueva instancia de la clase
DiskFileDestinationOptions
' y definir las variables crExportOptions del la clase ExportOptions
del crReportDocument
crDiskFileDestinationOptions = New
CrystalDecisions.Shared.DiskFileDestinationOptions
crExportOptions = cr.ExportOptions

sFname =
System.Web.HttpContext.Current.Request.PhysicalApplicationPath & "\Exports\"
& System.Web.HttpContext.Current.Session.SessionID & ".pdf"
crDiskFileDestinationOptions.DiskFileName = sFname

'set the required report ExportOptions properties
With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType =
CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportFormatType =
CrystalDecisions.Shared.ExportFormatType.PortableDocFormat
End With
' Export the report
cr.Export()
'Writing the pdf on the client's IE

System.Web.HttpContext.Current.Response.ClearContent()

System.Web.HttpContext.Current.Response.ClearHeaders()
System.Web.HttpContext.Current.Response.ContentType =
"application/pdf"
System.Web.HttpContext.Current.Response.WriteFile(sFname)
System.Web.HttpContext.Current.Response.Flush()
System.Web.HttpContext.Current.Response.Close()

'Borra el archivo pdf
System.IO.File.Delete(sFname)


Thanks in advance!!
Sergio


.



Relevant Pages

  • Re: 3rd party Reporting tools
    ... > I've been writing scripts to get lists and reports of users, groups, ... >does most of what I "think" my manager would want but I'm wondering if ... can also determine which users have permissions to a shared resource. ...
    (microsoft.public.windows.server.active_directory)
  • Re: configuring CR.net after IIS reinstall?
    ... double-check can you make the destination folder C:\Windows\Temp? ... no permissions required for accessing it and its a good way to make sure its ... > I'm exporting reports to PDF. ... > ASPNET account for anonymous access to the web site. ...
    (microsoft.public.vb.crystal)
  • Re: Why does ZA forget my settings in Programs list?
    ... ZA asks for permissions for some programs but does not list their ... their virus dictionary, so it might be covered in the very latest virus ... the current reports are not conclusive. ... Almost all electrons used in the creation of this message were recycled. ...
    (comp.security.firewalls)
  • Re: Repair Permissions same issues?
    ... > It reports some issues and then reports Permissions Repaired. ... "We are using special permissions on. ... poorly-worded message. ... Art, photography, shareware, polyamory, literature, kink: ...
    (comp.sys.mac.system)
  • Re: Reports to PDF URGENT!!!
    ... Did you give permissions to the Network Service account also? ... programa. ... > my development's computer, any way, the exportation to pdf is made for a ...
    (microsoft.public.vb.crystal)

Quantcast