如何在水晶报表设计器上设置条件? [英] How to set condition to the field on crystal report designer?

查看:96
本文介绍了如何在水晶报表设计器上设置条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vb6中创建了水晶报告8 ....



我有cmbloc(组合框)显示位置列表,我做了代码显示



如果cmbloc为空或已选择值,则水晶报告上的位置字段显示为所有位置....... ...



但是发生了错误:给定行所需的对象......



如果删除了特定代码,则位置字段默认显示第一条记录的位置.... plz help



I hv created crystal report 8 in vb6....

I''m having cmbloc(combo box) shows list of locations,I did code to show that

if cmbloc is empty or has selected value then location field on crystal report sh''d display text as "all locations"..........

But error occurs : object required at the given line......

If particular code removed then location field shows by default location of first record.... plz help

Private Sub CmdRpt6_Click()
 SQL = "SELECT NOTE.*,LOCATION.LOC_NAME From NOTE,LOCATION "
 SQL = SQL + " Where NOTE.LOC_ID=LOCATION.LOC_ID"
 Set RS = CON.Execute(SQL)

 Report6.Database.LogOnServer "pdsORA7.dll", "soft", "", "aus", "aus123"
 Report6.DiscardSavedData

 If CmbLoc = Empty Or CmbLoc.Text = "<ALL LOCATIONS>" Then
   Report6.Field9.Value = "ALL LOCATIONS" // ERROR LINE : OBJECT REQUIRED
 End If
 Report6.SQLQueryString = SQL
 Report6.ReadRecords
 CRViewer1.ReportSource = Report6
 CRViewer1.ViewReport
End Sub

推荐答案

您好


您可以使用Crystal Report中的参数文件并执行此操作请查看以下链接:



http://www.vb6.us/tutorials/using-crystal-reports-vb6-tutorial [ ^ ]



http://stackoverflow.com/questions/8034308/how-to-pass-参数field-to-command-query-in-crystal-reports-8-5 [ ^ ]



你有另一个解决方案来获取更多信息检查它:

http://www.vbforums.com/showthread.php?431746-Crystal-Report -In-VB [ ^ ]



最好的问候。
Hi
You can use parameter filed from Crystal Report and for do it please check the follow of links:

http://www.vb6.us/tutorials/using-crystal-reports-vb6-tutorial[^]

http://stackoverflow.com/questions/8034308/how-to-pass-parameter-field-to-command-query-in-crystal-reports-8-5[^]

you have another solution to get more information about it check it :
http://www.vbforums.com/showthread.php?431746-Crystal-Report-In-VB[^]

Best Regards.


这篇关于如何在水晶报表设计器上设置条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆