JHankinson
asked on
ASP.net Crystal Viewer Problems
Hi
i copied my locally developed project onto a remote server. I also installed crystal reports onto the server. I have a site that allows the user to choose a report from a drop down list, and opens the corresponding report in a new window using a crystal viewer. the reports dont open when being run from the server, i get the little javascript error that shows up in the bottom left corner of IE. (The project runs perfectly when being tested on the local machine it was developed on)
Line: 84
Char: 3
Error: Object Expected
Code: 0
URL: http://localhost/crystalViewer/report.aspx
It can make it to prompting for the parameters, but when i submit these parameters it doesnt do anything
heres my code
Imports System.Data
Imports CrystalDecisions
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalRe ports
Imports CrystalDecisions.CrystalRe ports.Engi ne
Imports System.Data.SqlClient
Public Class report
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg erStepThro ugh()> Private Sub InitializeComponent()
End Sub
Protected WithEvents crvReports As CrystalDecisions.Web.Cryst alReportVi ewer
Protected WithEvents Image1 As System.Web.UI.WebControls. Image
Protected WithEvents Label3 As System.Web.UI.WebControls. Label
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara tion 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
Dim query, table, table2, dept_id, temp, department, report As String, count, i As Integer
report = Session("report")
query = "select filename from reports where alias = '" & report & "'"
table = "departments"
department = Session("department")
Dim myConnection As SqlConnection = New SqlConnection
Dim connstring As String
connstring = ConfigurationSettings.AppS ettings("C onnectionS tring2")
myConnection.ConnectionStr ing = connstring
Dim myAdapter As New SqlDataAdapter(query, myConnection)
Dim myDS As New DataSet
Try
myAdapter.Fill(myDS, table)
Dim crReportDocument As New CrystalDecisions.CrystalRe ports.Engi ne.ReportD ocument
crReportDocument.Load(Requ est.MapPat h("~/Repor ts/") & RTrim(department) & "\" & RTrim(myDS.Tables(table).R ows(0).Ite m(0)))
crvReports.ReportSource = crReportDocument
crvReports.DisplayGroupTre e = False
crvReports.EnableParameter Prompt = True
Catch errorName As Exception
'lblError.Text = errorName.Message
End Try
End Sub
End Class
Thanks
i copied my locally developed project onto a remote server. I also installed crystal reports onto the server. I have a site that allows the user to choose a report from a drop down list, and opens the corresponding report in a new window using a crystal viewer. the reports dont open when being run from the server, i get the little javascript error that shows up in the bottom left corner of IE. (The project runs perfectly when being tested on the local machine it was developed on)
Line: 84
Char: 3
Error: Object Expected
Code: 0
URL: http://localhost/crystalViewer/report.aspx
It can make it to prompting for the parameters, but when i submit these parameters it doesnt do anything
heres my code
Imports System.Data
Imports CrystalDecisions
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalRe
Imports CrystalDecisions.CrystalRe
Imports System.Data.SqlClient
Public Class report
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.Debugg
End Sub
Protected WithEvents crvReports As CrystalDecisions.Web.Cryst
Protected WithEvents Image1 As System.Web.UI.WebControls.
Protected WithEvents Label3 As System.Web.UI.WebControls.
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara
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
Dim query, table, table2, dept_id, temp, department, report As String, count, i As Integer
report = Session("report")
query = "select filename from reports where alias = '" & report & "'"
table = "departments"
department = Session("department")
Dim myConnection As SqlConnection = New SqlConnection
Dim connstring As String
connstring = ConfigurationSettings.AppS
myConnection.ConnectionStr
Dim myAdapter As New SqlDataAdapter(query, myConnection)
Dim myDS As New DataSet
Try
myAdapter.Fill(myDS, table)
Dim crReportDocument As New CrystalDecisions.CrystalRe
crReportDocument.Load(Requ
crvReports.ReportSource = crReportDocument
crvReports.DisplayGroupTre
crvReports.EnableParameter
Catch errorName As Exception
'lblError.Text = errorName.Message
End Try
End Sub
End Class
Thanks
ASKER
im not sure, how do i check or set it up if its not?
it looks like a javascript error anyway, i havent coded in javascript in this project though
it looks like a javascript error anyway, i havent coded in javascript in this project though
ASKER
another point that might help:
i can view reports that dont require parameters ok, but when i open them all of the crystal viewer controls are "crossed" out.
thanks
i can view reports that dont require parameters ok, but when i open them all of the crystal viewer controls are "crossed" out.
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i cant find anything to do with activeX in any of the permissions for the working version of the project
how do i check if its ok? or could it be something else?
how do i check if its ok? or could it be something else?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok i installed that program, whats the next step from here? im a bit confused
ASKER
i was looking around in IIS and i looked under the default web site (which is stopped) (my site is not the default one, its actually running from the D:\ and not the C:\) there are folders for crystalreportviewers10. Does my website need this folder in its root dir?
If the code works and its a javascript error, do you have the alias for the activex viewer setup? Otherwise the code looks fine.
Cheers!