Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[ASP.NET] Export in Datei (excel, pdf)

Empfohlene Antworten

Veröffentlicht

Hallo,

ich habe ein Webapplikation in ASP.NET um Tabellen in einer Access 2000 Datenbank zu bearbeiten. Ich möchte jetzt Tabelleneinträge über die Webapplikation drucken und in andere Dateiformate (excel, word, pdf) exportieren können. Ich finde aber einfach keine geeignete Hilfe im Inet :(

und kenne mich auf dem Gebiet auch noch gar nicht aus.

Wäre nett wenn jemand Tipps für mich hat.

Danke

Hi Rumpel84,

schau ma hier gibts ein kleines Beispielprojekt:

http://www.codeproject.com/aspnet/Excel_CSV_export_button.asp

ansonst hab ich dass hier noch die daten von nem Datagrid nach Excel:


private void Button1_Click(object sender, System.EventArgs e)
{
//export to excel

Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;

System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);

this.ClearControls(dg);
dg.RenderControl(oHtmlTextWriter);

Response.Write(oStringWriter.ToString());

Response.End();
}
[/php]

vielleicht hilft dir dass, falls net gib einfach nochmal bescheid

ps. leider ist aus deinem ersten Posting nicht ersichtlich ob du als CodeBehind mit VB.NET oder C# etc. arbeitest...

  • Autor

brauche nochmal Hilfe:

habe deinen Code soweit in VB.net bekommen, allerdings weiss ich nicht was das 'this' für ein Objekt ist? Entspricht das dem 'me' in VB.NET?

Ich habe ein Datagrid auf der Seite, das automatisch generiert wird, je nach Filteroption. In der ersten Spalte befinden sich Checkboxes. Die Zeilen, in denen die Checkbox markiert ist, sollen nach Excel exportiert werden

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.