var Reports = require('fx-reports/start');
var reports = new Reports({
...
});| Parameter | Type | Default Value | Example | Description |
|---|---|---|---|---|
| format | string | - | "table" || "metadata" | Export format |
| config | Object | - | - | Check specific format configuration/td> |
//This is an example
reports.on("export.success", function () {...});reports.on(event, callback[, context]): pub/subreports.export( config ): export resource
export.start: export startexport.success: export successexport.error: export error
Steps to use it:
- Create an instance of FenixExport module
- Call the
initmethod on that instance, specifying the plugin that you want to call (for now, it's possible to call onlytableExportandmetadataExport) - Call the
export(*** *payload*, *URL*, *successCallback** , *errorCallback** )method passing as parameters (the parameters with * are facultative)
var fenixExport = new FenixExport;
var payload = {
"input":{
"config":{
"uid":#UID_CHOSEN
}
}
};
var URL = "localhost:8080"
fenixExport.init("metadataExport");
fenixExport.export(payload,URL);metadata: export metadata in a PDF file.table: export table in an MS Excel file (.xlsx).
Set the language:
var payload = {
"input":{
"config":{
"uid":"#UID_CHOSEN"
}
},
"output":{
"config":{
"lang":"ES"
}
}
};Set file name
var payload = {
"input": {
"config":{
"uid": #UID_CHOSEN
}
},
"output": {
"config": {
"fileName": #fileName.pdf
}
}
}; TODO