[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


ASP.net Crystal Viewer Problems

Posted on 2005-05-03
Medium Priority
Last Modified: 2010-05-18

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.
    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
            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


Question by:JHankinson
  • 5
  • 2

Expert Comment

ID: 13923216
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.


Author Comment

ID: 13923229
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

Author Comment

ID: 13923317
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.

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.


Accepted Solution

cyberdevil67 earned 1200 total points
ID: 13923341
No but the activeX object for the viewer obviously does.

With the site that works, check all the vitual directories of IIS and make sure that the permissions for the activeX is correct as well.

Author Comment

ID: 13924342
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?

Assisted Solution

hendridm earned 300 total points
ID: 13929615
cyber is right.  You can try installing the "Crystal Reports for Visual Studio .NET Server Install", which I believe creates the virtual directory for you.

Author Comment

ID: 13931921
ok i installed that program, whats the next step from here? im a bit confused

Author Comment

ID: 13941823
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?

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Integration Management Part 2
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month19 days, 12 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question