Etiket: Excel

Sharepoint Error : Excel Servisi Yetki Hatası

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 :

  1. Central Administration -> Operations : Burada servislerden Excel Servisinin çalışıyor durumda olduğundan emin olun,
  2. 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),
  3. 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: , , , , , , , , , , ,
Posted in Sharepoint | No Comments »

Dataset ya da Datatable’dan Excele Bilgi Aktarma || Export Excel From Dataset, Datatable

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: , , , ,
Posted in .NeT 2008, Bilgisayar | No Comments »