|
Mailing Lists
|
Home /
Groups /
.NET Technical Talk (Net-Talk)
Net CFContent Equivalent
Hey All,Boudreau, Duane 04/01/05 03:54 P We do something like:JediHomer 04/02/05 07:04 A I know this is an old post, but I want to take this a step further. I have an application that exports PDF, XLS or DOC files from a Crystal Report. I have that working fine, however I need to get the exported file to the user.Russel Madere 04/16/07 05:43 P Found my answer:Boudreau, Duane 04/01/05 03:54 P Hey All, Is there a .net equivalent to CFContent Thx, Duane We do something like: byte[] bytMap = null; // Call function to get map Response.Clear(); Response.AddHeader("Content-Type", "image/png"); Response.AddHeader("Content-Length", bytMap.LongLength.ToString()); Response.BinaryWrite(bytMap); Response.End(); HTH On Apr 1, 2005 8:18 PM, Boudreau, Duane <BoudreauD@ci.nashua.nh.us> wrote: ----- Excess quoted text cut - see Original Post for more ----- I know this is an old post, but I want to take this a step further. I have an application that exports PDF, XLS or DOC files from a Crystal Report. I have that working fine, however I need to get the exported file to the user. HTTP is the best best as I am working off of a web server. I need to trigger a new window opening and then use a derivative of this code to download the exported document. I guess I can use a BinaryRead to get the file into stream object and then use the Response.BinaryWrite to send the stream to the client. I just need to know how to open a new browser window. My click event for the export button is: protected void exportByType_Click(object sender, EventArgs e) { ExportSetup(); ExportSelection(); ExportCompletion(); } the three functions work fine. Can someone let me know if I am on the right track? ----- Excess quoted text cut - see Original Post for more ----- Found my answer: Response.AddHeader("content-disposition", "attachment; filename=file.ext"); Hey All, Is there a .net equivalent to CFContent Thx, Duane
|
May 25, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||