【Stimulsoft Reports.WinForms教程】Detalization实时报表

【下载Stimulsoft Reports.Ultimate最新版本】

此示例项目显示如何在单独的预览窗口中进行报表分离。该报告可能包含外部报表中的详细数据。例如,主要和详细报表显示在单独的预览窗口中。加载主报表,为click事件添加事件侦听器,并在查看器中显示此报表:

private void button2_Click(object sender, System.EventArgs e)
{
    StiReport report = new StiReport();
    report.RegData(dataSet1);
    report.Load("..\\LiveReports.mrt");
    report.Compile();
    report.CompiledReport.Click += new EventHandler(click);
    report.Show();
}

在click事件中,您可以使用主报表中的参数加载包含数据过滤的详细报表:

private void click(object sender, EventArgs e)
{
    StiComponent comp = sender as StiComponent;
    string customerID = (string)comp.BookmarkValue;
 
    if (customerID != null)
    {
        StiReport report = new StiReport();
        report.RegData(dataSet1);
        report.Load("..\\Details.mrt");
        StiDataBand dataBand = (StiDataBand)report.Pages["Page1"].Components["DataBand1"];
        StiFilter filter = new StiFilter("{Orders.CustomerID==\"" + customerID + "\"}");
        dataBand.Filters.Add(filter);
        report.Show();
    }
}

示例代码的结果如下图所示:

Stimulsoft

查看原文,下载示例

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值