Im creating a PDF from crystal reports and then open it with adobe reader straight after.
However, sometimes I think adobe reader tries to open the file before it is fully created. (The pdf file exists but maybe still not complete ??)
Here is my code:
rep.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Utilities.Paths.pathToPDFs + fileNamePreFix + dt + ".pdf");
Open("\"" + Utilities.Paths.pathToPDFs, fileNamePreFix + dt + ".pdf" + "\"", Utilities.Paths.pathToAdobeReader);
System.Diagnostics.Process.Start(Utilities.Paths.pathToAdobeReader, "\"" + Utilities.Paths.pathToPDFs + fileNamePreFix + dt + ".pdf" + "\"");
Could it be that the ExportToDisk is returning early before the PDF file has been fully created ?
This is the error message I am getting:
Image may be NSFW.
Clik here to view.
Once I click OK, then then Adobe reader displays the report.
J