Posted 29 March 2020, 11:54 pm EST
I’m trying to get started with the spread component in my ASP.NET MVC 5 application. It can load the component easily using this in my view:
@Html.FpSpread("FpSpread1")
However I cannot for the life of me figure out how to import an Excel file to the spread component. I have used the methods from the documentation like so:
public ActionResult ExcelView2([FarPoint.Mvc.Spread.MvcSpread]FarPoint.Mvc.Spread.FpSpread FpSpread1)
{
ViewBag.Message = "Welcome to GrapeCity";
FpSpread1 = new FarPoint.Mvc.Spread.FpSpread("FpSpread1", new ControllerContext());
if (FpSpread1 != null)
{
var value = FpSpread1.ActiveSheetView.Cells[0, 0].Value;
}
FpSpread1.OpenExcel("PATH/FILENAME.xlsx");
FarPoint.Web.Spread.DefaultSkins.Office2016White.Apply(FpSpread1);
FpSpread1.ActiveSheetView.PageSize = FpSpread1.Rows.Count;
return View(FpSpread1);
}
It can open the page view and display an excel-like component, but it does not import the data from the excel file. I’ve tried loading an .xls instead of .xlsx, but it’s the same. I have no idea where to go from here or even if my implementation is correct. The documentation only give methods and no indication of how to use them…