简体   繁体   English

在1个数据报表vb6中创建2列(男性和女性排序)

[英]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.

相关问题 mysql中加两列区分男女计数 - Adding two columns in mysql distinguish the count of male and female 使用sql,codeigniter的8年级男女总计 - Total of Male and Female in Grade 8 using sql, codeigniter 投票的唯一男女人数 - Unique male and female count who posted vote &lt;5&gt; 5的诊断量以及男女mysql查询的量 - amount of diagnosis for <5 >5 and amount of male and female mysql query MySQL 程序,基于识别号的女性或男性 - MySQL procedure, female or male based on identification number 查询给定数据集中的男女比例#MySQL - query for male to female ratio in the given dataset #MySQL BIT(1)与ENUM(MySQL中的&#39;unknown&#39;,&#39;male&#39;,&#39;female&#39;) - BIT(1) vs ENUM('unknown', 'male', 'female') in MySQL 如果在选择标记html php中选择了男性/女性,如何仅输出男性/女性学生 - how to output only male/female students if male/female is selected in select tag html php sql 表使用存储在两个不同表中的数据和一个表中的性别和另一个表中的购买来查找前 5 名男性和前 5 名女性购买 - sql tables to find top 5 male and top 5 female purchase using data stored in two different tables and gender in one table and purchse in another table MySQL查询选择ENUM(&#39;M&#39;,&#39;F&#39;)为&#39;男&#39;或&#39;女&#39; - MySQL query to select ENUM('M', 'F') as 'Male' or 'Female'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM