将DataGridView添加到ActiveReports 3 [英] Adding DataGridView to ActiveReports 3

查看:215
本文介绍了将DataGridView添加到ActiveReports 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将DataGridView添加到ActiveReports 3文件中。当我添加控件时,它不被识别为DataGridView,而是一个自定义控件。任何人都可以帮助我解决这个问题?

I need to add a DataGridView to an ActiveReports 3 file. When I add the control its not recognized as a DataGridView but rather a custom control. Can anyone help me get around this?

推荐答案

您可以将CustomControl.Control转换为DataGridView,以格式事件编程方式访问对象的控件包含该部分。在中有一个例子CustomControl.Control属性的文档主题。请注意,在该主题中,它使用ChartFX,但您将使用DataGridView。

You can cast CustomControl.Control to DataGridView to access the object programmatically from the format event of the control containing the section. There is an example of doing this in the CustomControl.Control property's documentation topic. Note that in that topic, it uses ChartFX, but you'll be using DataGridView.

但是,@LordHits关于在报表中使用DataGridView的评论是一个很好的评论。通常,您只需要将报表连接到相同的数据源,并使用相同的查询,并让报表获取数据。您也可以轻松将报表绑定到System.Data.DataSet。请参阅帮助主题操作手册>将报告绑定到数据源>在ActiveReports 3用户指南中使用数据集

However, @LordHits comment about using DataGridView in a report is a good one. Normally, you'd just want to connect the report to the same data source and use the same query and let the report get the data. You can also bind the report to a System.Data.DataSet easily as well. See the help topic "How-To Section > Binding Reports to a Data Source > Using a Dataset" in the ActiveReports 3 User Guide.

Scott Willeke
GrapeCity

这篇关于将DataGridView添加到ActiveReports 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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