Hi,
I'm trying to Export Telerik Grid to Excel by using code(SharePoint 2013):
using Telerik.Windows.Documents.Spreadsheet;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders;
using Telerik.WinControls.Export;
using Telerik.Windows.Documents.Core;
using Telerik.Windows.Zip;
using Telerik.Web.UI.Export;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml;
using Telerik.Windows.Documents.Spreadsheet.Model;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx;
using Telerik.Windows.Documents.Fixed;
protected void btnEportToXLS_Click(object sender, EventArgs e)
{
if (TicketsGrid.Items.Count > 0)
{
try
{
TicketsGrid.Rebind();
TicketsGrid.ExportSettings.ExportOnlyData = true;
TicketsGrid.ExportSettings.IgnorePaging = true;
TicketsGrid.ExportSettings.OpenInNewWindow = true;
TicketsGrid.MasterTableView.UseAllDataFields = true;
TicketsGrid.ExportSettings.FileName = "C:\\ExcelFile.xlsx";// Guid.NewGuid().ToString();
TicketsGrid.MasterTableView.ExportToExcel();
}
catch (Exception exc)
{
}
}
}
private GridItemType[] supportedItemTypes = new GridItemType[]
{
GridItemType.Header,
GridItemType.AlternatingItem,
GridItemType.Item
};
After executing the code getting exception:
Could not load file or assembly 'Telerik.Windows.Documents.Spreadsheet, Version=2016.1.106.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified.
Any suggestions please?
I'm trying to Export Telerik Grid to Excel by using code(SharePoint 2013):
using Telerik.Windows.Documents.Spreadsheet;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders;
using Telerik.WinControls.Export;
using Telerik.Windows.Documents.Core;
using Telerik.Windows.Zip;
using Telerik.Web.UI.Export;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml;
using Telerik.Windows.Documents.Spreadsheet.Model;
using Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx;
using Telerik.Windows.Documents.Fixed;
protected void btnEportToXLS_Click(object sender, EventArgs e)
{
if (TicketsGrid.Items.Count > 0)
{
try
{
TicketsGrid.Rebind();
TicketsGrid.ExportSettings.ExportOnlyData = true;
TicketsGrid.ExportSettings.IgnorePaging = true;
TicketsGrid.ExportSettings.OpenInNewWindow = true;
TicketsGrid.MasterTableView.UseAllDataFields = true;
TicketsGrid.ExportSettings.FileName = "C:\\ExcelFile.xlsx";// Guid.NewGuid().ToString();
TicketsGrid.MasterTableView.ExportToExcel();
}
catch (Exception exc)
{
}
}
}
private GridItemType[] supportedItemTypes = new GridItemType[]
{
GridItemType.Header,
GridItemType.AlternatingItem,
GridItemType.Item
};
After executing the code getting exception:
Could not load file or assembly 'Telerik.Windows.Documents.Spreadsheet, Version=2016.1.106.45, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The system cannot find the file specified.
Any suggestions please?