水晶报表问题求助,高手指点
CREATE PROCEDURE cktzlfxb @date1 int
AS
select distinct a.fdate,b.fdcstockid,b.fscstockid,b.fitemid,c.fname,d.fnumber,e.fendbal,g.fauxpropid_fname
into #cktbl from icstockbill a
left join icstockbillentry b on a.finterid=b.finterid
left join ICStockBillEntry39467Z38513453 g on g.fitemid=b.fitemid and g.fauxpropid=b.fauxpropid
left join icbal e on e.fitemid=b.fitemid and e.fauxpropid=b.fauxpropid
left join t_stock c on c.fitemid=b.fscstockid
left join t_ICItemCore d on d.fitemid=b.fitemid
where left((ltrim(fbillno)),4)='sout' and e.fyear=year(getdate()) and e.fperiod=month(getdate())-1 order by b.fitemid
select AA.* into #cktbl1 from #cktbl AA where not exists(select 1 from #cktbl where fname=AA.fname and fnumber=AA.fnumber and fdate > AA.fdate) order by aa.fnumber
select distinct bb.fdate,datediff(day,bb.fdate,getdate()) as date1,c.fnumber,c.fname,c.fmodel,e.fname as unit,floor(a.fqty) as fqty,b.fname as stockname/*,d.fendbal*/,
bb.fendbal,((a.fqty)*(bb.fendbal)) as total,a.fitemid,bb.fauxpropid_fname from icinventory a left join t_stock b on a.fstockid=b.fitemid
left join t_icitem c on a.fitemid=c.fitemid
left join t_measureunit e on e.fmeasureunitid=c.funitid
left join #cktbl1 bb on bb.fname=b.fname and bb.fnumber=c.fnumber
--left join #cktbl3 cc on cc.fitemid=c.fitemid
where datediff(day,bb.fdate,getdate())>=@date1 order by c.fnumber
drop table #cktbl
drop table #cktbl1
VB中代码
Dim Cryapp As New CRAXDRT.Application
Dim Conn As New ADODB.Connection
Dim Rs As New ADODB.Recordset
Dim report As New CRAXDRT.report
Set report = Cryapp.OpenReport(App.Path + "\rpt2.rpt")
Conn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=AIS20071224103448;Data Source=WAPSERVER"
Conn.Open
Rs.CursorLocation = adUseClient
Rs.Open "exec cktzlfxb '" & Val(Text1.Text) & "'", Conn, adOpenKeyset, adLockReadOnly
report.Database.SetDataSource Rs
report.DiscardSavedData
Debug.Print Text1.Text
' report.EnableParameterPrompting = False
Screen.MousePointer = vbHourglass
Form1.CRViewer91.ReportSource = report
Screen.MousePointer = vbDefault
Form1.Show 1
以上分别为存储过程和VB代码,执行老实出现输入参数值对话框,我若加上report.EnableParameterPrompting = False这句,不出现对话框,但是参数值没传过去,请高手指点,怎么处理,谢谢
[[it] 本帖最后由 sky_yang_sky 于 2008-5-5 12:13 编辑 [/it]]