\r\n\r\n
Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET Database and Reporting > Crystal Report - .Net Problem


\r\n \r\n
 
 
Thread Tools Display Modes

\r\n\r\n\r\n
Hello, I am in need of help big time.
\r\n
\r\nI have am using Visual Studio 2010 and Crystal Report 10.
\r\n
\r\nThe problem that I am incounting is that I am unable to retreive data from more than one table from a MySql database. I have been stuck on this for too long and need to hjump the hurdle.
\r\n
\r\nI am using a MySql connection string, a dataset and a crystal report which is based on the dataset.
\r\n
\r\nThe main error that I am having is, the browser opens and a form appears saying "The report you requetsed requires further information" With the Server name: DataSetPropertiesDetials, while the User name and Password fields are then enabled.
\r\n
\r\nI am guessing I am missing something in my code.
\r\n
\r\nWhen I retreive data from one table the report is fine, but when I try to use more than one table it throws the error.
\r\n
\r\nMy Code is below and also attached:
\r\n
\r\nImports System.Data.SqlClient
\r\nImports System.Configuration
\r\nImports MySql.Data.MySqlClient
\r\nImports CrystalDecisions.ReportSource
\r\nImports CrystalDecisions.Web
\r\nImports CrystalDecisions.CrystalReports.Engine
\r\nImports CrystalDecisions.Shared
\r\nPublic Class _Default
\r\n Inherits System.Web.UI.Page
\r\n Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
\r\n Dim con As MySqlConnection
\r\n
\r\n Dim rpt As New CrystalReport3()
\r\n Dim myReport As New ReportDocument
\r\n Dim myData As New DataSet
\r\n Dim cmd As New MySqlCommand
\r\n
\r\n Dim cmdUser, cmdProperty, cmdBranch As New MySqlCommand
\r\n Dim daBranch, daProperty, daUser As New MySqlDataAdapter
\r\n
\r\n con = New MySqlConnection()
\r\n
\r\n \'Connection String
\r\n con.ConnectionString = "Server=*****;Database=*****;UID=*****;Password=*****"
\r\n
\r\n Try
\r\n con.Open()
\r\n
\r\n cmdBranch.CommandText = "SELECT branch FROM tblbranch"
\r\n cmdBranch.Connection = con
\r\n daBranch.SelectCommand = cmdBranch
\r\n daBranch.Fill(myData)
\r\n
\r\n cmdProperty.CommandText = "SELECT ref, keys_held, key_no, keys_out, no_name, address_line1, address_line2,key_label FROM tblproperty"
\r\n cmdProperty.Connection = con
\r\n daProperty.SelectCommand = cmdProperty
\r\n daProperty.Fill(myData)
\r\n
\r\n cmdUser.CommandText = "SELECT known_name FROM tbluser"
\r\n cmdUser.Connection = con
\r\n daUser.SelectCommand = cmdUser
\r\n daUser.Fill(myData)
\r\n
\r\n myReport.Load("REPORT LOCATION")
\r\n myReport.SetDataSource(myData)
\r\n myReport.Database.Tables(0).SetDataSource(myData.Tables(0))
\r\n CrystalReportViewer1.ReportSource = myReport \'
\r\n Catch myerror As MySqlException
\r\n MsgBox(myerror.Message)
\r\n End Try
\r\n End Sub
\r\nEnd Class
\r\n \r\n\r\n
\r\n \r\n \r\n
\r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n
\r\n Attached Files\r\n \r\n \r\n \r\n \r\n\r\n
File Type: vbDefault.aspx.vb (1.9 KB, 1 views)
\r\n
\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n\r\n \r\n\r\n \r\n\r\n
\r\n \r\n \r\n \r\n \r\n Reply With Quote\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n \r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n'; pd[1386125] = '\r\n\r\n \r\n\r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n\r\n\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n \r\n
\r\n
\r\n  \r\n #2  \r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n
\r\n \r\n Old\r\n \r\n 09-03-2011, 10:42 PM\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
Roger_Wgnr\'s Avatar\r\n\r\n
\r\n \r\n Roger_Wgnr\r\n Roger_Wgnr is offline\r\n\r\n\r\n
Prev Previous Post   Next Post Next
  #1  
Old 09-02-2011, 09:30 AM
zaco1988 zaco1988 is offline
Newcomer
 
Join Date: Sep 2011
Posts: 3
Default Crystal Report - .Net Problem


Hello, I am in need of help big time.

I have am using Visual Studio 2010 and Crystal Report 10.

The problem that I am incounting is that I am unable to retreive data from more than one table from a MySql database. I have been stuck on this for too long and need to hjump the hurdle.

I am using a MySql connection string, a dataset and a crystal report which is based on the dataset.

The main error that I am having is, the browser opens and a form appears saying "The report you requetsed requires further information" With the Server name: DataSetPropertiesDetials, while the User name and Password fields are then enabled.

I am guessing I am missing something in my code.

When I retreive data from one table the report is fine, but when I try to use more than one table it throws the error.

My Code is below and also attached:

Imports System.Data.SqlClient
Imports System.Configuration
Imports MySql.Data.MySqlClient
Imports CrystalDecisions.ReportSource
Imports CrystalDecisions.Web
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim con As MySqlConnection

Dim rpt As New CrystalReport3()
Dim myReport As New ReportDocument
Dim myData As New DataSet
Dim cmd As New MySqlCommand

Dim cmdUser, cmdProperty, cmdBranch As New MySqlCommand
Dim daBranch, daProperty, daUser As New MySqlDataAdapter

con = New MySqlConnection()

'Connection String
con.ConnectionString = "Server=*****;Database=*****;UID=*****;Password=*****"

Try
con.Open()

cmdBranch.CommandText = "SELECT branch FROM tblbranch"
cmdBranch.Connection = con
daBranch.SelectCommand = cmdBranch
daBranch.Fill(myData)

cmdProperty.CommandText = "SELECT ref, keys_held, key_no, keys_out, no_name, address_line1, address_line2,key_label FROM tblproperty"
cmdProperty.Connection = con
daProperty.SelectCommand = cmdProperty
daProperty.Fill(myData)

cmdUser.CommandText = "SELECT known_name FROM tbluser"
cmdUser.Connection = con
daUser.SelectCommand = cmdUser
daUser.Fill(myData)

myReport.Load("REPORT LOCATION")
myReport.SetDataSource(myData)
myReport.Database.Tables(0).SetDataSource(myData.Tables(0))
CrystalReportViewer1.ReportSource = myReport '
Catch myerror As MySqlException
MsgBox(myerror.Message)
End Try
End Sub
End Class
Attached Files
File Type: vb Default.aspx.vb (1.9 KB, 1 views)
Reply With Quote
 

Tags
.net report, cr vb, crystal report, reports, visual basic


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->