Code Monkey home page Code Monkey logo

jsreport-browser-client's Introduction

jsreport

Join the chat at https://gitter.im/jsreport/jsreport NPM Version NPM Downloads Docker Pulls build status

An open-source platform for designing and rendering various reports.

jsreport is a reporting server letting developers define reports using javascript templating engines like handlebars. It supports various report output formats like html, pdf, excel, docx, and others. It also includes advanced reporting features like user management, REST API, scheduling, designer, or sending emails.

You can find more information on the official project website https://jsreport.net

studio

Installation

Basic installation from the npm

npm install -g @jsreport/jsreport-cli
jsreport init
jsreport configure
jsreport start

You can also download compiled binary or pull from the official docker images. See https://jsreport.net/on-prem for the details.

Documentation

See the https://jsreport.net/learn for an overview of concepts, guides, clients, and general documentation.

Extensions

The jsreport official distribution in npm, docker, or compiled binary includes the most commonly used extensions. However, the list of available extensions is much longer, and you may want to install some of the missing ones as well. See the list of available packages here or in the documentation.

You are also not limited to extensions we provide to you. You can implement your extensions. See the Implementing custom extension article.

Node.js

You can find documentation for adapting this jsreport distribution using nodejs and also information for integrating it into an existing nodejs application in the article adapting jsreport.

The official jsreport distribution wires the most popular extensions into the ready-to-use package. However, if you are skilled, you are free to start from the ground using jsreport-core.

Development

We use yarn to manage the monorepo. The basic workflow is the following

git clone https://github.com/jsreport/jsreport
yarn install
yarn start

The tests for the individual package runs the following way

yarn workspace @jsreport/jsreport-scripts test

The studio extensions development with the hot reload can be started using

set NODE_ENV=jsreport-development&&yarn start

Roadmap

  • adding more features to docx/pptx/xlsx recipes
  • pdf compression
  • version control extension direct git integration and improvements
  • studio editor intellisense
  • html-to-xlsx - images, filters...

More in the backlog.

Missing a feature? Submit a feature request.

Vulnerabilities

We guarantee every release is stable and has 0 vulnerabilities mentioned in the npm audit. Please wait until we release the next version with the dependencies update when you see a security warning in your audit. There is no need to create a ticket for it. In case you see a direct impact on jsreport security that you can replicate, please send us an email to [email protected] and we will make sure it's fixed ASAP. Note there is no need to panic when there is a vulnerability mentioned in the audit because it is the most likely in the code path that is not used. A typical example of a vulnerability is an eventual DDoS attack through a dependency parsing some internal config, which in fact can't happen and isn't a vulnerability at all.

Licensing

Copyright (C) 2023 Jan Blaha

Do you want to use jsreport for a personal purpose, in a school project or a non-profit organization? Then you don't need the author's permission, just go on and use it. You can use jsreport without the author's permission also when having a maximum 5 templates stored in jsreport storage.

For commercial projects using more than 5 stored report templates see Pricing page.

Under any of the licenses, free or not, you are allowed to download the source code and make your own edits.

In every case, there are no warranties of any kind provided:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

jsreport-browser-client's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jsreport-browser-client's Issues

Client breaks when opening report from behind proxy

Jan

This was already discussed, but I wanted to record it as an issue.
The problem is that the client does not take into consideration X-Forwarded headers when calculating the URL....

Relevant piece of code is here:
https://github.com/jsreport/jsreport-browser-client/blob/master/lib/browser.js#L20

The workaround is to override url before calling 'render'

jsreport.serverUrl = 'http://....'
jsreport.render({....

This may work for those who have static environment (i.e address does not change)...

Full text of scripts appended to final output

I was looking through the source of a rendered template, and I noticed that the full text of all scripts is included in the jsreport.template object that is automatically appended. I was under the impression that the scripts would be run on the server, hidden from the end user, and simply provide data to the template to render. As such, I have a script to define secrets for the SQL connection. Now I realize that the secrets are being sent to the client on every page load. If the scripts need to be provided to the client in full, how can I securely read the data on the server and only send the result to the client? Read the secrets from file synchronously? My template includes calls to jsreport.render to render sub-reports in frames after the user makes some selections, so I believe I am using the correct recipe here.

Wrong link to jsreport.js during preview when hosting on subpath

Replication

  1. Run jsreport on subpath /reporting https://jsreport.net/learn/adapting-jsreport#attach-to-existing-express-app
  2. Create sample template with html-with-browser-client recipe https://jsreport.net/learn/html-with-browser-client
  3. Run preview in studio => the script jsreport.min.js is not found

Problem
The jsreport studio since 1.6 do posts to /api/report/[template-name] and the recipe expects /api/report only. This breaks the relative path to the script jsreport.js

script is inserted before html

Is there a reason why the script that is automatically injected cannot be inserted via script tag?

Currently it is being inserted before document even begins, throwing off validation, and in some cases causing layout issue. Most importantly, the script injected contains report data, which in my case is rather large, so rendering is slowed down (compared to plain html recipie for example)

A simple solution would be just to require including a script link in either head or at the bottom.
It would be template author's responsibility to do so.

Another option would be to use new asset helper with special name.

giving error with jsreport-core

Hi,

I am using jsreport-core package in my meteor app to generate reports.
Normally I use the "html" as "recipe" and it suffices.

Now I want to include filter option in my report.
Accordingly I want to use "recipe" as "html-with-browser-client".

For doing so I have added "jsreport-browser-client" package.

But I am getting error as :
**

TypeError: Cannot read property 'baseUrl' of undefined
at Object.recipe ..\node_modules\jsreport-browser-client\lib\browser.js
at invokeRender ..\jsreport-core\lib\render\render.js

**

I made a new post on jsreport forum and got to know that I need to additionally use "jsreport-express".
https://forum.jsreport.net/topic/1105/can-i-use-html-with-browser-client-recipe-with-jsreport-core-package/3

var jsreport = require('jsreport-core')();
jsreport.use(require('jsreport-templates')());
jsreport.use(require('jsreport-handlebars')());
jsreport.use(require('jsreport-browser-client')());
jsreport.use(require('jsreport-express')({ httpPort: 2000}));

I tried still getting same error.

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.