问题描述:如何用代码完成报表继承?
问题解答:
private void FReport_LoadBaseReport(object sender, CustomLoadEventArgs e) { // e.FileName contains the name of base report. It may be the file name, or an ID in the database, // it depends on how you load the main report e.Report.Load("C:\\Users\\InheritReport\\bin\\Debug\\Title2.frx"); }完整代码:
public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Report report = new Report(); report.LoadBaseReport += new CustomLoadEventHandler(FReport_LoadBaseReport); report.Load("InheritReport.frx"); report.LoadBaseReport -= new CustomLoadEventHandler(FReport_LoadBaseReport); report.Show(); } private void FReport_LoadBaseReport(object sender, CustomLoadEventArgs e) { // e.FileName contains the name of base report. It may be the file name, or an ID in the database, // it depends on how you load the main report e.Report.Load("C:\\Users\\InheritReport\\bin\\Debug\\Title2.frx"); } }如果你需要从数据库加载报表,在LoadFromString()中替换Load()方法。
本站文章除注明转载外,均为本站原创或翻译
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:FastReport控件中文网 [https://www.fastreportcn.com/]
本文地址:https://www.fastreportcn.com/post/1476.html
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:FastReport控件中文网 [https://www.fastreportcn.com/]
本文地址:https://www.fastreportcn.com/post/1476.html
相关产品: FastReport.Net, FastReport VCL,