c# - Having issue on viewing Excl file generated by SSRS report with cube data source in ASP.net MVC Using view.officeapps.live.com/op/embed.aspx?src=url -


these following requirements.

  1. there url ssrs report renders report in excel file
  2. we have setup mvc application web app , webapi app server.
  3. since ssrs inside firewall app server connect through appserver. in appserver, report has been rendered follows


public httpresponsemessage generatelegacyreport() {     try     {         string endtypestring = "&rs:format=excel";          url = url + businesssegmentformat(businesssegment) + regionstringformat(region) +             facilitysitestringformat(selectedsite) + fromdateformat(fromdate) +             todateformat(todate) + salespersonformat(username) + sortstringformat(sortorder) +             buildsortorderurl(sortbylist) + groupbyformat(reportname, groupby) + endtypestring;          //alertmailer setalert = new alertmailer();         //setalert.notifyerror("report", null, url);          if (!string.isnullorempty(url))         {             string _sessionpipelinereport = "pipelinereport" + datetime.now.tostring("yyyymmddhhmmss") + ".xls";             byte[] excelbytes = null;             using (webclient webclient = new webclient())             {                 webclient.credentials = credentialcache.defaultcredentials;                 //sample url replaced actual ssrs url                  url = "https://online.utpb.edu/webapps/dur-browsercheck-bb_bb60/samples/sample.xlsx?crmreports/customerprofilesummary&rs:command=render&businesssegment=%5bbusiness%20segment%5d.%5bbusiness%20segment%20code%5d.%26%5bes%5d&region=%5bregion%5d.%5bregion%20name%5d.%5ball%5d&facility=%5bfacility%5d.%5bfacility%20name%5d.%5ball%5d&fromdate=%5bearned%20date%5d.%5bdate%5d.%26%5b2015-01-26t00:00:00%5d&todate=%5bearned%20date%5d.%5bdate%5d.%26%5b2016-01-26t00:00:00%5d&user=%5bsalesperson%5d.%5busername%5d.%26%5bapeterson%5d&sortorder=desc&sortby=revenue&rs:format=excel";                 excelbytes = webclient.downloaddata(url);             }             //var result = new httpresponsemessage(httpstatuscode.ok) { content = new bytearraycontent(excelbytes) };             //result.content.headers.contenttype = new mediatypeheadervalue("application/pdf");             //result.content.headers.contentdisposition = new contentdispositionheadervalue("inline")             var result = new httpresponsemessage(httpstatuscode.ok) { content = new bytearraycontent(excelbytes) };             result.content.headers.contenttype = new mediatypeheadervalue("application/vnd.ms-excel");             result.content.headers.contentdisposition = new contentdispositionheadervalue("inline")             {                 filename = _sessionpipelinereport             };             return result;         }         return request.createresponse(httpstatuscode.gone);                   }     catch (exception ex)     {         throw new exception("internal server error. please try again...");     } } 

and have start reading web app , render

response.redirect("https://view.officeapps.live.com/op/embed.aspx?src=" +fileurl , false); 

we able download report excel file nor rendered int viewer.

please suggest solutions other better online viewer (supports mvc , html 5)

if information sample solution more appreciated :)


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -