VB6+;crystal Report 9空值
我的工作项目需要水晶报告9和vb6 我创建了一个crystal报告页面,选择了我想要的所有列 然后在表单中,用户通过此代码选择数据VB6+;crystal Report 9空值,vb6,crystal-reports,report,Vb6,Crystal Reports,Report,我的工作项目需要水晶报告9和vb6 我创建了一个crystal报告页面,选择了我想要的所有列 然后在表单中,用户通过此代码选择数据 If frmRepTabaee1.Check1.Value = 1 And frmRepTabaee1.chbTamin.Value = 1 Then If frmRepTabaee1.txtTabai.Text = 1 Then sqlStr = "select pcode,name,lastname,TTaminDarman1,y,mon
If frmRepTabaee1.Check1.Value = 1 And frmRepTabaee1.chbTamin.Value = 1 Then
If frmRepTabaee1.txtTabai.Text = 1 Then
sqlStr = "select pcode,name,lastname,TTaminDarman1,y,mon from tbllisthogh" & frmRepTabaee1.txty & "" & frmRepTabaee1.txtmon & " where typepar= 'ÍÞæÞ' and idvoras = '0' order by convert(int,pcode )"
ElseIf frmRepTabaee1.txtTabai.Text = 2 Then
sqlStr = "select pcode,name,lastname,TTaminDarman2,y,mon from tbllisthogh" & frmRepTabaee1.txty & "" & frmRepTabaee1.txtmon & " where typepar= 'ÍÞæÞ' and idvoras = '0' order by convert(int,pcode )"
ElseIf frmRepTabaee1.txtTabai.Text = 3 Then
sqlStr = "select pcode,name,lastname,TTaminDarman3,y,mon from tbllisthogh" & frmRepTabaee1.txty & "" & frmRepTabaee1.txtmon & " where typepar= 'ÍÞæÞ' and idvoras = '0' order by convert(int,pcode )"
ElseIf frmRepTabaee1.txtTabai.Text = 4 Then
sqlStr = "select pcode,name,lastname,TTaminDarman4,y,mon from tbllisthogh" & frmRepTabaee1.txty & "" & frmRepTabaee1.txtmon & " where typepar= 'ÍÞæÞ' and idvoras = '0' order by convert(int,pcode )"
ElseIf frmRepTabaee1.txtTabai.Text = 5 Then
sqlStr = "select pcode,name,lastname,TTaminDarman5,y,mon from tbllisthogh" & frmRepTabaee1.txty & "" & frmRepTabaee1.txtmon & " where typepar= 'ÍÞæÞ' and idvoras = '0' order by convert(int,pcode )"
ElseIf frmRepTabaee1.txtTabai.Text = 6 Then
sqlStr = "select pcode,name,lastname,TTaminDarman6,y,mon from tbllisthogh" & frmRepTabaee1.txty & "" & frmRepTabaee1.txtmon & " where typepar= 'ÍÞæÞ' and idvoras = '0' order by convert(int,pcode )"
End If
End If
Screen.MousePointer=vbHourglass
rs.Open sqlStr, cn
Report.Database.SetDataSource rs, , 1
'--------------------------------
'''''''''''''''''''''''''''''''''
'''''''''''''''''''''
'-------------------
CRViewer91.Refresh
'-------------------
CRViewer91.ReportSource = Report
CRViewer91.ViewReport
Screen.MousePointer = vbDefault
'End If
End Sub
问题:
当sql查询使用不同的列进行选择,这导致crystal report 9中出现空值问题时,如何设置空值的默认值
在vb6和crystal report 9中
谢谢我没有版本9,但是在Crystal Reports报告选项的常规设置中,您应该有复选框,用于将数据库空值转换为默认值和将其他空值转换为默认值。检查这些选项可以消除您的错误。中没有类似的选项CR9@madman版本8和2008都有,所以它也必须存在于版本9中。尝试查看文件-报告选项。