C ++ / CLI - 基于XML的活动报告 [英] C++/CLI - XML based active reports

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

问题描述

这是我之前的一个查询的继续( C / CLI中的活动报表< a>)。我从C ++ / CLI应用程序访问基于xml的活动报告。是否有任何方式可以与来自C ++ / CLI的活动报告进行数据通信,例如,我想打印在C ++ / CLI应用程序中的受管数据在应用程序访问的XML报告的详细信息部分。我不想使用任何c#代码。可以做吗?谢谢。

This is in continuation to one of my previous queries(active reports in C /CLI). I am accessing an xml-based active report from a C++/CLI application. Is there any way by which I can have a data communication with the active report from C++/CLI, for example, I want to print the managed data present in the C++/CLI application on the details section of the XML report which the application accesses. I don't want to use any c# code. Can it be done? Thanks.

推荐答案

当然,ActiveReports可以做到。由于C ++ / CLI生成标准的.NET对象,您可以在C ++ / CLI中创建对象,ActiveReports将绑定到它们。创建要绑定到的对象的IEnumerable集合(集合中的每个对象都像数据库行)。

Sure, ActiveReports can do it. Since C++/CLI produces standard .NET objects you can create objects in C++/CLI and ActiveReports will bind to them. Create an IEnumerable collection of objects that you want to bind to (each object in the collection is like a database "row").

请参阅将报表绑定到数据源。展开标题下的代码部分以使用IEnumerable数据源,你会看到如何在C#中做。你将在C ++ / CLI中做同样的事情,你只需要将语法从C#更改为C ++ / CLI。显然,你知道C ++ / CLI语法,所以你可以做这一部分,但我认为这回答了你的问题关于如何这样做与ActiveReports。

Take a look at the examples at Binding Reports to a Data Source. Expand the code sections under the heading To use the IEnumerable data source and you'll see how to do it in C#. You would do precisely the same thing in C++/CLI, you'll just change the syntax from C# to C++/CLI. Clearly, you know C++/CLI syntax so you can do that part, but I think this answers your question regarding how to do this with ActiveReports.

基于更新在问题中提出的问题:

您应该能够处理ActiveReports的事件,例如 FetchData事件使用类似以下代码:

You should be able to handle an ActiveReports' event such as the FetchData event using something like the following code:

void MyFetchDataHandler(Object^ sender, FetchEventArgs^ eArgs) 
{
 //put handling code here...
}

myReport->FetchData += ref new FetchEventHandler(this, &MyClass::MyFetchDataHandler)

我没有编译这个(我没有AR handy),但它应该是接近。请参阅 Microsoft的C ++ / CLI事件语法参考文档

I didn't compile this (I don't have AR handy), but it should be close. Please see Microsoft's reference documentation on C++/CLI event syntax here.

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

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