PDA

View Full Version : How to stream a word document to the screen


mushahidi
March 13, 2007, 13:53:15
Hi, I want to stream the data as a word document to the screen instead of saving it onto the server (I use the save property of the servertextcontrol). This is because I want the user to save the file on his machine.
Thanks.:confused:

Björn Meyer
March 13, 2007, 15:50:13
Hello

I suppose that you want to pass the document to the client's browser. This code shows how to response a binary data to the browser:


byte[] data;
serverTextControl1.Create();
serverTextControl1.Text = "TX Text Control .NET Server";
serverTextControl1.Save(out data, TXTextControl.BinaryStreamType.AdobePDF);
serverTextControl1.Dispose();
Response.BinaryWrite(data);

mushahidi
March 14, 2007, 06:03:30
Well, that seemed to do the trick. Learning is a wonderful gift and the people who teach you are the gifted.
Thanks alot Bjorn:D