On the basis of this article , I created a ms sql database, including the models and controllers in a Excel Web AddIn (TaskPane)
How can I populate the contents of the table Movie in Excel?
This is the controller:
namespace DatabaseWeb.Controllers
{
public class controllerMovie : Controller
{
private modelMovie db = new modelMovie();
// GET: controllerMovie
public ActionResult Index()
{
return View(db.Movies.ToList());
}
This is the javascript (not working)
function loadSampleData() {
var db = new Controllers.controllerMovie();
var values = db.ActionResult;
// Run a batch operation against the Excel object model
Excel.run(function (ctx) {
// Create a proxy object for the active sheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
// Queue a command to write the sample data to the worksheet
sheet.getRange("B3:D5").values = values;
// Run the queued-up commands, and return a promise to indicate task completion
return ctx.sync();
})
.catch(errorHandler);
}
function loadSampleData() {
var values = getMovies();
// Run a batch operation against the Excel object model
Excel.run(function (ctx) {
// Create a proxy object for the active sheet
var sheet = ctx.workbook.worksheets.getActiveWorksheet();
// Queue a command to write the sample data to the worksheet
sheet.getRange("B3:D5").values = values;
// Run the queued-up commands, and return a promise to indicate task completion
return ctx.sync();
})
.catch(errorHandler);
}
function getMovies() {
$.ajax({
type: "GET",
url: "Controllers/controllerMovie",
success: function (result) {
return result;
},
error: function (response) {
return "fout";
}
});
}
Member
1 Points
12 Posts
Client side (office javascript api) vs server side (asp.net)
Aug 15, 2016 07:05 AM|paceal|LINK
On the basis of this article , I created a ms sql database, including the models and controllers in a Excel Web AddIn (TaskPane)
How can I populate the contents of the table Movie in Excel?
This is the controller:
This is the javascript (not working)
Member
1 Points
12 Posts
Re: Client side (office javascript api) vs server side (asp.net)
Aug 15, 2016 10:38 AM|paceal|LINK
I tried the following with no luck