Coder Social home page Coder Social logo

flexmonster / pivot-xml-report-converter Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 0.0 37 KB

Convert XML Flexmonster reports to JSON format

Home Page: http://flexmonster.com

HTML 3.38% JavaScript 96.62%
json-format xml xml-pivot-reports json reporting report

pivot-xml-report-converter's Introduction

XML-to-JSON report converter

Flexmonster Pivot Table & Charts Website: www.flexmonster.com

Flexmonster Pivot Table & Charts

Flexmonster Pivot is a powerful JavaScript tool for interactive web reporting. It allows you to visualize and analyze data from JSON, CSV, SQL, NoSQL, Elasticsearch, and OLAP data sources fast and conveniently. Flexmonster is designed to integrate seamlessly with any client-side framework and can be easily embedded into your application.

This repository contains the utility for converting Flexmonster reports from old XML format (versions 1.5 through 2.2) to JSON format (version 2.3 and later). You can also use the online version of the converter, which is available on our website.

Table of contents:

Installation and usage

GitHub package

  1. Download a .zip archive with the converter or clone it from GitHub with the following command:
git clone https://github.com/flexmonster/pivot-xml-report-converter.git

The converter is located in the js/ folder.

  1. Use the converter in your project. It can be done as follows:
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<!-- Include the converter in your HTML page -->
<script type="text/javascript" src="pivot-xml-report-converter/js/fm-converter.js"></script>
<script type="text/javascript">
const xmlReport = '<config>' +
                    '<dataSource type="csv">' +
                      '<filename>https://cdn.flexmonster.com/data/data.csv</filename>' +
                    '</dataSource>' +
                  '</config>';
let jsonReport = fmCovertXmlReport(xmlReport);
console.log(jsonReport);
</script>

Note that the xmlReport should have the String type. In the index.js file, you can find an example of reading a local .xml file and passing the String data to the converter.

npm module

  1. Install the converter with the following npm command:
npm install pivot-xml-report-converter
  1. Use the converter in your project. It can be done as follows:
let converter = require('pivot-xml-report-converter');
const xmlReport = '<config>' +
                    '<dataSource type="csv">' +
                      '<filename>https://cdn.flexmonster.com/data/data.csv</filename>' +
                    '</dataSource>' +
                  '</config>';
let jsonReport = converter(xmlReport);
console.log(jsonReport);

Note that the xmlReport should have the String type. In the index.js file, you can find an example of reading a local .xml file and passing the String data to the converter.

pivot-xml-report-converter's People

Contributors

maksymkad avatar marviem avatar uaman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pivot-xml-report-converter's Issues

Creating node module along with brower based utility

Can we convert this browser level utiltiy to nodejs module? This can have few advantages

  1. Command line utility which will convert xml file to json file that I can later save to database as flexmonster configuration
  2. Brower level utility convert xml manually one by one which is blocker in automatically converting all xml to json through any script

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.