GetReportAsExcel() public method

Gets the Report in the format specified, based on the Report ID.

It mirrors To the following Smartsheet REST API method:
GET /reports/{reportId} 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 GetReportAsExcel ( long reportId, BinaryWriter outputStream ) : void
reportId long the Id of the report
outputStream System.IO.BinaryWriter the output stream To which the Excel file will be written.
return void
Example #1
0
        public virtual void TestGetReportAsExcel()
        {
            string file = "../../../TestSDK/resources/getExcel.xls";

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

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

            reportResource.GetReportAsExcel(1234L, output);

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

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