HelP~~ Data Report got problem when read data from multiple database table...
Can Data Report read data from diffrent table...???
because when at final set the Report.DataSource can only set to one record set... if I wan read from two table I ahve two record set......
Data Report can read data into label?? like Report.Label1.Caption= xxx ...??
Code:
Dim sqlcom As String
Dim rscom As New ADODB.Recordset
sqlcom = "SELECT * FROM Company"
rscom.Open sqlcom, Conn
With Report.Sections("Section1").Controls
.Item("Text7").DataField = rscom("CompanyName").Name
.Item("Text8").DataField = rscom("Address").Name
End With
Dim rsPrint As New ADODB.Recordset
Dim strPrint As String
strPrint = "SELECT * FROM QuoDetail"
rsPrint.Open strPrint, Conn
With Report.Sections("Section1").Controls
.Item("Text1").DataField = rsPrint("ItemNo").Name
.Item("Text2").DataField = rsPrint("ItemDescription").Name
.Item("Text3").DataField = rsPrint("Quantity").Name
End With
Set Report.DataSource = rsPrint
Load Report
Re: HelP~~ Data Report got problem when read data from multiple database table...
The DataReport can only be bound to one Recordset but the recordset itself can of course contain data from multiple tables.
Quote:
Data Report can read data into label?? like Report.Label1.Caption= xxx ...??
You can set the Caption of a Label using
DataReport1.Sections(Section Name).Controls(Control Name).Caption
for example
DataReport1.Sections("Section1").Controls("Label1").Caption = "Hello"
Re: HelP~~ Data Report got problem when read data from multiple database table...
The DataReport can only be bound to one Recordset but the recordset itself can of course contain data from multiple tables.
You mean can use can apply as like that???
Code:
rsPrint.Open sqlcom, Conn
rsPrint.Open sqlyen, Conn
rsPrint.Open sqlcn, Conn
Re: HelP~~ Data Report got problem when read data from multiple database table...
Quote:
You mean can use can apply as like that???
??? I have no idea what you mean.
You would use SQL to create a single recordset from multiple tables. Something like
Select Customers.CompanyName, Orders.OrderId, Orders.OrderDate
From Customers Inner Join Orders On Orders.CustomerId = Customers.CustomerId
Re: HelP~~ Data Report got problem when read data from multiple database table...
School must be in session again. There are a lot of Data Environment questions about and regular programmers would never use such a thing...
Re: HelP~~ Data Report got problem when read data from multiple database table...