Etiket: Excel
Ocak 14th, 2010
Hata :
Access Denied
You do not have permissions to open this file on Excel Services.
Make sure that the file is in an Excel Services trusted location and that you have access to the file.

Çözüm :
- Central Administration -> Operations : Burada servislerden Excel Servisinin çalışıyor durumda olduğundan emin olun,
- Central Administration -> SharedServices1 -> Edit Excel Services Setting : Buradan ise File Acces Method un Process Account olduğundan emin olun (değilse en alta admin bir user ve password girmeyi unutmayın),
- Muhtemel hata budur;
Central Administration -> SharedServices1 ->Trusted File Locations


yolunu izleyerek, Data Connection Library imizi ve/veya Report Library mizi güvenilir listesine ekliyoruz;
Burada kritik olan şey;
Location Type ın Windows Sharepoint Services olarak seçilmesi ve URL in düzgün bir şekilde yazılması.
Tags: Connection, Data, Data Connection Library, Excel, Library, Location Type, Report, Report Library, Services, SharedServices, Trusted Location, web service
Posted in Sharepoint | No Comments »
Ekim 31st, 2008
Datatabledaki bilgileri aşağıdaki metodu kullanarak excele export edebilirsiniz. Dataset için de yapılması gerekenler aynıdır. Sadece datatable yerine bind edilen dataset olmalıdır.
public static void ExportDatatableToExcel(DataTable dtt, string filename)
{
try
{
HttpResponse Response = HttpContext.Current.Response;
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=" + filename + "\"");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DataGrid myDataGrid = new DataGrid();
myDataGrid.DataSource = dtt;
myDataGrid.DataBind();
myDataGrid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
catch (Exception ex)
{
//Exception...
}
}
Tags: Dataset, Datatable, Excel, Export, vs.net
Posted in .NeT 2008, Bilgisayar | No Comments »