gpt4 book ai didi

c# - C# 中的 Stimulsoft 报告节控制

转载 作者:太空宇宙 更新时间:2023-11-03 16:32:15 27 4
gpt4 key购买 nike

我在我的程序(C# 程序)中使用 Stimulsoft Report 制作报告。

我想通过 C# 代码更改(或控制)报告中的一个部分(例如页脚带)的可见性。

这是怎么做到的?

最佳答案

我认为您应该在报表中创建一个变量并从 C# 传递一个值。
然后在报告中,您可以使用变量来决定是否打印您的部分。
例如:

            bool printFooterValue = false;
using(StiReport rpt = new StiReport())
{
rpt.Load("your_report_file.mrt);
rpt.Dictionary.Databases.Clear();
rpt.Dictionary.Databases.Add(new StiOleDbDatabase("your_database", "your_connection_string"));
rpt.Compile();
rpt.CompiledReport["printFooter"] = printFooterValue;
if(preview == true)
rpt.Show(true);
else
rpt.Print(false, 1);
}

关于c# - C# 中的 Stimulsoft 报告节控制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10472518/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com