User Id :    Password :      New Member   Forgot Password  
Topic: How to restore PDF report from stored binary data in Sql server (Table)
Faiz
10 Oct 2011 at 10:08 PM

How to restore pdf formate report using binary data store in sql server table.

I can read binary data in byte array but how to generate pdf formate report.

Re: How to restore PDF report from stored binary data in Sql server (Table)
Najmul Hoda
11 Oct 2011 at 10:13 PM

Hi Faiz,

Please use the below code to restore pdf file from binary data.

string strExtenstion = “.pdf”;
byte[] bytFile =  GetBinaryDataFromDataBase();// “Byte array retrieved from database”;

Response.Clear();
Response.Buffer = true;
Response.ContentType = “application/pdf”;
Response.AddHeader(“content-disposition”,“attachment;filename=Tr.pdf”);
                
Response.Charset = “”;
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.BinaryWrite(bytFile);
Response.End();

 

Hope this will help.

 

Total Replies: 1
 
Featured Text Ad

Featured Ad