GetSheetAsExcel() public method

Get a sheet as an Excel file.

It mirrors To the following Smartsheet REST API method:
GET /sheets/{sheetId} with "application/vnd.ms-excel" Accept HTTP header

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public GetSheetAsExcel ( long sheetId, BinaryWriter outputStream ) : void
sheetId long the Id of the sheet
outputStream System.IO.BinaryWriter the output stream To which the Excel file will be written.
return void
        public virtual void TestGetSheetAsExcel()
        {
            string file = "../../../TestSDK/resources/getExcel.xls";

            server.setResponseBody(file);
            server.ContentType = "application/vnd.ms-excel";

            MemoryStream ms     = new MemoryStream();
            BinaryWriter output = new BinaryWriter(ms);

            sheetResource.GetSheetAsExcel(1234L, output);

            Assert.NotNull(output);
            Assert.True(ms.ToArray().Length > 0);

            byte[] original = File.ReadAllBytes(file);
            Assert.AreEqual(original.Length, ms.Length);
        }