错误从代码导出Rdlc TO PDf [英] Error Export Rdlc TO PDf from code

查看:56
本文介绍了错误从代码导出Rdlc TO PDf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iam从后面的代码将rdlc导出为pdf
直到今天一切都很好
但我今天错了
&它仅显示1个报告,我不知道是什么原因
**************************************
这是错误

(处理中):可扩展列表:索引6超出允许范围[0 :: 4]
它出现在该行中

byte []个字节= ReportViewer1.LocalReport.Render(格式,null,输出mimeType,输出编码,输出扩展,输出streamIds,输出警告);

****************************************************** **************
这是在locak硬盘上创建pdf的代码
****************************

iam export rdlc to pdf from code behind
it was working fine untill today
but i hvae this is error today
& it appear only with 1 report i don''t know what is the reason
*********************************
This is the error

(processing): ScalableList: Index 6 outside the allowed range [0::4]
it''s appear in that line

byte[] bytes = ReportViewer1.LocalReport.Render(Format, null, out mimeType, out encoding, out extension, out streamIds, out warnings);

****************************************************************
This is the code for creating pdf on locak hard drive
****************************

public static void CreatePdfFile(ReportViewer Rv,string FileName)
        {
            try
            {
                Warning[] warnings;
                string[] streamids;
                string mimeType;
                string encoding;
                string filenameExtension;
                byte[] bytes = Rv.LocalReport.Render("PDF", null, out mimeType, out encoding, out filenameExtension, out streamids, out warnings);
                using (FileStream fs = new FileStream(@"c:\"+FileName+".pdf", FileMode.Create))
                {
                    fs.Write(bytes, 1, bytes.Length);
                }
            }
            catch (Exception ex)
            { throw new Exception(ex.Message); }
        }



****************************************************** *********



***********************************************************

推荐答案



您是否通过以下链接进行过操作:
从代码隐藏直接导出到Excel或PDF [
Hi,

Have you gone through this link:
Export directly to Excel or PDF from codebehind[^]


这篇关于错误从代码导出Rdlc TO PDf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆