Reporting services SSRS如何增加文本报告参数的大小
我试图通过文本报告参数将图像传递到报告中。Reporting services SSRS如何增加文本报告参数的大小,reporting-services,Reporting Services,我试图通过文本报告参数将图像传递到报告中。但是,它似乎只在图像较小时才起作用。我用来调用报告的代码大致如下: private CustomerAttachment LoadFromReportServer(byte[] imgAsByte) { string mimeType, encoding, extension; string[] streamids; Warning[] warnings; string base64String = Co
但是,它似乎只在图像较小时才起作用。我用来调用报告的代码大致如下:
private CustomerAttachment LoadFromReportServer(byte[] imgAsByte)
{
string mimeType, encoding, extension;
string[] streamids;
Warning[] warnings;
string base64String = Convert.ToBase64String(imgAsByte);
_reportParams = new List<ReportParameter>();
_reportParams.Add(new ReportParameter("p_farm_map", base64String));
var rptViewer = new ReportViewer();
rptViewer.ShowCredentialPrompts = false;
rptViewer.ShowParameterPrompts = false;
rptViewer.ProcessingMode = ProcessingMode.Remote;
_reportServerUrl = "http://MyReportServer.wesenergy.local/ReportServer";
_reportFolderPath = "/WcfReportTest/";
_reportName = "FarmMapReport";
rptViewer.ServerReport.ReportServerUrl = new Uri(_reportServerUrl);
rptViewer.ServerReport.ReportPath = _reportFolderPath + _reportName;
rptViewer.ServerReport.SetParameters(_reportParams);
//Fails on this line here
byte[] bytes = rptViewer.ServerReport.Render(_reportFormat, deviceInfo, out mimeType, out encoding, out extension, out streamids, out warnings);
return new CustomerAttachment(_customerId, _fileName,"application/pdf", bytes);
}
private CustomerAttachment LoadFromReportServer(字节[]imgAsByte)
{
字符串mimeType,编码,扩展;
字符串[]流线;
警告[]警告;
string base64String=Convert.ToBase64String(imgAsByte);
_reportParams=新列表();
_添加(新的ReportParameter(“p_farm_map”,base64String));
var rptViewer=新的ReportViewer();
rptViewer.ShowCredentialPrompts=false;
rptViewer.showParameterPerCompts=false;
rptViewer.ProcessingMode=ProcessingMode.Remote;
_reportServerUrl=”http://MyReportServer.wesenergy.local/ReportServer";
_reportFolderPath=“/WcfReportTest/”;
_reportName=“FarmMapReport”;
rptViewer.ServerReport.ReportServerUrl=新Uri(_ReportServerUrl);
rptViewer.ServerReport.ReportPath=\u reportFolderPath+\u reportName;
rptViewer.ServerReport.SetParameters(_reportParams);
//在这条线上失败了
byte[]bytes=rptViewer.ServerReport.Render(_reportFormat、deviceInfo、out mimeType、out encoding、out extension、out streamid、out warnings);
返回新的CustomerAttachment(_customerId,_文件名,“application/pdf”,字节);
}
在报告中,p_farm_map
是一个文本报告参数我在较大文件上得到的错误是
rsInvalidParameter
错误
有没有办法显式设置文本数据类型的最大大小 由于对这个问题没有回应,而且项目时间有限,替代解决方案是将图像保存到共享中;通过文本字段将文件位置传递到报告,并让图像使用该文本值作为图像的源。这不是一个理想的解决方案,因为我必须从磁盘读写(速度慢)。此外,我现在还必须清理这些文件 由于对这个问题没有回应,而且项目时间有限,替代解决方案是将图像保存到共享中;通过文本字段将文件位置传递到报告,并让图像使用该文本值作为图像的源。这不是一个理想的解决方案,因为我必须从磁盘读写(速度慢)。此外,我现在还必须清理这些文件 文件名的大小有多大?这是完整的路径吗?我知道windows有一个像255之类的硬限制,或者我以前遇到过的文件大小在700kb左右。当我调用报告时,图像已经从一个流转换为byte[]并转换为base64String。这段代码适用于较小的文件,因此我怀疑问题在于SRSS文本数据类型。文件名的大小有多大?这是完整的路径吗?我知道windows有一个像255之类的硬限制,或者我以前遇到过的文件大小在700kb左右。当我调用报告时,图像已经从一个流转换为byte[]并转换为base64String。这段代码适用于较小的文件,因此我怀疑问题在于SRSS文本数据类型。