使用VB 6.0调用Crystal报表时没有错误,但不显示报表 [英] No Error But not Display Report When Call a Crystal Report using VB 6.0
问题描述
你好,请帮助我???????????????
我正在检查mark.markid是此之后的文本字段,它不会显示报告.
当我通过带有id和日期范围参数的recordselection公式时,我在Crystal报表中生成报表并通过vb6.0调用,它没有错误,但在报表中不显示任何数据,当我通过单个参数时,我正在使用Crystal Report 9.0显示带有记录的报告,但是当我同时传递两个参数时,在报告中不显示任何记录.
代码:--
Hello Please Help Me ???????????????
i am check the mark.markid is a text field after this it will be not show report.
i am making a report in crystal report and call by vb6.0 when i am pass recordselection formula with id and date range parameter it give no error but display no data in report i am using crystal report 9.0 when i am pass single single paratmer it display report with record but when i am pass both parameter together is display no record in report.
Code: - -
Set CrApp = New CRAXDRT.Application
Set CrRep = CrApp.OpenReport(App.Path & "\recpt1.rpt")
'CrRep.Database.SetDataSource (App.Path & "\dak.mdb")
'CrRep.Database = App.Path & "\dak.mdb"
For Each crtable In CrRep.Database.Tables
crtable.Location = App.Path & "\dak.mdb"
Next
If Check8.Value = 1 And Check9.Value = 1 Then
Dim c1
c1 = Mid(Combo3.Text, 1, 2)
CrRep.EnableParameterPrompting = False
str = "{MarkTo.Mark_id} = ''" & c1 & "'' And( {Dak.MarkDt} >= #" & Text9.Text & "# And {Dak.MarkDt} <= #" & Text10.Text & "#)"
CrRep.RecordSelectionFormula = str
''MsgBox (CrRep.RecordSelectionFormula)
CrRep.DiscardSavedData
Form1.CRViewer91.ReportSource = CrRep
'' Form1.CRViewer91.SearchByFormula (str)
Form1.CRViewer91.ViewReport
Form1.Show
Exit Sub
End If
它不给出任何错误,但不显示任何记录
请解决
请再次帮助我
It not give any error but not display any record
Please solve it
Please Help me again
推荐答案
写
wrote
str = "{MarkTo.Mark_id} = ''" & c1 & "'' And( {Dak.MarkDt} >= #" & Text9.Text & "# And {Dak.MarkDt} <= #" & Text10.Text & "#)"
请确认Mark_id字段的数据类型为文本或数字.如果是数字类型,则应避免在参数&中使用单引号.然后在关键字And之后留空格.
然后在报告文件夹路径中找到文件 event.log .您可以在该文件中查看错误详细信息.让我知道.
please confirm the Mark_id field data type is text or number. If it is number type you should avoid the single quotes in parameter & then give space after the keyword And.
Then find the file event.log in the reports folder path. You can see the error details in that file. let me know.
这篇关于使用VB 6.0调用Crystal报表时没有错误,但不显示报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!