【Stimulsoft Reports Silverlight教程】使用报表组件

发布时间 : 2018-12-14 11:31:10.000|阅读 271 次

概述:此示例显示如何从代码编辑某些组件属性,报表的所有组成部分都在页面上。

相关链接:

下载Stimulsoft Reports Silverlight最新版本

此示例显示如何从代码编辑某些组件属性。报表的所有组成部分都在页面上。页面位于报表对象中。要获取对组件对象的引用,必须首先获取对该页面的引用。它们可以通过它的名字获得。例如,更改报表中的文本框值:

private void btPreview_Click(object sender, RoutedEventArgs e)
{
    viewer.Report = null;
 
    var stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(
        "WorkWithReportComponents.Work_with_Components.mrt");
    stiReport1.Load(stream);
    stream.Close();
    stream.Dispose();
    stream = null;
 
    ((StiText)stiReport1.Pages["Page1"].Components["Text1"]).Text.Value = textBox1.Text;
 
    viewer.Visibility = System.Windows.Visibility.Visible;
    stiReport1.Render();
    viewer.Report = stiReport1;
}

下面的屏幕截图中,您可以看到示例代码的结果。

Stimulsoft

下载示例

购买Stimulsoft正版授权,请点击“咨询在线客服”哟!

GrapeCity年末福利大放送

在线
客服
微信
QQ 电话
023-68661681
返回
顶部