我用水晶报表8.0设计了一个模板,在程序中与记录集绑了,但怎样在程序里传一个变量到报表的,如表头的公司名称,制表人,这些变量值怎么传到报表.如何在设计时设计这样一个可以传变里的字段或公式.怎样插入公式?Cry1.Formulas(0) = "DWMC='" & GS & "'"
在水晶报表中插入Formulas,命名为“DWMC”,在程序中引用报表成功后,在下面写上面的代码即可!_____根本找不到cry1.formulas(0)这个属性在报表里加一个Text Object(在工具样里),命名为Text
Private Sub Report_Initialize() 
    Text.SetText "你要显示的字符串"
End Sub
______我是保存为.rpt文件然后在程序中打开此模块,在设计时的代码不能保存,也就
是Report_Initialize()不能使用.首先引用参照:Crystal Reports 8.5 Activex Designer Run Time
然后再VB中写如下代码:
  Dim mocrxReport as CRAXDRT.Report
  mocrxReport.FormulaFields.GetItemByName("URISMEKYMD").Text = "'" & avMM & "'"
在水晶报表中插入Formulas,命名为“URISMEKYMD”,在程序中引用报表成功后,在下面写上面的代码即可!
_______找不到GetItemByName这个方法,我是8.0,再说怎么在设计时插入公式,就是编辑时的公式怎么写??考下,你首先要在水晶報表中(*.rpt)增加好一個參數(ParameterFields),而不是自定義公式formula fields。
注:以下是ASP变量值怎么传到水晶報表代碼:
<%
str1 = "廣州麗暉塑膠有限公司"
str2 = "訪客進出明細表"
str3 = Request("sDate") : if str3="" Then str3=date-1
str4 = Request("eDate") : if str4="" Then str4=date+1
str5 = session("npUserName")
'---------------------------------------------------------------------------------
Session("oRpt").ParameterFields(1).SetCurrentValue Cstr(str1) 
         '說明:這是你在*.rpt中第一個parameter Fields,當然你可以寫   成 .ParameterFields("parameterName")...型態一定要相同才行。
Session("oRpt").ParameterFields(2).SetCurrentValue Cstr(str2)
Session("oRpt").ParameterFields(3).SetCurrentValue CDate(str3) 
Session("oRpt").ParameterFields(4).SetCurrentValue CDate(str4)
Session("oRpt").ParameterFields(5).SetCurrentValue Cstr(str5)
'---------------------------------------------------------------------------------
%>
VB中我想是方法一樣 RptObject.ParameterFields("name").SetCurrentValue value--------找不到SetCurrentValue这个方法?????????/
哪位在8.0下使用个变量,请告诉我!!!!!!!!!!!!!!!!!!!!