Quantcast
Viewing all articles
Browse latest Browse all 3636

ExportToDisk - PDF creates corrupt PDF

I have this issue with ExportToDisk function with a large report.  When I open and preview the report in Visual Studio, I am able to export the document just fine.  Doing this through code, it fails causing the PDF to be corrupt.

 

The document I am having issues with is 261 pages.  Each page contains an image stored in an xml data file.  This is working with smaller page documents.  For example, it is working with 135 images/pages.

   

privatevoid ProcessFormRPT(string docPath, string xmlDataFile)

    {

      System.Data.DataSet ds = new System.Data.DataSet();

      ds.ReadXml(xmlDataFile, System.Data.XmlReadMode.ReadSchema);


      CrystalDecisions.Shared.ConnectionInfo cInfo = GetXMLLogin(xmlDataFile);

      ReportDocument doc = newReportDocument();


      doc.Load(docPath);

      doc.Refresh();

 

    foreach (ReportDocument subreport in doc.Subreports)

      {

        setConnectioninfo(subreport, cInfo, ds, xmlDataFile);

        subreport.VerifyDatabase();

      }


      setConnectioninfo(doc, cInfo, ds, xmlDataFile);


      doc.VerifyDatabase();

      doc.SaveAs(docPath, false);

 

      doc.ExportToDisk(ExportFormatType.PortableDocFormat, ResultFile);

      doc.Close();

    } // ProcessFormRPT

 

 

I have tried using ExportToStream as well, with no luck.

I tried setting the registry "PrintJobLimit" to -1 without any success. 

 

Is there a limit to the number of pages, or memory constraints?  Is there a registry setting I need to adjust?

 

I am using Visual Studio 2010

 

Note: I can post the procedures setConnectioninfo and GetXMLLogin needed.


Viewing all articles
Browse latest Browse all 3636

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>