使用报表上的ObjectDataSource中的列表作为报表中Telerik Chart的数据源 [英] Using a list in my ObjectDataSource on my report for the DataSource of a Telerik Chart in report
问题描述
嘿,我想在报表上的ObjectDataSource(objectDataSource1)对象内使用列表(贷款),作为同一报表上我的Telerik图表的数据源。我看过的大多数教程都显示了使用SQL字符串查询其数据库的报告。我觉得我看起来有些傻了。我还发布了Telerik,但尚未得到任何回复。
Hey there I'm trying to use a list (Loans) within my ObjectDataSource (objectDataSource1) object on a report, as the DataSource for my Telerik chart on the same report. The majority of the tutorials I have looked at all show the report querying their database with a SQL string. I feel I'm over looking something silly. I've also posted on Telerik and haven't got a response quite yet.
我想做的事情是这样的:
What I want to do is something like this:
chart1.DataSource = objectDataSource1.Loans;
或者像我正在处理其他报告那样能够在运行时进行设置报表上的工具:
Or to be able to just set it at run time, as I'm doing with the other reporting tools on the report:
[=Fields.CurrentModel.Loans]
是否可以使用ObjectDataSource中的列表作为图表的数据源?希望这很清楚。
Is it possible to use a list within an ObjectDataSource as the DataSource for my Chart? Hopefully this is clear. Thanks a ton in advance!
推荐答案
因此,在深入了解它之后,我在telerik的论坛上找到了这篇文章:
So after looking a bit deeper into it, I found this post on telerik's forums:
统计图本身具有绑定,您可以在其中设置表达式,在其中可以将统计图的DataSource属性设置为对象数据源上的列表。
The charts themselves have "Bindings" where you can set up an expression where you can set the chart's DataSource property to a list on your Object Data source.
转到图表的属性列,然后单击绑定下的椭圆按钮:
Going to the chart's Properties column and click the ellipse button under Bindings:
然后从此处设置属性路径和表达式,您会很高兴
And from there just set the Property Path and the Expression and you're golden
这篇关于使用报表上的ObjectDataSource中的列表作为报表中Telerik Chart的数据源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!