第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

MVC中使用RDLC報(bào)表

MVC中使用RDLC報(bào)表

喵喵時(shí)光機(jī) 2018-12-07 11:44:58
這是早晨問(wèn)的問(wèn)題,估計(jì)沒(méi)幾率再看到了,所以貼一下 http://q.cnblogs.com/q/34069/ 雖然有一個(gè)回答,但是MVC的actionz中似乎不能使用Response.Write。 看了另外的文章,有點(diǎn)感覺(jué)可能是擴(kuò)展一個(gè)ActionResult,但流的知識(shí)忘的差不多了,無(wú)法把二進(jìn)制的RDLC的數(shù)據(jù)呈現(xiàn)到頁(yè)面的一個(gè)div當(dāng)中,在頁(yè)面中我使用的是HTML.RederAction來(lái)加載報(bào)表的預(yù)覽。 這是ReportsResult public class ReportsResult : ActionResult { public ReportsResult(byte[] data, string mineType) { this.Data = data; this.MineType = mineType; } public byte[] Data { get; set; } public string MineType { get; set; } public override void ExecuteResult(ControllerContext context) { if (Data == null) { new EmptyResult().ExecuteResult(context); return; } context.HttpContext.Response.ContentType = MineType; using (MemoryStream ms = new MemoryStream(Data)) { ms.Position = 0; using (StreamReader sr = new StreamReader(ms)) { context.HttpContext.Response.Output.Write(sr.ReadToEnd()); } } } } 重新寫的action ? public ActionResult EmployeesNumberPerYear() { string dtatSetName = "DsENPerYear"; var dataSource = EmployeeReports.EmployeesNumberPerYear(employeeRepository); string reportFilePath = Server.MapPath("~/RDLC/Employee/EmployeesNumberPerYear.rdlc"); string reportType = "PDF"; string mimeType; string encoding; string fileNameExtension; byte[] renderedBytes = HotelReport.GenerateReport(dtatSetName, dataSource, reportFilePath, reportType, out mimeType, out encoding, out fileNameExtension); return new ReportsResult(renderedBytes, mimeType); } 可能些的有點(diǎn)問(wèn)題。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 451 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)