Link to home
Start Free TrialLog in
Avatar of JHankinson
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.CrystalReports
Imports CrystalDecisions.CrystalReports.Engine
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.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents crvReports As CrystalDecisions.Web.CrystalReportViewer
    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 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
        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.AppSettings("ConnectionString2")
        myConnection.ConnectionString = connstring
        Dim myAdapter As New SqlDataAdapter(query, myConnection)
        Dim myDS As New DataSet
        Try
            myAdapter.Fill(myDS, table)
       
        Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
        crReportDocument.Load(Request.MapPath("~/Reports/") & RTrim(department) & "\" & RTrim(myDS.Tables(table).Rows(0).Item(0)))
        crvReports.ReportSource = crReportDocument
             

            crvReports.DisplayGroupTree = False

            crvReports.EnableParameterPrompt = True
        Catch errorName As Exception
            'lblError.Text = errorName.Message
        End Try
    End Sub
End Class

Thanks


Avatar of cyberdevil67
cyberdevil67

Hi JHankinson,

  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!
Avatar of JHankinson

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
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
ASKER CERTIFIED SOLUTION
Avatar of cyberdevil67
cyberdevil67

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok i installed that program, whats the next step from here? im a bit confused
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?