C / CLI中的活动报告 [英] active reports in C /CLI

查看:183
本文介绍了C / CLI中的活动报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在C ++ / CLI中使用Active Reports 7.0吗?我刚刚开始使用活动报告。我试着在C#中构建报告没有任何问题。我试着在C ++ / CLI做同样的,但我无法使用活动报告工具箱。而且当运行应用程序时,它会给出许可错误。

Can we use Active Reports 7.0 in C++/CLI? I have just started using active reports. I tried building a report in C# without any problem. I tried doing the same in C++/CLI, but I am unable to use the Active reports toolbox. And also when running the application, it is giving licensing errors.

推荐答案

生成基于代码的设计器不适用于C ++ / CLI。你也不能在C ++的报告中写script。不过,您可以将报告设计为基于XML的报告(rpx)然后你不应该有任何问题实例化和调用来自C + +通过 SectionReport 类(例如)。类似如下:

The designer that generates code-based won't work with C++/CLI. You also won't be able to write "script" inside the reports with C++. However, you can design reports as the XML-based reports (rpx) instead and then you shouldn't have any problem instantiating and calling on those from C++ via the SectionReport class (for example). Something like the following:

GrapeCity::ActiveReports::SectionReport ^sectionReport = gcnew GrapeCity::ActiveReports::SectionReport();
System::Xml::XmlTextReader ^xtr = new System::Xml::XmlTextReader("..\\..\\rptScript.rpx");
sectionReport->LoadLayout(xtr);
xtr->Close();
viewer1->LoadDocument(sectionReport);
...

记住ActiveReports用户几乎都是C# VB.NET用户,所以你不会找到任何C ++代码示例,但它应该是相当微不足道的将代码从C#转换到C ++ / CLI。

Keep in mind ActiveReports users are almost exclusively C# & VB.NET users so you won't find any C++ code samples, but it should be pretty trivial to translate the code from C# to C++/CLI.

示例基于SectionReport,而不是 PageReport ,但PageReport是完全基于xml的,所以它也应该很容易工作。

The example is based on SectionReport not PageReport, but PageReport is entirely xml-based so it should work easily too.

要澄清,如果你想要一个C ++的解决方案,你需要做以下事情:

So to clarify, if you want a C++ only solution, you need to do the following:

创建报表为基于XML的报表(* .rpx文件)独立设计器应用程序,在安装ActiveReports时安装在开始菜单中。由于您可以将报告另存为独立的.rpx文件,因此不需要使用任何C#/ VB.NET DLL 。如上面的代码示例所示,您可以直接从C ++(例如)直接从文件加载.rpx文件。

Create your reports as XML-based reports (*.rpx files) using the "Standalone" designer application that is installed in the start menu when you install ActiveReports. Since you can save your reports as a standalone, independent .rpx file, you will not need to use any C#/VB.NET DLL. As shown in the code example above, you can just load the .rpx files from a file directly from C++ (for example).

虽然此技术不需要任何C#或VB.NET DLL / EXE ,但如果您在独立的.rpx报表中使用脚本功能文件,脚本将必须是C#或VB脚本。然而,你不必自己编译,ActiveReports内部处理脚本。

Although this technique does not require any C# or VB.NET DLL/EXE, if you use the scripting feature inside the standalone .rpx report file, the script will have to be either C# or VB script. However, you won't have to compile that yourself, ActiveReports deals with the script internally.

这篇关于C / CLI中的活动报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆