读取此文档时出现问题(109)错误 [英] There was a problem reading this document (109) error

查看:370
本文介绍了读取此文档时出现问题(109)错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试打开某些在Crystal Reports 8.5中创建并导出为pdf文件的pdf文件时,我收到此消息的用户(阅读此文档(109)时出现问题).使用Adobe Reader 6在XP和NT上均会收到此错误.在XP或NT上使用Reader 5.1打开同一文件时,用户没有收到任何错误.请帮我.

我正在使用的代码....

如果(Session ["LABREPORT"] = null)
dsReport =(DataSet)Session ["LABREPORT"];
ELBITReportViewer .Visible = false;
ElbitGroupReport.Load(MapPath(〜/Reports/rptElbitLabReports.rpt"));
如果(dsReport.Tables.Count> 0)
{{ SetDataSource(dsReport.Tables [0]); foreach(ElbitGroupReport.ReportDefinition.Sections)中的(each.CrystalDecisions.CrystalReports.Engine.Section)部分. ReportObjects)结果{结果,如果(reportObject.Kind == ReportObjectKind.SubreportObject)结果,{结果SubreportObject报表=(SubreportObject)reportObject;结果的ReportDocument子文档= subReport.OpenSubreport(subReport.SubreportName);
如果(subDocument.Name ==" subrptElbitLabReports"),点击subDocument.SetDataSource(dsReport.Tables [1]);结果,},点击}结果,},点击ELBITReportViewer.ReportSource = ElbitGroupReport; <无线电通信>}
////用于将Crystal报表导出为PDF格式.
字符串ExportPath = Server.MapPath("LabReports"; +" .pdf");
CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions(); .ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
DiskOpts.DiskFileName = ExportPath;
ElbitGroupReport.ExportOptions.DestinationOptions = DiskOpts; Files
字符串srcPdfFile ="LabReports.pdf";
字符串outFile ="LabReports.pdf";
bool canAssembleDocument = true;

bool canCopyContent = true ;
bool canEditContent = true;
bool canFillFormFields = true;
bool canPrint = true;
EncryptionKeySize keySize = Encryp tionKeySize.EncryptKey128Bit;
字符串ownerPassword = String.Empty;
字符串userPassword = String.Empty;
PdfSecurityOptions securityOptions =新的PdfSecurityOptions(); = canCopyContent;
securityOptions.CanEditAnnotations = canEditAnnotations;
securityOptions.CanEditContent = canEditContent;
securityOptions.CanFillFormFields = canFillFormFields; > securityOptions.UserPassword = QUOT; sateesh英寸;结果,securityOptions.OwnerPassword = QUOT; sateesh英寸;结果,PdfSecurityManager的SecurityManager =新PdfSecurityManager(securityOptions);结果,securityManager.LicenseKey = QUOT; nUYocTHTNjQlLgcWU7Z91SlNpc8bSdpDy6XMJWzrKG2hsFa3QOEbcEtE2XWCr75X英寸;结果,安全管理器.SaveSecuredPdfToFile(s rcPdfFile,outFile);


赛得什·乌普普拉(Sateesh Vuppula)

I have users who receive this message (There was a problem reading this document (109)) when trying to open some pdf files that were created in Crystal Reports 8.5 and then exported as a pdf file. This error is received on both XP and NT using Adobe Reader 6. The users did not receive any errors opening the same file using Reader 5.1 on XP or NT. Please help me.

Code I am using....

if (Session["LABREPORT"] != null)
            dsReport = (DataSet)Session["LABREPORT"];
        ELBITReportViewer.Visible = false;
        ElbitGroupReport.Load(MapPath("~/Reports/rptElbitLabReports.rpt"));
        if (dsReport.Tables.Count > 0)
        {
            ElbitGroupReport.SetDataSource(dsReport.Tables[0]);
            foreach (CrystalDecisions.CrystalReports.Engine.Section section in ElbitGroupReport.ReportDefinition.Sections)
            {
                foreach (CrystalDecisions.CrystalReports.Engine.ReportObject reportObject in section.ReportObjects)
                {
                    if (reportObject.Kind == ReportObjectKind.SubreportObject)
                    {
                        SubreportObject subReport = (SubreportObject)reportObject;
                        ReportDocument subDocument = subReport.OpenSubreport(subReport.SubreportName);
                        if (subDocument.Name == "subrptElbitLabReports")
                            subDocument.SetDataSource(dsReport.Tables[1]);
                    }
                }
            }
            ELBITReportViewer.ReportSource = ElbitGroupReport;
        }
        //For Exporting Crystal report to PDF format.
        string ExportPath = Server.MapPath("LabReports" + ".pdf");
        CrystalDecisions.Shared.DiskFileDestinationOptions DiskOpts = new CrystalDecisions.Shared.DiskFileDestinationOptions();
        ElbitGroupReport.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile;
        ElbitGroupReport.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.PortableDocFormat;
        DiskOpts.DiskFileName = ExportPath;
        ElbitGroupReport.ExportOptions.DestinationOptions = DiskOpts;
        ElbitGroupReport.Export();
        //For Setting Password to PDF Files
        string srcPdfFile = "LabReports.pdf";
        string outFile = "LabReports.pdf";
        bool canAssembleDocument = true;
        bool canCopyContent = true;
        bool canEditAnnotations = true;
        bool canEditContent = true;
        bool canFillFormFields = true;
        bool canPrint = true;
        EncryptionKeySize keySize = EncryptionKeySize.EncryptKey128Bit;
        string ownerPassword = String.Empty;
        string userPassword = String.Empty;
        PdfSecurityOptions securityOptions = new PdfSecurityOptions();
        securityOptions.CanAssembleDocument = canAssembleDocument;
        securityOptions.CanCopyContent = canCopyContent;
        securityOptions.CanEditAnnotations = canEditAnnotations;
        securityOptions.CanEditContent = canEditContent;
        securityOptions.CanFillFormFields = canFillFormFields;
        securityOptions.CanPrint = canPrint;
        securityOptions.KeySize = keySize;
        securityOptions.UserPassword = "sateesh";
        securityOptions.OwnerPassword = "sateesh";
        PdfSecurityManager securityManager = new PdfSecurityManager(securityOptions);
        securityManager.LicenseKey = "nUYocTHTNjQlLgcWU7Z91SlNpc8bSdpDy6XMJWzrKG2hsFa3QOEbcEtE2XWCr75X";
        securityManager.SaveSecuredPdfToFile(srcPdfFile, outFile);


sateesh Vuppula

推荐答案

感谢您的发帖!不幸的是,目前没有论坛来发布您要提问的问题,因此我建议您将问题发布到以下Adobe论坛之一: http://www.adobe.com/devnet/


这篇关于读取此文档时出现问题(109)错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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