Back to "شيء صغير غبي ... يصدر طاولة متوافقة مع Excel من قاعدة بيانات"

This is a viewer only at the moment see the article on how this works.

To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk

This is a preview from the server running through my markdig pipeline

ASP.NET C# Imported mostlylucidcouk

شيء صغير غبي ... يصدر طاولة متوافقة مع Excel من قاعدة بيانات

Friday, 26 March 2004

بسيط جداً ويعتمد على واحدة قمت بتدوينها سابقاً (حسنا ليس بناء على البرمجة ولكن بناء على نفس الفكرة ). على أية حال , ربط هذا بزر odkaz , يمر في مجموعة بيانات وسيقوم بتوفير ملف قابل للتحميل Excel

المستوى العام GetExcel

{

فضاء جامد عام تحويل(DataSet ds, int dataTableId , HttpResponse responseM SK3 string fileNameMSC4

{

DataGrid dg = جديد dataGrid();

dg.SourceData = dsM SK2Tables[dataTableId];

dg.DataBind();

الاستجابة.بفر =حقM SK2

الإجابة.TypeContentM SK1application/vndMSC3msMST4excelMSR5

الإجابة.AddHeader ("Content-DispositionM SK3 MST4attachmentMSC5filenameMNK6 |+ fileNameMRK8 ;

باستخدام (StringWriter sw = new StringWriteer())

{

باستخدام (HtmlTextWriter writer = new HtMLTextWriteerM SK2sw))

{

dg.RenderControlM SK1writer);

الإجابة.WriteM SK1sw.ToString ());

}

}

الإجابة.End();

}

الفراغ الواقف العام تحويل(DataSet dsM SK1 int dataTableId, HttpResponse response )

{

تحويل (ds,dataTableIdM SK2responseMSC3report .xlsMST5

}

الفراغ الجامد العام تحويل(DataSet dsM SK1 HttpResponse response)

{

Convert(dsM SK1response);

}

}

logo

© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.