Crystal报告公式问题 [英] Problem with Crystal reports Formula
问题描述
Hello eveyrone
我正在使用sqlserver后端在visual studio 2012中开展一个项目。
我正在创建一个报告,它可以正常工作,从中选择所有数据数据库表,但是当我想根据发票选择记录时,它不会在公式中产生错误。
错误是这里需要一个数字......>
我使用的代码是
< pre lang =c#>
Pending_order_Report por = new Pending_order_Report();
rptsales rpt = new rptsales();
suntechagribusinessDataSet ds1 = new suntechagribusinessDataSet();
salesTableAdapter.Fill(ds1.sales);
sale_detailsTableAdapter.Fill(ds1.sale_details);
rpt.SetDataSource(ds1);
por.crystalReportViewer1.ReportSource = rpt;
por.crystalReportViewer1.SelectionFormula ={sales.invoice_no} ='+
listView1.SelectedItems [0] .SubItems [1] .Text +';
por.Show();
Pending_Order_report是我放置Crystal报表查看器的表单,发票编号是数据库中销售表中的一列。
上面我放在Listview的上下文菜单上。公式线选择列表视图子项[1],它是发票编号,但它会生成一个错误,这里需要一个数字..
任何帮助都会得到赞赏..
谢谢提前
此示例修复
如何从水晶报告中删除此处需要的数字错误? [ ^ ]
Hello eveyrone
I am working on a project in visual studio 2012 with sqlserver backend.
I am creating a Report which is working fine with selecting all the data from the database table, but when i want to select records based on invoice no it generates an error in the Formula.
the error is "A NUMBER IS REQUIRED HERE......"
The code I am using is
<pre lang="c#"> Pending_order_Report por = new Pending_order_Report(); rptsales rpt = new rptsales(); suntechagribusinessDataSet ds1 = new suntechagribusinessDataSet(); salesTableAdapter.Fill(ds1.sales); sale_detailsTableAdapter.Fill(ds1.sale_details); rpt.SetDataSource(ds1); por.crystalReportViewer1.ReportSource = rpt; por.crystalReportViewer1.SelectionFormula = "{sales.invoice_no}='" + listView1.SelectedItems[0].SubItems[1].Text + "'"; por.Show();
Pending_Order_report is the form on which i place the Crystal report viewer, invoice number is a column in sale table in the database.
The Above I place on a context menu on the Listview. the Formula Line select listview subitems[1] which is Invoice Number but it generates an error that A NUMBER IS REQUIRED HERE..
Any help will be Appreciated..
Thanks in Advance
Sample fix on this
How to remove " A number Required here" error from crystal report?[^]
这篇关于Crystal报告公式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!