something wrong with data server and phamtomjs and flexmonster.es5.js

Answered
long yu asked on January 27, 2022

hello,
I use data server (with flexmonster 9.16) to suply data,
and i use phantomjs to create my raport, 
as phantomjs dn't know es6, so i use flexmonster.es5
bug it return a error like this
TypeError: null is not an object (evaluating 'getComputedStyle(document.documentElement).getPropertyValue("--fm-version").trim') (from line # in "")
 
if i use flexmonster9.17, the message error is 
ReferenceError: Can't find variable: Map (from line # in "")

could you please watch it ? Thanks a lot
 

5 answers

Public
long yu January 27, 2022

the report is 
 
{"dataSource":{"type":"api","url":"http://localhost:3400/api/cube","index":"appel_in_h-175981"},"slice":{"rows":[{"uniqueName":"Periode.Year","caption":"Année"},{"uniqueName":"Periode.Month","caption":"Mois"},{"uniqueName":"Periode.Day","caption":"Jour"}],"columns":[{"uniqueName":"[Measures]"}],"measures":[{"uniqueName":"nbr_appel","caption":"Nombre appels","grandTotalCaption":"Total Nombre appels","active":true},{"uniqueName":"heure_periode","caption":"Heure","active":false},{"uniqueName":"sum_duree","caption":"Temps de comm.","active":false},{"uniqueName":"sum_duree_sonnerie","caption":"Temps de sonnerie.","active":false},{"uniqueName":"sum_about_attente","caption":"Temps d'attente","active":false},{"uniqueName":"nom_about_groupe","caption":"Groupe","active":false},{"uniqueName":"nom_first_groupe","caption":"1er groupe","active":false},{"uniqueName":"status_appel","caption":"Statut appel","active":false},{"uniqueName":"sous_status_appel","caption":"Statut Callback","active":false},{"uniqueName":"nom_rubrique","caption":"Rubrique","active":false},{"uniqueName":"operateur_name","caption":"Opérateur","active":false},{"uniqueName":"CP","caption":"CP","active":false},{"uniqueName":"orignine_autre","caption":"Origine autre","active":false},{"uniqueName":"origine_fr","caption":"Origine Fr fixe","active":false},{"uniqueName":"origine_fr_mobile","caption":"Origine Fr mobile","active":false},{"uniqueName":"appels_aband_moin_15s","caption":"Appel abandonnée en moins de 15s","active":false},{"uniqueName":"duree_svi","caption":"Durée SVI","active":false},{"uniqueName":"duree_post_appel","caption":"Durée post appel","active":false},{"uniqueName":"nb_repondu_moin_30s","caption":"nb repondu -30 secondes","active":false},{"uniqueName":"nb_repondu_moin_3min","caption":"nb repondu 3 minutes","active":false},{"uniqueName":"temps_attente_x","caption":"Temps attente ≤ 5 sec","active":false},{"uniqueName":"temps_attente_y","caption":"Temps attente ≤ 45 sec","active":false},{"uniqueName":"durée TMC appel","formula":"(sum(\"sum_duree\") - sum(\"sum_about_attente\") - sum(\"duree_svi\")) / sum(\"nbr_appel\")","caption":"durée TMC appel"},{"uniqueName":"Total durée appels","formula":"sum(\"sum_duree\")","caption":"Total durée appels"},{"uniqueName":"Total durée attente","formula":"sum(\"sum_about_attente\")","caption":"Total durée attente"},{"uniqueName":"Total nombre appel","formula":"sum(\"nbr_appel\")","caption":"Total nombre appel"},{"uniqueName":"Durée attente Moy.","formula":"sum(\"sum_about_attente\") / sum(\"nbr_appel\")","caption":"durée attente Moy."},{"uniqueName":"tag_376","caption":"Tag : Annulation","active":false,"grandTotalCaption":"Total Tag Annulation"},{"uniqueName":"tag_672","caption":"Tag : Commande","active":false,"grandTotalCaption":"Total Tag Commande"}]},"options":{}}

Public
Maksym Diachenko Maksym Diachenko Flexmonster January 28, 2022

Hi, Long Yu!

Thank you for reaching out to us.

Since PhantomJS development is currently suspended and no updates are released to that library, some difficulties may occur in using PhantomJS. Our team recommends using the Puppeteer library for working with headless browsers as a better long-term solution. 

We prepared a sample GitHub project with Flexmonster and Puppeteer. It demonstrates running Flexmonster in a headless Chrome browser and performing various types of export. Our comments accompanying the code describe detailed information about the implementation. 

Please let us know if you need any additional information from our side.

Best Regards,
Maksym

Public
long yu January 28, 2022

thanks a lot, I'll try it.
 

Public
long yu February 3, 2022

hi Maksym Diachenko ,
thanks a lot for you reponse, I have un other question about it,
does the jsdom work with flexmonster plz ?

Public
Maksym Diachenko Maksym Diachenko Flexmonster February 4, 2022

Hi, Long Yu!
 
Thank you for creating a new ticket for this topic. 
You can find the answer here.
 
Best Regards,
Maksym

Please login or Register to Submit Answer