vb水晶报表问题 10
问题是:sql中的max(a.a_1310),max(a.a_1550)在报表中不能显示,sql语句单独执行,能有max(a.a_1310),max(a.a_1550)唯...
问题是:sql中的max(a.a_1310), max(a.a_1550)在报表中不能显示,sql语句单独执行 ,能有max(a.a_1310), max(a.a_1550)唯一返回值,不知问题在哪,分不多,烦请帮忙看看。
还有在语句中已用max函数 那在设计报表的时候还需要取最大值吗?
在command9代码如下:
Private Sub Command9_Click()
Form1.Show
End Sub
在form1的代码如下:
Private Sub Form_Load()
Dim CRYAT As New CRAXDRT.Application
Dim CRY As CRAXDRT.Report
Dim Strcnn As String
Dim cnn1 As New ADODB.Connection
Dim adoRS As New ADODB.Recordset
cnn1.ConnectionString = "Provider=sqloledb;Data Source=10.90.2.71;Initial Catalog=cabcis;User Id=sa;Password=sssa;"
cnn1.Open
adoRS.CursorLocation = adUseClient
adoRS.Open "SELECT max(a.a_1310), max(a.a_1550), b.contract_no , b.len_PRINT, b.cable_type , b.segment_no, b.print_no, b.drum_no,b.groupindexkl FROM cable_fiber as a INNER JOIN final_cab_main as b ON a.sheath_no = b.sheath_no WHERE b.sheath_no= '" & Trim(cable_tube.Text2.Text) & "' group by b.contract_no , b.len_PRINT, b.cable_type , b.segment_no, b.print_no, b.drum_no,b.groupindexkl", cnn1, adOpenDynamic, adLockOptimistic
Set CRYAT = New CRAXDRT.Application
Set CRY = CRYAT.OpenReport(App.Path & "\report1.rpt ")
CRY.Database.Tables(1).SetDataSource adoRS
CRY.Database.Tables(2).SetDataSource adoRS
CRY.DiscardSavedData
CRViewer91.ReportSource = CRY
CRViewer91.Refresh
CRViewer91.ViewReport
End Sub 展开
还有在语句中已用max函数 那在设计报表的时候还需要取最大值吗?
在command9代码如下:
Private Sub Command9_Click()
Form1.Show
End Sub
在form1的代码如下:
Private Sub Form_Load()
Dim CRYAT As New CRAXDRT.Application
Dim CRY As CRAXDRT.Report
Dim Strcnn As String
Dim cnn1 As New ADODB.Connection
Dim adoRS As New ADODB.Recordset
cnn1.ConnectionString = "Provider=sqloledb;Data Source=10.90.2.71;Initial Catalog=cabcis;User Id=sa;Password=sssa;"
cnn1.Open
adoRS.CursorLocation = adUseClient
adoRS.Open "SELECT max(a.a_1310), max(a.a_1550), b.contract_no , b.len_PRINT, b.cable_type , b.segment_no, b.print_no, b.drum_no,b.groupindexkl FROM cable_fiber as a INNER JOIN final_cab_main as b ON a.sheath_no = b.sheath_no WHERE b.sheath_no= '" & Trim(cable_tube.Text2.Text) & "' group by b.contract_no , b.len_PRINT, b.cable_type , b.segment_no, b.print_no, b.drum_no,b.groupindexkl", cnn1, adOpenDynamic, adLockOptimistic
Set CRYAT = New CRAXDRT.Application
Set CRY = CRYAT.OpenReport(App.Path & "\report1.rpt ")
CRY.Database.Tables(1).SetDataSource adoRS
CRY.Database.Tables(2).SetDataSource adoRS
CRY.DiscardSavedData
CRViewer91.ReportSource = CRY
CRViewer91.Refresh
CRViewer91.ViewReport
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询