944,149 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 9818
  • VB.NET RSS
Apr 7th, 2005
0

Error While Declaring Crytal Report Object

Expand Post »
How can I integrate Crystal Report 9 along with VB.net (Version 2003). Is it possible to create CR based report in VB.Net? or I've to chose another reporting tool. Plz kindly reply me as soon as possible.
It gives error when I declear CR9 object.
Dim report as new CrystalReport
Which class or library I've to import to ceate CR object. All CR refrences has been added.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mohsin Khan is offline Offline
8 posts
since Apr 2005
Apr 7th, 2005
0

Re: Error While Declaring Crytal Report Object

Imports CrystalDecisions.CrystalReports.Engine
Imports
CrystalDecisions.Shared

via a google search since I am work with none of my references.

But I would give them a try!
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Apr 10th, 2005
0

Re: Error While Declaring Crytal Report Object

I've already Imports thses two files. But here is still an error while declaring CR Object.
Dim report as New CrystalReport(It doesn't show the CrystalReport1 class pressing space after New).
If you've any sample program in which you access crystal report in VB.Net, so please send it to me, it will be more helpfull for me and I'll be very thanxfull to you.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mohsin Khan is offline Offline
8 posts
since Apr 2005
Apr 11th, 2005
0

Re: Error While Declaring Crytal Report Object

Quote originally posted by Paladine ...
Imports CrystalDecisions.CrystalReports.Engine
Imports
CrystalDecisions.Shared

via a google search since I am work with none of my references.

But I would give them a try!
Re: Error While Declaring Crytal Report Object

--------------------------------------------------------------------------------

I've already Imports thses two files. But here is still an error while declaring CR Object.
Dim report as New CrystalReport(It doesn't show the CrystalReport1 class pressing space after New).
If you've any sample program in which you access crystal report in VB.Net, so please send it to me, it will be more helpfull for me and I'll be very thanxfull to you.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mohsin Khan is offline Offline
8 posts
since Apr 2005
Apr 12th, 2005
0

Re: Error While Declaring Crytal Report Object

Sure do. Here is the code:

Imports System.Web.Security '   |||||   Required Class for Authentication
Imports System.Data '   |||||   DB Accessing Import
Imports System.Data.OleDb   '   ||||||  Access Database Required Import!
Imports System.Configuration    '   ||||||  Required for Web.Config appSettings |||||

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Imports CrystalDecisions.ReportSource

Public Class _1997Sales
	Inherits System.Web.UI.Page
	'   |||||   Database Connection Object  |||||
	Dim MyConn As OleDbConnection = New OleDbConnection(ConfigurationSettings.AppSettings("strConn"))


#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 CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer

	'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
		'If Not Page.IsPostBack Then
		CreateReport()
		'End If
	End Sub

	Private Sub CreateReport()
		Dim objReport As New Sales1997
		Dim myResults As CrystalDecisions.CrystalReports.Engine.Table
		Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
		For Each myResults In objReport.Database.Tables
			myLogin = myResults.LogOnInfo
			myLogin.ConnectionInfo.UserID = "admin"
			myResults.ApplyLogOnInfo(myLogin)
		Next
		CrystalReportViewer1.ReportSource = objReport

	End Sub


End Class

Hope this helps...
Team Colleague
Reputation Points: 211
Solved Threads: 27
Master Poster
Paladine is offline Offline
793 posts
since Feb 2003
Apr 12th, 2005
0

Re: Error While Declaring Crytal Report Object

i have added a report to my project named Sales1997.rpt
But Sales1997 is underlined when i write this line giving message that
" Type 'Sales1997' is not defined. "
PS: it does not show class Sales1997 when i write new in following line, i have to write it myself.

Dim objReport As New Sales1997
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Mohsin Khan is offline Offline
8 posts
since Apr 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: To display an icon in a datagrid
Next Thread in VB.NET Forum Timeline: Creating new controls through code.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC