小弟最近在做报表,用的是SQL SERVER 2008 R2版本的Reporting service,报表部署到报表服务上了,通过远程读取报表。在页面显示的时候是用的ReportViewer控件(ASP.NET),读取报表数据是写的存储过程,直接由报表的数据源和数据集取数据。ASP.NET只是传参数而已。现在问题出现在通过存储过程和报表服务读取的数据都是完整的,但是通过ReportViewer控件呈现出来的数据,竟然少了3条,就是说,我通过纯醋过程和报表服务读取的数据为9条完全不一样的数据,但是reportviewer控件成仙出来的是6条数据。请大侠帮帮忙,该如何解决哦~
代码如下: public void ExportReport()
{
string ReportPath = ConfigurationManager.AppSettings["ReportPath"].ToString();
string ReportServerUrl = ConfigurationManager.AppSettings["ReportServerUrl"].ToString();
string UserID_ReportServer = ConfigurationManager.AppSettings["UserID_ReportServer"].ToString();
string UserPassword_ReportServer = ConfigurationManager.AppSettings["UserPassword_ReportServer"].ToString();
string lcid = System.Threading.Thread.CurrentThread.CurrentCulture.LCID.ToString();
ReportViewerCredential md;
if (Session["Credential"] == null)
{
md = new ReportViewerCredential(UserID_ReportServer, UserPassword_ReportServer, "");
Session["Credential"] = md;
}
else
{
md = Session["Credential"] as ReportViewerCredential;
}
rvProjectInfo.Reset();
rvProjectInfo.ServerReport.ReportPath = "/" + ReportPath + "/" + ExportType;
rvProjectInfo.ServerReport.ReportServerUrl = new Uri(ReportServerUrl);
rvProjectInfo.ServerReport.ReportServerCredentials = md;
ReportParameter[] parameter = Session["ReportParma"] as ReportParameter[];
rvProjectInfo.ServerReport.SetParameters(parameter);
rvProjectInfo.ServerReport.Refresh();
}
代码如下: public void ExportReport()
{
string ReportPath = ConfigurationManager.AppSettings["ReportPath"].ToString();
string ReportServerUrl = ConfigurationManager.AppSettings["ReportServerUrl"].ToString();
string UserID_ReportServer = ConfigurationManager.AppSettings["UserID_ReportServer"].ToString();
string UserPassword_ReportServer = ConfigurationManager.AppSettings["UserPassword_ReportServer"].ToString();
string lcid = System.Threading.Thread.CurrentThread.CurrentCulture.LCID.ToString();
ReportViewerCredential md;
if (Session["Credential"] == null)
{
md = new ReportViewerCredential(UserID_ReportServer, UserPassword_ReportServer, "");
Session["Credential"] = md;
}
else
{
md = Session["Credential"] as ReportViewerCredential;
}
rvProjectInfo.Reset();
rvProjectInfo.ServerReport.ReportPath = "/" + ReportPath + "/" + ExportType;
rvProjectInfo.ServerReport.ReportServerUrl = new Uri(ReportServerUrl);
rvProjectInfo.ServerReport.ReportServerCredentials = md;
ReportParameter[] parameter = Session["ReportParma"] as ReportParameter[];
rvProjectInfo.ServerReport.SetParameters(parameter);
rvProjectInfo.ServerReport.Refresh();
}
解决方案 »
- C# 如何调用COM口实现便携热敏打印机打印图片
- VS2008 嵌入声音文件变为数组,如何播放?
- 顶 者 有 分,如 何 让 窗 体 Show 出 来 时 主 窗 体 不 失 去 焦 点 ?
- 日期查询字符类型转换的错误?
- 无法通过嵌套类型来访问外部类型的问题
- 引用与using有什么区别和联系
- 发挥一下你的聪明才智:给你一个气压计,你能用多少种方法得到一幢楼的高度?
- SqlCommandBuilder更新数据库的问题
- 哪位大哥大姐,能给个c#作的摄像头程序代码阿?
- 网页预览实现
- C#的direct编程可行吗?
- 在vs2010里,如何添加Microsoft.ManagementConsole.dll 引用?
是最后3条还是前面3条?