2.0.0-beta.10 • Published 6 years ago

fenix-ui-reports v2.0.0-beta.10

Weekly downloads
4
License
GPL-2.0
Repository
github
Last release
6 years ago

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/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