公式字段中水晶报表的子报表中的错误 [英] Error in sub report of crystal report in Formula Field

查看:228
本文介绍了公式字段中水晶报表的子报表中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在使用编码在Crystal Report中创建子报告.由于所有事情都是事实,我无法理解的Formula字段出现一个错误.所以请帮我...

公式字段:

Hello,

I am making a sub report in Crystal Report using coding.One error come in Formula field that i can not understand because of all the things are perfact. so please help me...

Formula Field.:

if {Command.opbal}<0 then "Dr." Else "Cr."


像这样的错误:This field name is not known. Error in File C:\Users\user\AppData\Local\Temp\Debtors_Total_Outstanding_Report {A682B99D-A38B-43F3-BB05-63C258E9E0E2}.rpt: Error in formula . ''if {Command.opbal}<0 then 0 else {Command.opbal}'' This field name is not known.

单击报告时.

我使用像:
这样的命令按钮


error like : This field name is not known. Error in File C:\Users\user\AppData\Local\Temp\Debtors_Total_Outstanding_Report {A682B99D-A38B-43F3-BB05-63C258E9E0E2}.rpt: Error in formula . ''if {Command.opbal}<0 then 0 else {Command.opbal}'' This field name is not known.

when click on Report.

i use command button like :

select *  from {?database}.dbo.AC_LEDGER



我绑定的主要报告如下:



the main report i bind like :

                string str = "select crbal*-1 as crbal, glname, glcode,contprsn, refby, glphone1, glcity, glphone2, email, crlimit, restorddueamt  from glmast WHERE drgroup=''A3402'' and crbal<>0 and glcode in(" + strSelection + ")";
                SqlDataAdapter ad = new SqlDataAdapter(str, con2);
                DataSet ds = new DataSet();

                ad.Fill(ds);

                path = Server.MapPath("Debtors_Total_Outstanding_Report.Rpt");
                cr = new ReportDocument();
                cr.Load(path);
                
                cr.SetDataSource(ds.Tables[0]);
           
                
                cr.SetParameterValue(0,ds.Tables[0].Rows[0][1].ToString());
                cr.SetParameterValue(1,company_name);
                cr.SetParameterValue(2, database_name);


               
                CrystalReportViewer1.ReportSource = cr;
                CrystalReportViewer1.DataBind();
so, please help me.


Thanks and Regards,
Mitesh

推荐答案



请检查ur数据集中是否存在Command.opbal字段(如果存在),然后检查参数是否存在


please check Command.opbal field exist or not in ur dataset if exist then check the argument if it''s have or not


这篇关于公式字段中水晶报表的子报表中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆