using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders;
using Telerik.Windows.Documents.Spreadsheet.Model;
using Telerik.Web.UI;

public partial class SpreadsheetViewer : System.Web.UI.Page
{

    protected void Page_Init(object sender, EventArgs e)
    {
        string filePath = Request.QueryString["file"];
        var workbook = new Telerik.Web.Spreadsheet.Workbook();
        if (!string.IsNullOrEmpty(filePath))
        {
            SpreadsheetDocumentProvider provider = new SpreadsheetDocumentProvider(Server.MapPath(filePath));
            workbook.Sheets = provider.GetSheets();
            var json = workbook.ToJson();
            HiddenField1.Value = json;
        }
    }
}