'Problem show report in ASP.NET MVC C# SSRS
I have an ASP.NET MVC 5 project, I inherit a project built with aspx, this project shows reports from SSRS, as I am porting the project to MVC I have difficulties showing these reports.
Right now I am using 2 methods to display SSRS reports (ReportViewer and BoldReports)
ReportViewer
This method works for me, but I have a small problem: when the report loads for the first time, it does not have the parameters set (it only shows me the upper bar with the option to enter the parameters) and it is very small (making it difficult to choose the parameters if they are dates or a set of data)
When it finally loads the report is acceptable but very small to its "real" size
Controller:
[Authorize]
public ActionResult Visor(int id)
{
AsignadorMenus(Session["usuario"].ToString());
int idX = id;
string path = reportesN.GetPath(idX);
ReportViewer rptViewer = new ReportViewer();
// ProcessingMode will be Either Remote or Local
string ssrUrl = System.Configuration.ConfigurationManager.AppSettings["ReportPath"].ToString();
rptViewer.ProcessingMode = ProcessingMode.Remote;
rptViewer.SizeToReportContent = true;
rptViewer.ZoomMode = ZoomMode.PageWidth;
rptViewer.Width = Unit.Percentage(100);
rptViewer.Height = Unit.Percentage(100);
rptViewer.AsyncRendering = false;
rptViewer.ServerReport.ReportServerUrl = new Uri(ssrUrl);
rptViewer.ServerReport.ReportPath = path;
rptViewer.ServerReport.Refresh();
ViewBag.ReportViewer = rptViewer;
//string reportFolder = System.Configuration.ConfigurationManager.AppSettings["ReportPath"].ToString();
//ReportViewer.Height = Unit.Pixel(Convert.ToInt32(Request["Height"]) - 58);
return View(_menus);
}
View:
@if (ViewBag.ReportViewer != null)
{
<div id="reportView" class="table-responsive">
@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, new { scrolling = "yes", width = "100%" })
</div>
}
BoldReports
I am using the information from this page to build the report: Load SSRS Report Server reports
My ReportServer is this:
Inside my view this is my code:
<div style="width:80%; height:50%; position:absolute;">
@(Html.Bold().ReportViewer("viewer")
.ReportServerUrl("http://10.100.189.130/ReportServer")
.ReportPath("/Comercializacion/Servidor Web/ReporteP3W-SGR")
.ProcessingMode(BoldReports.ReportViewerEnums.ProcessingMode.Remote)
)
</div>
When I load the report in my view, it appears empty:
In both cases (it can be any of them) how can I solve these "errors"?
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|





