shulamitg
asked on
Export Crystal Report to pdt Error "File does not begin with '%pdf-" only on some computers
I have a problem -in my dot net web application, I export my crystal report to pdf. In some computers it works great and some computers get
the error : File does not begin with '%pdf-' -
what can I do in my code to make sure it works on all comuters ?
my code is the following:
to my function displaypdf I send my crystal report:
private void DisplayPDF(ReportDocument rep)
{
Stream stm = rep.ExportToStream(ExportF ormatType. PortableDo cFormat);
byte[] buff = new byte[stm.Length];
stm.Position = 0;
stm.Read(buff, 0, buff.Length);
Response.ContentType = "Application/pdf";
Response.OutputStream.Writ e(buff, 0, buff.Length);
Response.End();
}
Again I want to stress that on some computers it works great and on some not what can I do in my code that will make it work everywhere.
the error : File does not begin with '%pdf-' -
what can I do in my code to make sure it works on all comuters ?
my code is the following:
to my function displaypdf I send my crystal report:
private void DisplayPDF(ReportDocument rep)
{
Stream stm = rep.ExportToStream(ExportF
byte[] buff = new byte[stm.Length];
stm.Position = 0;
stm.Read(buff, 0, buff.Length);
Response.ContentType = "Application/pdf";
Response.OutputStream.Writ
Response.End();
}
Again I want to stress that on some computers it works great and on some not what can I do in my code that will make it work everywhere.
Are you exporting from several machines or from a single machine and sharing the reports?
mlmcc
mlmcc
ASKER
I run the report on the IIS server and then as you see in my above code sends it to the client as pdf.
In the comupter that we have the problem we uninstalled the explorer and the acrobat reader and reinstalled every thing again, and it still has the problem. what's intersting is that on the same computer some times it does open my pdf with no problem and some times it give the error.
Any other ideas ????
Shulamit
In the comupter that we have the problem we uninstalled the explorer and the acrobat reader and reinstalled every thing again, and it still has the problem. what's intersting is that on the same computer some times it does open my pdf with no problem and some times it give the error.
Any other ideas ????
Shulamit
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What version of the Acrobat reader are you using? Have you tried upgrading to the latest?
mlmcc
mlmcc
ASKER
I am talking about the same report . and on the same computer some time it works some time it doesn't. the version is 5.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If it doesn't, then there may be an old dll creating the pdf that is at the root of the problem. Check your application deployment and make sure all of your dependencies are included.