动态更改Crystal Reports标题 [英] Change Crystal Reports Heading Dynamically

查看:96
本文介绍了动态更改Crystal Reports标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,我有一个Crystal报告,它是根据下拉列表的选择更改生成的...

一切都很完美但我要实现的另一件事是动态报表头(即文本下拉列表应显示在标题中)

任何建议....?

HI friends, I've one Crystal Report which gets generated on selection change of dropdown...
Everything is working perfect but One more thing I want to implement is dynamic Report Header(i.e. Text of dropdown should get displayed in Header)
any suggestions....?

推荐答案

你好,



您可以在报告中使用一个TextObject来显示标题。然后在加载水晶报告之前设置headertext。



试试这段代码



Hello ,

you can use one TextObject in the Report to show the header . and then set the headertext before you load the crystal report .

try this code

CrystalReport1 sr = new CrystalReport1();

TextObject txtheader = (TextObject)sr.ReportDefinition.ReportObjects["txtheaderobject"];
// "txtheader" is the TextObject, name mentioned on Crystal Report Viewer.
 txtheader.Text = "HeaderText1";//set the header text

//other coding....

crystalReportViewer1.ReportSource = sr;
crystalReportViewer1.Refresh();





谢谢



thanks


这篇关于动态更改Crystal Reports标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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