We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

send as email attachment

Hello,
I want to send the generated workseet as an email attachment. But I dont want to save the file in the server before attaching in the mail. Is there any way i can chance the worksheet object in an array of byte()?

I have three servers in the server farm with load sharing services in the farm. Does saving the file in server affect in any way while retrieving the file in such scenarios ?

3 Replies

MW Melba Winshia Syncfusion Team February 21, 2007 02:03 PM UTC

Hi Nipun,

1) You can get the worksheet object in an array of byte[] by using the using the following code snippet.

[c#]

// Creating a memory Stream.
MemoryStream ms = new MemoryStream();

// Save the xls file to the Stream.
workbook.SaveAs(ms);

// Get the worksheet object in an array of byte[]
byte[] aPdfDocByteArray = new Byte[ms.Length];
ms.Read(aPdfDocByteArray, 0, System.Convert.ToInt32(ms.Length));
ms.Seek(0, SeekOrigin.Begin);

2) No, saving the file in server will not affect in any way while retrieving the file in such scenarios.

Kindly let me know if you have any other questions.

Thanks,
Melba


NT Nipun Tamrakar February 22, 2007 07:50 AM UTC

Hello Melba,

Thanks a lot. This was very helpful.


MW Melba Winshia Syncfusion Team February 22, 2007 02:05 PM UTC

Hi Nipun,

Thanks for the update!

Kindly let me know if you have any other questions.

Regards,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon