Skip to content

FENIX-Platform/fenix-ui-reports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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