v2.0.0
Loading...
Searching...
No Matches
UTILSLIB::Report Class Reference

Simple HTML report builder for MEG/EEG analysis results. More...

#include <report.h>

Public Member Functions

 Report (const QString &sTitle="MNE-CPP Report")
 Construct a report with a title.
void addText (const QString &sTitle, const QString &sContent)
 Add a text section.
void addTable (const QString &sTitle, const QStringList &headers, const QList< QStringList > &rows)
 Add a table section.
void addKeyValue (const QString &sTitle, const QList< QPair< QString, QString > > &pairs)
 Add a key-value section.
void addCode (const QString &sTitle, const QString &sCode)
 Add a preformatted code block.
int sectionCount () const
 Get the number of sections.
QString toHtml () const
 Generate the full HTML string.
bool save (const QString &sPath) const
 Save the report to an HTML file.
const QString & title () const
 Get the report title.

Detailed Description

Simple HTML report builder for MEG/EEG analysis results.

Usage:

Report report("My Analysis");
report.addText("Data Info", "Subject: sub-01, 306 MEG channels");
report.addTable("Channel Stats", headers, rows);
report.addKeyValue("Parameters", {{"Lambda", "0.1"}, {"SNR", "3.0"}});
report.save("/path/to/report.html");
Report(const QString &sTitle="MNE-CPP Report")
Construct a report with a title.
Definition report.cpp:45

Definition at line 74 of file report.h.

Constructor & Destructor Documentation

◆ Report()

Report::Report ( const QString & sTitle = "MNE-CPP Report")
explicit

Construct a report with a title.

Definition at line 45 of file report.cpp.

Member Function Documentation

◆ addCode()

void Report::addCode ( const QString & sTitle,
const QString & sCode )

Add a preformatted code block.

Definition at line 107 of file report.cpp.

◆ addKeyValue()

void Report::addKeyValue ( const QString & sTitle,
const QList< QPair< QString, QString > > & pairs )

Add a key-value section.

Parameters
[in]sTitleSection title.
[in]pairsList of (key, value) pairs.

Definition at line 89 of file report.cpp.

◆ addTable()

void Report::addTable ( const QString & sTitle,
const QStringList & headers,
const QList< QStringList > & rows )

Add a table section.

Parameters
[in]sTitleSection title.
[in]headersColumn headers.
[in]rowsRow data (list of string lists).

Definition at line 62 of file report.cpp.

◆ addText()

void Report::addText ( const QString & sTitle,
const QString & sContent )

Add a text section.

Parameters
[in]sTitleSection title.
[in]sContentText content (plain text or HTML).

Definition at line 52 of file report.cpp.

◆ save()

bool Report::save ( const QString & sPath) const

Save the report to an HTML file.

Parameters
[in]sPathOutput file path.
Returns
true if successful.

Definition at line 160 of file report.cpp.

◆ sectionCount()

int UTILSLIB::Report::sectionCount ( ) const
inline

Get the number of sections.

Definition at line 124 of file report.h.

◆ title()

const QString & UTILSLIB::Report::title ( ) const
inline

Get the report title.

Definition at line 146 of file report.h.

◆ toHtml()

QString Report::toHtml ( ) const

Generate the full HTML string.

Definition at line 117 of file report.cpp.


The documentation for this class was generated from the following files: