c# – 将代码类中的数据提供给VS 2013中的Reporting Services设计器

c# – 将代码类中的数据提供给VS 2013中的Reporting Services设计器,第1张

概述我正在尝试创建本地SQL Server Reporting Services报告(.rdlc文件),并将此报告连接到我在代码中生成的一些数据集(无直接SQL Server连接). 我创建一个ReportDataProvider类,其中有一些实例方法返回IList< T>对于各种标准 – 但我似乎找不到一种方法,使这些数据提供方法显示在Visual Studio 2013中的Reporting Se 我正在尝试创建本地sql Server Reporting Services报告(.rdlc文件),并将此报告连接到我在代码中生成的一些数据集(无直接sql Server连接).

我创建一个ReportDataProvIDer类,其中有一些实例方法返回IList< T>对于各种标准 – 但我似乎找不到一种方法,使这些数据提供方法显示在Visual Studio 2013中的Reporting Services设计器中.

当我查看在Report Data Explorer窗口中的“数据集”节点上单击“添加数据集”后出现的对话框时,我会看到一大堆列出的类,而不是我的数据提供者类.

有什么特别的我需要注意(使类静态吗?用一些属性装饰它),以便它显示在可能的数据源的下拉列表中?我尝试过各种各样的事情,但没有找到任何方法让它正常工作…

解决方法 我做了一些研究,并尝试不同的方式来添加类.不幸的是,这个设计师看不到静态类.我尝试了不同的方法,但没有运气.

对于非静态类,这个手册每次都适用于我,即使是像IList这样的接口,但是我不在这里表示:

>确保您的数据报告类的命名空间在.rdlc文件的项目中可用.可以这样,你需要添加引用.
>写数据报告类并重建解决方案.
>关闭并重新打开VS中的.rdlc文件.

我使用VS 2013 ultimate Update 2.

这是我的课程:

using System.Collections.Generic;namespace YourReportnamespace{    public class ReportClass    {        public List<string> TestReportData()        {            return new List<string>();        }        public static List<string> StaticTestReportData()        {            return new List<string>();        }    }    public class ReportWithFIEldsClass     {        private List<string> Data = new List<string>();        public List<string> TestReportData()        {            return Data;        }        public List<string> TestReportData2()        {            return Data;        }        public static List<string> StaticTestReportData()        {            return new List<string>();        }    }    public static class ReportWithFIEldsstaticclass //This class will not appear    {        private static List<string> Data = new List<string>();        public static List<string> StaticTestReportDataFromFIEld()        {            return Data;        }        public static List<string> StaticTestReportData()        {            return new List<string>();        }    }}

这是我在设计师通过手册后得到的:

总结

以上是内存溢出为你收集整理的c# – 将代码类中的数据提供给VS 2013中的Reporting Services设计器全部内容,希望文章能够帮你解决c# – 将代码类中的数据提供给VS 2013中的Reporting Services设计器所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1259403.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存