我在vb6.0中的项目我想显示带有2个访问表的水晶报告4。我想要第一个字段ID和第二个exam_Date。两个字段均可在两个表中使用。我想从我的代码中传递选择公式。下面是代码 -
Dim Y As Integer, m As Integer, d As Integer
Y = Year(DTPicker1.Value)
m = Month(DTPicker1.Value)
d = Day(DTPicker1.Value)
选择公式:
CrystalReport1.SelectionFormula = "{Master.ID} = '" + Text1.Text + "' and {Master.Exam_Date} =Date(" & Y & "," & m & "," & d & ") and {Path_PatientData.Exam_Date}=Date(" & Y & "," & m & "," & d & ")"
CrystalReport1.PrintReport
但不要显示报告。
答案 0 :(得分:0)
我只有CR作为独立工具的经验,但通过查看您的代码我想建议一些更改。
CrystalReport1.SelectionFormula = "{Master.ID} = '" + Text1.Text + "' and {Master.Exam_Date} >=Date(" & Y & "," & m & "," & d & ") and {Master.Exam_Date} <=Date(" & Y & "," & m & "," & d & ")
使用,如果它有用的其他丢弃。