水晶报表页面导航效果不佳 [英] crystal report page navigation not work well
本文介绍了水晶报表页面导航效果不佳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我单击下一步",它将转到第2页,但是当我再次单击下一步"时,它仍在第2页,永远无法通过第2页.但是我可以转到最后一页.如果单击上一个按钮,它将始终转到一页.为什么会发生?请帮助我提前解决这个问题:(
OP的更新:
if I click next, it goes to 2 page, but when I click next again, it is still in 2 page, never can pass page 2. But I can go to last page. If I click previous button, it always goes to 1 page. why it happen? plz help me to sort out this problem thnax in advance :(
UPDATE from OP:
private void ConfigureCrystalReports()
{
try
{
con.Open();
string str = "SELECT cast(A_formthreeA.EST_CODE as nvarchar(12)) as EST_CODE, cast(A_formthreeA.EMP_NO as nvarchar(12)) as EMP_NO, A_formthreeA.TOTWAGES, A_formthreeA.PFT, A_formthreeA.TOTEE, A_formthreeA.TOTER, A_formthreeA.EMP_NAME,A_formthreeA.FinYr, company_details.company_name,";
str += "company_details.comp_address1, company_details.comp_address2,company_details.pf_city_init, company_details.pf_state_init ";
str += " FROM A_formthreeA INNER JOIN company_details ON A_formthreeA.EST_CODE = company_details.pf_Code ";
TextObject txtFrom, txtTo;
SqlCommand cmd = new SqlCommand(str, con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
rpt.Load(Server.MapPath("..") + "\\Report\\form6A.rpt");
rpt.SetDatabaseLogon("sa", "Gnk1961", "SUPER/SQLEXPRESS", "Dummy");
txtFrom = (TextObject)rpt.ReportDefinition.ReportObjects["txtFrom"];
txtTo = (TextObject)rpt.ReportDefinition.ReportObjects["txtTo"];
rpt.SetDataSource(dt);
rpt.SetParameterValue("est_code", drp_compname.SelectedValue.Trim());
rpt.SetParameterValue("finyr", txt_year.Text);
txtFrom.Text = txt_year.Text;
if (txt_year.Text != "")
{
txtTo.Text = Convert.ToString(Convert.ToInt16(txt_year.Text) + 1);
}
}
catch(Exception e)
{
e.Message.ToString();
}
showReport(rpt);
con.Close();
}
推荐答案
如果您正在页面加载中调用方法ConfigureCrystalReports(),请将其移至页面init,您的分页应该可以正常工作.
如果不起作用,请给我发电子邮件.
If you are calling the method ConfigureCrystalReports() in the page load move it to the page init and your paging should work fine.
email me if it did not work.
将代码放入Page_Init中即可解决我的问题.
如果没有用,请给我发送电子邮件:marceloperuzzi@hotmail.com.我来自巴西,将尽力为您提供帮助.
Putting the code in the Page_Init resolved my problem.
If didn´t work send an email for me: marceloperuzzi@hotmail.com. I´m from Brazil and I´ll try to help you.
这篇关于水晶报表页面导航效果不佳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文