npm.io
2.0.0-beta.10 • Published 7 years ago

fenix-ui-reports

Licence
GPL-2.0
Version
2.0.0-beta.10
Deps
4
Size
957 kB
Vulns
0
Weekly
0

FENIX Reports

var Reports = require('fx-reports/start');

var reports = new Reports({
        ...
    });

Configuration

Parameter Type Default Value Example Description
format string - "table" || "metadata" Export format
config Object - - Check specific format configuration/td>

API

//This is an example
reports.on("export.success", function () {...});
  • reports.on(event, callback[, context]) : pub/sub
  • reports.export( config ) : export resource

Events

  • export.start : export start
  • export.success : export success
  • export.error : export error

How to use it

Steps to use it:

  1. Create an instance of FenixExport module
  2. Call the init method on that instance, specifying the plugin that you want to call (for now, it's possible to call only tableExport and metadataExport )
  3. 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

Keywords