Class DataExportService

java.lang.Object
com.leumanuel.woozydata.service.DataExportService

public class DataExportService extends Object
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 Details

    • DataExportService

      public DataExportService()
  • Method Details

    • exportToPowerBI

      public void exportToPowerBI(Map<String,DataFrame> results, String filePath) throws IOException
      Exports all analysis results to a single Excel file for PowerBI.
      Parameters:
      results - Map of analysis results
      filePath - Output file path
      Throws:
      IOException - if export fails
    • createAnalysisReport

      public Map<String,DataFrame> createAnalysisReport(DataFrame df)
      Creates a standardized analysis report with multiple metrics.
      Parameters:
      df - Source DataFrame
      Returns:
      Map containing different analysis views
    • customExport

      public void customExport(DataFrame df, List<String> metrics, String filePath) throws IOException
      Custom export with user-selected metrics.
      Parameters:
      df - Source DataFrame
      metrics - List of metric names to export
      filePath - Output file path
      Throws:
      IOException - if export fails
    • exportToCSV

      public void exportToCSV(DataFrame df, String filePath) throws IOException
      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 exported
      filePath - Path where the CSV file will be saved
      Throws:
      IOException - if there is an error writing to the file
    • exportToJSON

      public void exportToJSON(DataFrame df, String filePath) throws IOException
      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 exported
      filePath - Path where the JSON file will be saved
      Throws:
      IOException - if there is an error writing to the file
    • exportToExcel

      public void exportToExcel(DataFrame df, String filePath) throws IOException
      Exports DataFrame content to a Excel file. The data is formatted as a Excel enabled for better readability.
      Parameters:
      df - DataFrame to be exported
      filePath - Path where the Excel file will be saved
      Throws:
      IOException - if there is an error writing to the file
    • exportToHTML

      public void exportToHTML(DataFrame df, String filePath) throws IOException
      Exports DataFrame content to a HTML file. The data is formatted as a HTML enabled for better readability.
      Parameters:
      df - DataFrame to be exported
      filePath - Path where the HTML file will be saved
      Throws:
      IOException - if there is an error writing to the file
    • exportToLatex

      public void exportToLatex(DataFrame df, String filePath) throws IOException
      Exports DataFrame content to a Latex file. The data is formatted as a Latex enabled for better readability.
      Parameters:
      df - DataFrame to be exported
      filePath - Path where the Latex file will be saved
      Throws:
      IOException - if there is an error writing to the file