查看: 1542|回复: 7
|
Crystal Reports 8.5 + vb6
[复制链接]
|
|
Crystal Reports 8.5 + vb6
我要在我的 form 弄两个DTPicker,一个是 date from 另一个是date until 和一个 OK button
我要select date from and date until and click ok button display data within the dates
请问怎样写这个 coding??
below is my code
Dim miReport As CRAXDRT.Report
Dim miCRapp As New CRAXDRT.Application
Set miReport = miCRapp.OpenReport("D:\FYP\Back End\Stock.rpt")
With CRViewer1
.ReportSource = miReport
.ViewReport
While .IsBusy
DoEvents
Wend
.Zoom "85"
.Visible = True
.Refresh
End With
Set miCRapp = Nothing
Set miReport = Nothing
谢谢帮忙 !!!
[ Last edited by dickson on 22-3-2005 at 08:12 PM ] |
|
|
|
|
|
|
|
发表于 23-3-2005 10:47 AM
|
显示全部楼层
所有的动作都有Crystal Reports自己来处理, 我的作法只是 pass SQL statement 吧了!!
我用的是 version 7.x 的 Crystal Reports..不知可不可以帮到你
VB6.0 code 里的写发
================
rpt.Connect = " " ---> connection path DSN
rpt.SQLQuery = " select * from xxx where datefrom = xxx and dateNow = xxx " ---> pass SQL statement to Crystal report
rpt.ReportFileName = "c:\user.rpt " ---> depend report path
rpt.Action = 1 |
|
|
|
|
|
|
|
发表于 23-3-2005 01:16 PM
|
显示全部楼层
教你一个很简单的方法:
在你的 rptXXX.frm 里写这coding :
step 1 :
Private Sub Form_Load()
Dim d As Integer
Report.FormulaFields.Item(1).Text = Chr(34) & frmChoose.DT1 & Chr(34)
Report.FormulaFields.Item(2).Text = Chr(34) & frmChoose.DT2 & Chr(34)
......... (你自己的SQL statement)
....
....
CRViewer1.Zoom (100)
Screen.MousePointer = vbHourglass
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
end sub
Step 2 :
到你的Crystal report 里面的"formula fields" create 2 个 formula, let say:
formula Name formula
datefrm stringvar g;
dateto stringvar f;
Step 3 :
现在再到Crystal report 里面的"select expert" then click "new" button , then select "(ur table name).date" ,then click "show formula" , then 把以下formula coding 丢进去,
Let ur table Name = Student
{student.Date}>=cdate({@datefrm}) and
{student.Date}<=cdate({@dateto})
这样做后,你就会得到你要的了, 希望你看得明白!!
|
|
|
|
|
|
|
|
发表于 12-4-2005 02:25 PM
|
显示全部楼层
其实我不是很喜欢用CRVIEWER...
有限制的东西我都不喜欢...
建议用CRYSTAL REPORT CONTROL...
又容易,又没限制... |
|
|
|
|
|
|
|
发表于 23-5-2005 12:10 AM
|
显示全部楼层
crystal report 問題﹖
小第有一個問題想向各位高手請教﹕
如果我有一個REPORT LIST 如下﹕
Item code Name Qty
-------------------------------------
A-1001 Hard Disk 5
B-2002 Monitor 10
C-3003 Ram 15
小弟想在ITEM CODE 旁邊加一組 [No] Of Record
like:
No Item code Name Qty
-------------------------------------
1 A-1001 Hard Disk 5
2 B-2002 Monitor 10
3 C-3003 Ram 15
請問我該怎樣SET﹖
谢谢!
[ Last edited by kiwiuno on 23-5-2005 at 12:17 AM ] |
|
|
|
|
|
|
|
发表于 26-5-2005 03:41 PM
|
显示全部楼层
kiwiuno 于 23-5-2005 12:10 AM 说 :
小第有一個問題想向各位高手請教﹕
如果我有一個REPORT LIST 如下﹕
Item code Name Qty
-------------------------------------
A-1001 Hard Disk 5
B-2002 ...
去special field 里面选 "record Number" 就行了!!! |
|
|
|
|
|
|
|
发表于 4-8-2005 12:58 AM
|
显示全部楼层
请问如果我想把资料从MYSQL PASS去MS ACCESS,然后,再把资料PASS去CRYSTAL REPORT,那怎么做? |
|
|
|
|
|
|
|
发表于 9-8-2005 01:45 AM
|
显示全部楼层
没有人可以帮到我吗?
首先我是create了table,然后set说
m_table!supp_no = rs!supp_no
.
.
.
Error:Item cannot be found corresponding to the......
明白吗? |
|
|
|
|
|
|
| |
本周最热论坛帖子
|