I have designed a method that returns a DataSet object.
Based on that, i create a DOC file and then return it
to the client as follows.
Response.Clear();
Response.AddHeader(
"content-disposition",
string.Format("attachment;filename=SearchResult_{0 }_{1}.doc",
DateTime.Now.ToShortDateString(),
DateTime.Now.ToShortTimeString()));
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.No Cache);
Response.ContentType = "application/vnd.word";
System.IO.StringWriter stringWrite
= new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite
= new HtmlTextWriter(stringWrite);
newGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
By changing the code slightly, i can make the printout
to give me XLS file as well, which is great.
My question is - how can i make my DataSet object to
return a PDF? Today i'm using a solution which isn't
feasible. Can the above be redesigned to give me what
i need? Please advise.
--
Regards
Konrad Viltersten