Class SalesReportGenerator

java.lang.Object
team75.model.SalesReportGenerator

public class SalesReportGenerator extends Object
Generates a polished PDF sales summary report. Dependencies (Maven): com.itextpdf:itext-core:9.5.0 (type=pom) com.itextpdf:bouncy-castle-adapter:9.5.0 org.jfree:jfreechart:1.5.6
  • Constructor Details

    • SalesReportGenerator

      public SalesReportGenerator()
  • Method Details

    • generate

      public byte[] generate(DB.SalesSummary summary, Timestamp start, Timestamp end) throws IOException
      Generates the report and returns the raw PDF bytes, ready to be written to a file or streamed as an HTTP response.
      Parameters:
      summary - the aggregated sales data
      start - report period start (inclusive)
      end - report period end (inclusive)
      Returns:
      PDF bytes
      Throws:
      IOException