From 41459f78df67d9d554cfad7530e224136db2b7df Mon Sep 17 00:00:00 2001 From: j-dimension Date: Mon, 2 Dec 2024 23:32:48 +0100 Subject: [PATCH] fixed issue with colon in export filename, causing issues on Windows. close #2698 --- .../jlawyer/client/editors/reporting/DynamicTablePanel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/reporting/DynamicTablePanel.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/reporting/DynamicTablePanel.java index bb5de06cf..f08913e92 100644 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/reporting/DynamicTablePanel.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/editors/reporting/DynamicTablePanel.java @@ -664,6 +664,7 @@ You should also get your employer (if you work as a programmer) or school, package com.jdimension.jlawyer.client.editors.reporting; import com.jdimension.jlawyer.client.utils.ComponentUtils; +import com.jdimension.jlawyer.client.utils.FileUtils; import com.jdimension.jlawyer.client.utils.TableUtils; import java.text.DecimalFormat; import javax.swing.JOptionPane; @@ -767,7 +768,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { private void cmdExportTableActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdExportTableActionPerformed try { - TableUtils.exportAndLaunch(this.resultTable.getTableName() + ".csv", this.tblResult, this.decFormat); + String fileName=FileUtils.sanitizeFileName(this.resultTable.getTableName() + ".csv"); + TableUtils.exportAndLaunch(fileName, this.tblResult, this.decFormat); } catch (Exception ex) { log.error("Error exporting table to CSV", ex); JOptionPane.showMessageDialog(this, "Fehler beim Export: " + ex.getMessage(), com.jdimension.jlawyer.client.utils.DesktopUtils.POPUP_TITLE_ERROR, JOptionPane.ERROR_MESSAGE);