Documents > BPS V2 C++ API
BpsReportMenu Class Reference

A report menu fully featured with actions to manage the application report list, to preview, print and create pdf. More...

#include <bpsreportmenu.h>

List of all members.

Public Member Functions

 BpsReportMenu (BpsDatastore *aDatastore, const QString &aApplication, const QString &aTitle, QWidget *aParent=0)
QAction * pdfAction () const
QAction * previewAction () const
QAction * printAction () const

Protected Member Functions

virtual QMap< QString,
QVariantList > 
selections (const QStringList &aUsedSelections) const
 Re-implement this method to pass selections to the report script whenever a report gets loaded.

Detailed Description

A report menu fully featured with actions to manage the application report list, to preview, print and create pdf.


Constructor & Destructor Documentation

BpsReportMenu::BpsReportMenu ( BpsDatastore aDatastore,
const QString &  aApplication,
const QString &  aTitle,
QWidget *  aParent = 0 
)
Parameters:
[in]aDatastoreThe datastore to use my the menu methods.
[in]aApplicationApplication name, such as "designer", "articles", "partners" etc.
[in]aTitleThe menu title.
[in]aParentThe parent widget.

Member Function Documentation

QAction* BpsReportMenu::pdfAction ( ) const
Returns:
The pdf action of the menu.
QAction* BpsReportMenu::previewAction ( ) const
Returns:
The preview action of the menu.
QAction* BpsReportMenu::printAction ( ) const
Returns:
The print action of the menu.
virtual QMap<QString,QVariantList> BpsReportMenu::selections ( const QStringList &  aUsedSelections) const [protected, virtual]

Re-implement this method to pass selections to the report script whenever a report gets loaded.

In the report script the selections will be passed as an object where the table names are used as property names, and the key list is the property value as array.

Parameters:
[in]aUsedSelectionsList of the selections (table names) to provide. By convention an empty list means "all available selections".
 QMap<QString,QVariantList> selections()
 {
     QMap<QString,QVariantList> map;
     map.insert(bStr("t_ordertrips"), QVariantList() << 1 << 5 << 7);
     map.insert(bStr("t_orderrows"), QVariantList() << 3 << 12);
     return map;
 }
Will be represented in the report script like:
 report.selections = {
     t_ordertrips : [1, 5, 7],
     t_orderrows : [3, 12]
 };
Returns:
A map with table names and the corresponding list of the keys.

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