Visual Studio 2010中的Crystal报表加载问题 [英] Crystal report Loading Problem in Visual Studio 2010

查看:61
本文介绍了Visual Studio 2010中的Crystal报表加载问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用VS 2008时,我使用以下代码加载适当的报告,但在我将其转换为新的Crystal报告版本后,使用支持VS 2010到VS 2013的新报告查看器,同样的加载命令无法正常工作,给出没有错误,它只是冻结并永远挂起,直到停止调试。







我正在使用水晶报告13.0.10版本到VS 2010



01.此报告丢弃项目加载:



string selectFormula =({ItemDiscard.DiscardID} ='+ frmdis.txt_DiscardID.Text +');

crystalReportViewer1.SelectionFormula = selectFormula;

REPORTS.Rpt_Discard gdrreport = new Rpt_Discard();

crystalReportViewer1.ReportSource = gdrreport;





02. GRN项目加载:



string selectFormula =({View_RPT_GRN.GRNID} ='+ frmgrn.txt_GRN_id.Text +');

crystalReportViewer1.SelectionFormula = selectFormula;

REPORTS.Rpt_GRN grnreport = new REPORTS.Rpt_GRN();

crystalReportViewer1.ReportSource = grnreport;



这些相同的代码都可以在VS 2008中使用Crystal Reports 12

when i use VS 2008 i used following codes to load appropriate report, but after i convert it to new Crystal report version alone with new report viewer that support VS 2010 to VS 2013 , the same codding to load command not working, gives no error, it just freeze and hang forever until stop debug.



i'm using Crystal Reports 13.0.10 version to VS 2010

01. this report to discard item load:

string selectFormula = "({ItemDiscard.DiscardID}= '" + frmdis.txt_DiscardID.Text + "')";
crystalReportViewer1.SelectionFormula = selectFormula;
REPORTS.Rpt_Discard gdrreport = new Rpt_Discard();
crystalReportViewer1.ReportSource = gdrreport;


02. GRN item load :

string selectFormula = "({View_RPT_GRN.GRNID}= '" + frmgrn.txt_GRN_id.Text + "')";
crystalReportViewer1.SelectionFormula = selectFormula;
REPORTS.Rpt_GRN grnreport = new REPORTS.Rpt_GRN();
crystalReportViewer1.ReportSource = grnreport;

these same codes all are works in VS 2008 with Crystal Reports 12

推荐答案

我自己解决了这个问题;



i've solve this myself;

string vardisid = frmdis.txt_DiscardID.Text;

           string selectFormula = "({ItemDiscard.DiscardID}= '" + vardisid + "')";
           crystalReportViewer1.SelectionFormula = selectFormula;
           REPORTS.Rpt_Discard gdrreport = new Rpt_Discard();
           crystalReportViewer1.ReportSource = gdrreport;







i首先引入临时对象,其他形式文本框值:



string vardisid = frmdis.txt_DiscardID.Text;



然后这个vardisid使用报告选择公式文本:宾果,它的工作就像魅力。



string selectFormula =({ItemDiscard.DiscardID} ='+ vardisid +');



谢谢!




i introduce temporary object first to pass, other form textbox value:

string vardisid = frmdis.txt_DiscardID.Text;

then this "vardisid" use for report selection formula text: bingo, it work like charm.

string selectFormula = "({ItemDiscard.DiscardID}= '" + vardisid + "')";

thanks!


这篇关于Visual Studio 2010中的Crystal报表加载问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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