gpt4 book ai didi

c# - 将 Crystal 报表对象传递给报表文档而不是物理文件

转载 作者:太空狗 更新时间:2023-10-29 23:16:20 25 4
gpt4 key购买 nike

如何将 Crystal 报表类名动态传递给 ReportDocument。

例如

ReportDocument rpt;
rpt = new ReportDocument();
rpt.Load(filepath);

但我需要使用

ReportDocument rpt;
rpt = new CrystalReport1(); // CrystalReport1 is report name

但我需要动态传递“CrystalReport1”,因此它会动态创建 Report 对象。我该怎么做?

最佳答案

我自己得到了答案,请在下面查看..

CrystalReport obj = new CrystalReport();
ReportDocument rpt = (ReportDocument)obj;

关于c# - 将 Crystal 报表对象传递给报表文档而不是物理文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13641537/

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