使用数据集中的函数排序 [英] Sort using function within a dataset
本文介绍了使用数据集中的函数排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有以下表达式的reportviewer报告:
Hi,
I have a reportviewer report with the following expression:
IIf([Number of A Levels]>3,(([UCAS Points]/3)*([Number of A Levels]-(1-(1/[Number of A Levels]))))/[Number of A Levels],[UCAS Points]/[Number of A Levels]) AS [Weighted Average]
我需要使用[加权平均值]的结果,或者在表单代码中写一个类似的函数来对报告进行排序.请注意,我使用表适配器和数据集.
通过上面的代码,我得到了函数参数:''>''无法识别.
任何帮助将不胜感激.
问候,
I need to use the results from [Weighted Average] or wite a similar function in the form code to sort the report. Please note that I use tableadapters and datasets.
With the above code I get function arguments: ''>'' not recognized.
Any help would be appreciated.
Regards,
推荐答案
请尝试以下操作可能会有所帮助.
Hi,
Please try following might be helpful.
Dim dr As DataRow
Dim WeightedAverage As Integer = IIf( Convert.ToInt32(dr("Number of A Levels"))>3,((Convert.ToInt32(dr("UCAS Points")/3)*(Convert.ToInt32(dr("Number of A Levels")-(1-(1/Convert.ToInt32(dr("Number of A Levels")))))/Convert.ToInt32(dr("Number of A Levels"),Convert.ToInt32(dr("UCAS Points")/Convert.ToInt32(dr("Number of A Levels"))
我使用了 dr ,它将作为您的 Data Set current Row 的值.
谢谢,
Imdadhusen
i have use dr that will be value of your Data Set current Row.
Thanks,
Imdadhusen
这篇关于使用数据集中的函数排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文