GithubHelp home page GithubHelp logo

adhoc-reporter's Introduction

meteor-reporter

The beginnings of an ad hoc reporter package for meteor

Features

  • jstree control to view collections and fields
  • Fields can be given user-friendly names
  • Allows for specification of field types (currency, date, etc.) and application of custom formatting based on those field types
  • Based on a defined schema, identifies all possible paths between collections and automatically joins tables correctly without user intervention
  • DataTables for output supports sorting, paging, exporting to Excel/pdf/etc
  • Advanced filtering options based on type of field, as well as ability to specify boolean logic

Future features

  • Drag and drop fields into and out of the report
  • Prettify the package appearance generally (better loading screens, etc.)
  • Allow grouping, formula fields
  • Support subdocuments
  • Add some tests for package maintenance

Other things perhaps it should do (but not even on the roadmap yet)

  • Make UI more template driven for better visual integration into Meteor apps
  • Adapt UI for smaller screens (mobile)

Known bugs

  • Doesn't support removing fields from the report

Getting Started

To install:

meteor add dovrosenberg:ad-hoc-reporter

You also need to have some version of bootstrap 3 installed, including modal.js and dropdown.js.

To use:

{{> reporter <parameters>}}

Parameters:

  • schemas (required): an object showing the collections and fields you want to include. The format of the object is:

      {
          'Books': {                  // the name of the Meteor collection object
             label: 'Books',          // the text to display the user when referring to the collection (ex. in the treeview)
             fields: {
                title: {              // the field name
                    label: 'Title',   // the text label to display the user when referring to this field
                    format: 'Title text',  // optional, the name of format function (see below) to be applied
                    type: 'String'    // optional, used to ensure filtering/sorting works properly ('Number', 'Boolean', or 'Date'... anything else ignored and assumed to be String)
                },
                ...
             },
             foreignKeys: [           // an array of foreign key descriptors
                {
                   localKey: 'authorID',   // the field in this collection that connect it to the other
                   to: 'Authors',          // the collection to which this is connected
                   foreignKey: '_id',      // the field in "to" on which to match
                   name: 'Author',         // a descriptor for this connection when viewing it from this side (i.e. "a Book has an Author")
                   reverseName: 'Books'    // a descriptor for this connection when viewing it from the other side (i.e. "an Author has one or more Books")
                 },
                ...
             ]
          },
          ...
      }
    

    Note: you only need to include fields that you want to be reportable here. You DO NOT need to include key fields unless you want the user to actually see the values of those fields.

    Note: foreign keys should only be described in one collection, as they are reversed by the package. That is, you should not describe the relationship shown above under the "Authors" collection as well.

    Note: version 0.3 specifies a different, incompatible schema format than prior versions

  • formats (optional): an object describing any available custom formatting functions. The format of the object (no pun intended) is:

      {
          'dollars':
             function (amount) {
          	   return accounting.formatNumber(amount,2);
             },
          'Title text':
             function (value) {
                // add text before every item shown in the grid - probably
                //    not a very useful example
          	   return 'The title is: ' + value;
             },
          ...
      }
    
  • tableDOM (optional): a string to be passed to the dom property of the DataTable containing the results (see https://datatables.net/reference/option/dom for more information.) And DataTables extensions (css and js) you require should be placed into your /client/compatibility directory. And if you want to use the tabletools extension, you should also place the swf file in public/swf.

License

Copyright (c) 2015 Dov Rosenberg

Licensed under the [MIT license][mit]. [mit]: http://www.opensource.org/licenses/mit-license.php

adhoc-reporter's People

Contributors

dovrosenberg avatar

Stargazers

Babak Niknia avatar

Watchers

Chris Heschong avatar James Cloos avatar  avatar  avatar

adhoc-reporter's Issues

Uncaught TypeError: template.parent is not a function

Hello - the adhoc report builder has great promise for what I need, however, I'm having trouble getting started. I get the above/below errors, thoughts?

@ dovrosenberg_ad-hoc-reporter.js:2532 Uncaught TypeError: template.parent is not a function(anonymous function) ...

And then Blaze blows up as well with:

Exception in queued task: Error: Must be attached
at DOMRange.firstNode (http://localhost:3000/packages/blaze.js?9391df93ba5076c2cfc61ee68724eb79b65f00d9:474:11) ...

  1. I have a collection called ListDocs with a field called field1.
  2. I've installed 0.4.1 of the package

The template:

<template name="reportBuilder">

  <!-- Page heading -->
    {{> pageHeading title='Reports' category='Report Builder' }}

    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-lg-12">
                  {{> reporter schemas=mySchema}}
                </div>
              </div>
          </div>
</template>`

mySchema Object passed in from a helper:

Template.reportBuilder.helpers({
  // schema for report builder
  mySchema: function () {
      var mySchema = {
        'ListDocs': {                  
          label: 'List Docs',         
           fields: {
                field1: {             
                    label: 'field1'  
                }
            }
          }
        }
      return mySchema;
  },

});

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.