Package com.leumanuel.woozydata.service
Class DataExportService
java.lang.Object
com.leumanuel.woozydata.service.DataExportService
- Author:
- Leu A. Manuel * Service class for exporting analysis results in PowerBI-compatible format. Handles export of all analysis results to a single Excel workbook.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a standardized analysis report with multiple metrics.voidcustomExport(DataFrame df, List<String> metrics, String filePath) Custom export with user-selected metrics.voidexportToCSV(DataFrame df, String filePath) Exports DataFrame content to a CSV (Comma-Separated Values) file.voidexportToExcel(DataFrame df, String filePath) Exports DataFrame content to a Excel file.voidexportToHTML(DataFrame df, String filePath) Exports DataFrame content to a HTML file.voidexportToJSON(DataFrame df, String filePath) Exports DataFrame content to a JSON (JavaScript Object Notation) file.voidexportToLatex(DataFrame df, String filePath) Exports DataFrame content to a Latex file.voidexportToPowerBI(Map<String, DataFrame> results, String filePath) Exports all analysis results to a single Excel file for PowerBI.
-
Constructor Details
-
DataExportService
public DataExportService()
-
-
Method Details
-
exportToPowerBI
Exports all analysis results to a single Excel file for PowerBI.- Parameters:
results- Map of analysis resultsfilePath- Output file path- Throws:
IOException- if export fails
-
createAnalysisReport
Creates a standardized analysis report with multiple metrics.- Parameters:
df- Source DataFrame- Returns:
- Map containing different analysis views
-
customExport
Custom export with user-selected metrics.- Parameters:
df- Source DataFramemetrics- List of metric names to exportfilePath- Output file path- Throws:
IOException- if export fails
-
exportToCSV
Exports DataFrame content to a CSV (Comma-Separated Values) file. The first row contains headers, and subsequent rows contain data values. Values are separated by commas, and special characters are properly escaped.- Parameters:
df- DataFrame to be exportedfilePath- Path where the CSV file will be saved- Throws:
IOException- if there is an error writing to the file
-
exportToJSON
Exports DataFrame content to a JSON (JavaScript Object Notation) file. The data is formatted as a JSON array of objects with pretty printing enabled for better readability.- Parameters:
df- DataFrame to be exportedfilePath- Path where the JSON file will be saved- Throws:
IOException- if there is an error writing to the file
-
exportToExcel
Exports DataFrame content to a Excel file. The data is formatted as a Excel enabled for better readability.- Parameters:
df- DataFrame to be exportedfilePath- Path where the Excel file will be saved- Throws:
IOException- if there is an error writing to the file
-
exportToHTML
Exports DataFrame content to a HTML file. The data is formatted as a HTML enabled for better readability.- Parameters:
df- DataFrame to be exportedfilePath- Path where the HTML file will be saved- Throws:
IOException- if there is an error writing to the file
-
exportToLatex
Exports DataFrame content to a Latex file. The data is formatted as a Latex enabled for better readability.- Parameters:
df- DataFrame to be exportedfilePath- Path where the Latex file will be saved- Throws:
IOException- if there is an error writing to the file
-