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: CSV-Datei als Download -> Excel97 -> Text in Spalten

Empfohlene Antworten

Veröffentlicht

Hallo Forum,

ich stehe vor dem Problem, aus einer ASP-Anwendung heraus eine in Excel97 zu öffnende Datei als Download bereitzustellen. Derzeit schreibe ich die Daten als CSV mit Semikolon getrennt. Lt. Auftraggeber ist es den Anwendern nicht zuzumuten, in Excel den Text selbst durch Selektieren und "Text in Spalten" in die gewünschte Ansicht zu bringen (ja, ich habe auch mit dem Kopf geschüttelt aber Kunde ist König).

Derzeit gebe ich als ContentType "text/csv" an:

this.Response.ContentType = "text/csv";

this.Response.AddHeader("Content-Disposition", "attachment;filename=" + filename);

Gibt es noch andere Schrauben, an denen ich drehen kann?

  • Autor

Habe vorhin einen Tipp bekommen: excellibrary - Excel fileformat library. - Google Project Hosting

Einziges Problemchen dabei. Man braucht ein Dataset. Wer also mit Listen arbeitet, muss die vorher händisch umwandeln. Dafür gibt es z.B. Erweiterungsmethoden wie in c# - Generic List to DataTable - Stack Overflow, die allerdings bei mir nicht funktioniert hat, weil die Listeneemente vom Typ DbDataRecord sind, man kann sich die Erweiterung aber leicht selbst umschreiben

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.