BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
public ActionResult Index(String writerFormat)
{
try
{
string fileName = null;
WriterFormat format;
HttpContext httpContext = System.Web.HttpContext.Current;
ReportWriter reportWriter = new ReportWriter();
reportWriter.ReportPath = Server.MapPath("~/App_Data/GroupingAgg.rdl");
reportWriter.ReportProcessingMode = ProcessingMode.Remote;
if (writerFormat == "PDF")
{
fileName = "GroupingAgg.pdf";
format = WriterFormat.PDF;
}
else if (writerFormat == "Word")
{
fileName = "GroupingAgg.doc";
format = WriterFormat.Word;
}
else if (writerFormat == "Html")
{
fileName = "GroupingAgg.Html";
format = WriterFormat.HTML;
}
else
{
fileName = "GroupingAgg.xls";
format = WriterFormat.Excel;
}
reportWriter.Save(fileName, format, httpContext.Response);
}
catch { }
return View()
} |