public ActionResult SpreadsheetPartial()
 {
     return(SpreadsheetExtension.GetCallbackResult("SpreadsheetName", p => {
         p.Saving(e => {
             byte[] docBytes = SpreadsheetExtension.SaveCopy("SpreadsheetName", DocumentFormat.Xlsx);
             DataHelper.SaveDocument(docBytes);
             e.Handled = true;
         });
     }));
 }
Exemplo n.º 2
0
        public static SpreadsheetSettings GetSpreadsheetSettings()
        {
            SpreadsheetSettings settings = new SpreadsheetSettings();

            settings.Name = "SpreadsheetName";
            settings.CallbackRouteValues = new { Controller = "Home", Action = "SpreadsheetPartial" };
            settings.Width  = System.Web.UI.WebControls.Unit.Percentage(100);
            settings.Height = 500;
            settings.Saving = (s, e) =>
            {
                byte[] docBytes = SpreadsheetExtension.SaveCopy("SpreadsheetName", DocumentFormat.Xlsx);
                DataHelper.SaveDocument(docBytes);
                e.Handled = true;
            };
            return(settings);
        }