Error While Declaring Crytal Report Object

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2005
Posts: 8
Reputation: Mohsin Khan is an unknown quantity at this point 
Solved Threads: 0
Mohsin Khan Mohsin Khan is offline Offline
Newbie Poster

Error While Declaring Crytal Report Object

 
0
  #1
Apr 7th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Error While Declaring Crytal Report Object

 
0
  #2
Apr 7th, 2005
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!
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 8
Reputation: Mohsin Khan is an unknown quantity at this point 
Solved Threads: 0
Mohsin Khan Mohsin Khan is offline Offline
Newbie Poster

Re: Error While Declaring Crytal Report Object

 
0
  #3
Apr 10th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 8
Reputation: Mohsin Khan is an unknown quantity at this point 
Solved Threads: 0
Mohsin Khan Mohsin Khan is offline Offline
Newbie Poster

Re: Error While Declaring Crytal Report Object

 
0
  #4
Apr 11th, 2005
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2003
Posts: 793
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Solved Threads: 26
Team Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Error While Declaring Crytal Report Object

 
0
  #5
Apr 12th, 2005
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...
Assistant Manager, Pharmacy Informatics
Wordpress Learning Blog
Updated : ASP.Net Login Code
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 8
Reputation: Mohsin Khan is an unknown quantity at this point 
Solved Threads: 0
Mohsin Khan Mohsin Khan is offline Offline
Newbie Poster

Re: Error While Declaring Crytal Report Object

 
0
  #6
Apr 12th, 2005
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 7891 | Replies: 5
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC