divined
May 31st, 2005, 03:20 AM
Hello everybody
I have a report which needs to display a list of employees. This can and has easily been done. The thing is that I want to display a Report Header. The title of this header will come from another table containing a single record-single field. I could create an Inner Join query but then I would be repeating this field for every employee. This is the code I`m currently using :
Dim oApp As New CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim strPathToReport, strSQL As String
Dim connbio_tech As ADODB.Connection
Dim oRs As ADODB.Recordset
' ADO Connection to the database
Set connbio_tech = New ADODB.Connection
strConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER = localhost; DATABASE = xxx; UID = xxx; PWD = xxx;"
connbio_tech.ConnectionString = strConnection
connbio_tech.Open ' Άνοιγμα σύνδεσης
' Open Recordset
strSQL = "Select * From Texnikos Order By Kwd_Texnikou"
Set oRs = New ADODB.Recordset
Set oRs = connbio_tech.Execute(strSQL)
CrystalReport1.Database.SetDataSource oRs, 3, 1
' Display in Viewer control.
CrystalActiveXReportViewer1.ReportSource = CrystalReport1
CrystalActiveXReportViewer1.ViewReport
where CrystalReport1 is a viewer control. Could I create a second query for the header title and pass it only to the field in the report header as required?
thx, in advance
George Papadopoulos
I have a report which needs to display a list of employees. This can and has easily been done. The thing is that I want to display a Report Header. The title of this header will come from another table containing a single record-single field. I could create an Inner Join query but then I would be repeating this field for every employee. This is the code I`m currently using :
Dim oApp As New CRAXDRT.Application
Dim oReport As CRAXDRT.Report
Dim strPathToReport, strSQL As String
Dim connbio_tech As ADODB.Connection
Dim oRs As ADODB.Recordset
' ADO Connection to the database
Set connbio_tech = New ADODB.Connection
strConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER = localhost; DATABASE = xxx; UID = xxx; PWD = xxx;"
connbio_tech.ConnectionString = strConnection
connbio_tech.Open ' Άνοιγμα σύνδεσης
' Open Recordset
strSQL = "Select * From Texnikos Order By Kwd_Texnikou"
Set oRs = New ADODB.Recordset
Set oRs = connbio_tech.Execute(strSQL)
CrystalReport1.Database.SetDataSource oRs, 3, 1
' Display in Viewer control.
CrystalActiveXReportViewer1.ReportSource = CrystalReport1
CrystalActiveXReportViewer1.ViewReport
where CrystalReport1 is a viewer control. Could I create a second query for the header title and pass it only to the field in the report header as required?
thx, in advance
George Papadopoulos