Sagar Bandkar

Sagar Bandkar

  • 1.4k
  • 347
  • 48.9k

How to increase hight and width of rdlc report in mvc 5

Mar 24 2017 1:35 AM
Controller:
public ActionResult ReportHome()
{
ReportViewer reportViewer = new ReportViewer();
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.SizeToReportContent = true;
//reportViewer.Width = Unit.Percentage(100);
//reportViewer.Height = Unit.Percentage(100);
reportViewer.Width = Unit.Pixel(1600);
reportViewer.Height = Unit.Pixel(1600);
var connectionString = ConfigurationManager.ConnectionStrings["HrPlusWebConnectionString"].ConnectionString;
SqlConnection conx = new SqlConnection(connectionString); SqlDataAdapter adp = new SqlDataAdapter("SELECT * FROM tblMstCity_CTY", conx);
adp.Fill(ds, ds.tblMstCity_CTY.TableName);
reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"Reports\EmpReport.rdlc";
reportViewer.LocalReport.DataSources.Add(new ReportDataSource("HrPlusWebDataSet1", ds.Tables["tblMstCity_CTY"]));
ViewBag.ReportViewer = reportViewer;
return View();
}
 
 
View-
@using ReportViewerForMvc;
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<body>
@Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer)
</body>
</html>