我用水晶报表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下使用个变量,请告诉我!!!!!!!!!!!!!!!!!!!!
在水晶报表中插入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下使用个变量,请告诉我!!!!!!!!!!!!!!!!!!!!
解决方案 »
- 让大家久等了,今天终于能发布VB版本的迷你PhotoShop了,暂时取名为AnyView,这次发布的为1.0的网友测试版,请大家有空帮我测试下BUG。
- 用VB 操作EXCEL找不到microsoft excel x.0 object libray是怎么一回事,望指教
- 哪位能给推荐一个支持VB的UML建模工具啊,要求体积要小,实用!
- 各位大虾,在用InstallShield做安装程序时,安装过程中的背景图是怎样实现的???
- 当鼠标移到LISTBOX上时,如何在属性中ToolTipText显示该行信息?
- 请教高手,查询表中有参数,如何在VB中使用该查询表?
- 请教怎么用MSCOMM32控键对LED进行操作!!!
- 如何安装SQL SERVER数据库,请指教?
- listview.finditem问题
- 打包成功后,安装出错!在线等待!!!:)
- ado控件连接sql server问题
- 谁能救救我啊?????
cryReport.ParameterFields.GetItemByName("Printer").AddCurrentValue g_UserName
其中Printer為報表中的參數名稱,而g_UserName為所要傳過的的值。
Dim l_objX As CRAXDDRT.TextObject
Set l_objX = cryReport.Sections(1)ReportObjects("text1)