Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Crystal Reports
Message
 
To
15/11/2002 16:34:39
Jim Rieck
Quicken Loans/Rock Financial/Title Sourc
Livonia, Michigan, United States
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00723448
Message ID:
00723455
Views:
8
Hi Jim,

Based on your error, change the line of code where you Dim crDatabase to the following:
Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database
When you include "()", you are defining the variable to be an array of that type.

>All,
>
> I have a webform with a Crystal report viewer on it. All I want to do is bind the viewer to a report in my project. I found an article that explains how to get around the security issue for binding the report viewer, but the code for the solution is not working. I have included the code below.
>
> I am getting a S:\projectdotnet\Reports.aspx.vb(81): Value of type 'CrystalDecisions.CrystalReports.Engine.Database' cannot be converted to '1-dimensional array of CrystalDecisions.CrystalReports.Engine.Database'.
> and a
> S:\projectdotnet\Reports.aspx.vb(83): 'tables' is not a member of 'System.Array'.
>error on the lines in bold below.
>
>Please help
>
>Dim crReportDocument As New CustReport()
> Dim crTableLogOnInfo As New TableLogOnInfo()
> Dim crConnectionInfo As New ConnectionInfo()
> Dim crDatabase As CrystalDecisions.CrystalReports.Engine.Database()
> Dim crTables As CrystalDecisions.CrystalReports.Engine.Tables
> Dim crtable As CrystalDecisions.CrystalReports.Engine.Table
>....
> 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
> Try
> crConnectionInfo.ServerName = "Buzzlightyear"
> crConnectionInfo.DatabaseName = "project"
> crConnectionInfo.UserID = "sa"
> crConnectionInfo.Password = ""
>
> crDatabase = crReportDocument.Database
> crTables = crDatabase.tables

>
> For Each crtable In crTables
> crTableLogOnInfo = crtable.LogOnInfo
> crTableLogOnInfo.ConnectionInfo = crConnectionInfo
> crtable.ApplyLogOnInfo(crTableLogOnInfo)
> Next
>
>
> Me.crvReport.ReportSource = crReportDocument
> If Not (IsPostBack) Then
> Me.SqlconReports.Open()
> getReports()
> Me.SqlconReports.Close()
> End If
>
> Catch exp As Exception
> setMessage(exp.Message)
> Finally
> Me.SqlconReports().Close()
> End Try
>
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Reply
Map
View

Click here to load this message in the networking platform