[英]Creating 2 columns in 1 data report vb6 (male and female sorting)
I'm having a problem in vb6 (datareport). 我在vb6(数据报告)中遇到问题。 I was able to display a report from the following code: 我能够通过以下代码显示报告:
Dim rs As ADODB.Recordset
Dim strsql As String
strsql = "select * from student where year='" & txtYear.Text & "' AND section='" & txtSection.Text & "'"
Set rs = cn.Execute(strsql)
If Not rs.EOF Then
Set DataReport2.DataSource = rs
DataReport2.WindowState = 2
DataReport2.Show vbModal
Else
MsgBox "Doesnt exist"
End If
But my problem is, in my database I have a column "sex" (male or female). 但是我的问题是,在我的数据库中,我有一列“性别”(男性或女性)。 What I want is to display all male students to the left page of the data report, and the female students to the right. 我要在数据报告的左页显示所有男学生,在右数显示女学生。 Sorry for my english. 对不起我的英语不好。 Thanks in advance. 提前致谢。
Note: Im using vb6, wampserver(mysql) as database. 注意:我使用vb6,wampserver(mysql)作为数据库。 I want it on the same page. 我要在同一页面上。
DataReports do not support columns in this manner. DataReports不以这种方式支持列。 I suggest you consider something else, perhaps the DHTMLEdit control or RichTextBox control where you can "roll your own" reporting with preview. 我建议您考虑其他因素,也许是DHTMLEdit控件或RichTextBox控件,您可以在其中使用预览“滚动自己的”报告。
Alternatively you might be able to perform a transformation query of some sort to produce a Recordset with the rows arrayed as you want them. 或者,您也许可以执行某种转换查询,以产生一个Recordset,其中记录的行可以按需要排列。 Then you could still use a DataReport. 然后您仍然可以使用DataReport。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.