Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CrystalDecisions.Web could not be loaded

Status
Not open for further replies.

MColeman

Programmer
Sep 23, 2002
242
I'm trying to use Visual Studio.Net's built-in Crystal feature with ASP.Net.

Is there something that needs to be loaded on the server?

My error:
File or assembly name Crystal Decisions.Web or one of its dependencies not found. Crystal Decisions.Web could not be
loaded. LOG: Publisher policy file is not found.

My code in the Web Form:
(I copied this from a white paper from Crystal Decisions
titled Crystal Reports for Visual Studio.Net)
Imports CrystalDecisions.Web
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Shared

Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

End Sub

'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Generate_Report()
Dim crReportDocument As ReportDocument
Dim crExportOptions As ExportOptions
Dim crDiskFileDestinationOptions As DiskFileDestinationOptions
Dim strFname As String

crReportDocument = New ReportDocument

crReportDocument.Load(&quot;M:\Invoice Log.rpt&quot;)

strFname = &quot;M:\&quot; & Session.SessionID.ToString & &quot;.pdf&quot;
crDiskFileDestinationOptions = New DiskFileDestinationOptions

crDiskFileDestinationOptions.DiskFileName = strFname
crExportOptions = crReportDocument.ExportOptions

With crExportOptions
.DestinationOptions = crDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = ExportFormatType.PortableDocFormat
End With

crReportDocument.Export()

Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = &quot;application/pdf&quot;
Response.WriteFile(strFname)
Response.Flush()
Response.Close()

End Sub

End Class




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top