fenix-ui-reports
v2.0.0-beta.10
Published
FENIX export component
Downloads
12
Readme
FENIX Reports
var Reports = require('fx-reports/start');
var reports = new Reports({
...
});
Configuration
API
//This is an example
reports.on("export.success", function () {...});
reports.on(event, callback[, context])
: pub/subreports.export( config )
: export resource
Events
export.start
: export startexport.success
: export successexport.error
: export error
How to use it
Steps to use it:
- Create an instance of FenixExport module
- Call the
init
method on that instance, specifying the plugin that you want to call (for now, it's possible to call onlytableExport
andmetadataExport
) - 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);
Formats
metadata
: export metadata in a PDF file.table
: export table in an MS Excel file (.xlsx).
Metadata format configuration
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
}
}
};
Table format configuration
TODO