npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-jasperstarter

v1.0.0

Published

generate jasper report by jasperstarter

Downloads

11

Readme

node-jasperstarter

English

A jasper report generator with jasperstarter.

It can compile a .jrxml to .jasper, and generate a report by jasper file.

Only support JSON be data source currently.

jasper libs version: 6.17.0

support fonts

methods

generate({ jrxml, jasper, output, format, input, type }): Promise<Buffer>

  • parameters

    • jrxml: Path of jrxml file which will use to compile if jasper didn't exist.

    • jasper: Path of jasper file which wants to use to generate report.

    • output: The path (without filename extension) use to put the file which will be generated.

    • format: The format what you want to generate.

      1. pdf - default
      2. docx
      3. xlsx
      4. pptx
      5. odt
      6. ods

      not support csv currently

    • input: The path of JSON data source.

    • type: The type of data source, only support JSON currently.

  • usage

    const jasperstater = require("node-jasperstarter")
      
    jasperstarter.generate({
      jasper: "/home/project/data/example.jasper",
      output: "/home/project/data/temp/output",
      format: "pdf",
      input: "/home/project/data/example.json",
      type: "json"
    }).then((exportFile) => {
      // Something what you want to do.
      // exportFile will be a Buffer.
    }).catch((error) => {
      // It will return some error messages here if generated error.
    })

compile(jrxml: string, output?: string)

  • parameters

    • jrxml: Path of jrxml file which wants to be compiled

    • output: (optional) The path where do you want the compiled jasper file be put

  • usage

    const jasperstater = require("node-jasperstarter")
      
    jasperstarter.compile(
      "/home/project/data/example.jrxml",
      "/home/project/data/temp/test.jasper",
    ).then((jasperPath) => {
      // Something what you want to do.
    }).catch((error) => {
      // It will return some error messages here if compiled error.
    })

中文

這是一個使用 jasperstarter 來生產 jasper 報表的工具。

可以把 .jrxml 編譯成 .jasper,並且可以透過 jasper 檔案來產生報表。

目前僅支援以 JSON 檔案作為資料來源。

jasper 函數庫版本: 6.17.0

支援字型

方法

generate({ jrxml, jasper, output, format, input, type }): Promise

  • 參數

    • jrxml: 當 jasper 檔案不存在時要用於編譯的 jrxml 檔案路徑。

    • jasper: 用於產生報表檔的 jasper 檔案路徑。

    • output: 產出的報表檔放置的檔案路徑(不須副檔名)。

    • format: 欲生成的檔案格式。

      1. pdf - 預設
      2. docx
      3. xlsx
      4. pptx
      5. odt
      6. ods

      尚不支援CSV

    • input: 資料來源的JSON檔案路徑

    • type: 資料來源的形式,目前僅支援JSON

  • 用法

    const jasperstater = require("node-jasperstarter")
    
    jasperstarter.generate({
    jasper: "/home/project/data/example.jasper",
    output: "/home/project/data/temp/output",
    format: "pdf",
    input: "/home/project/data/example.json",
    type: "json"
    }).then((exportFile) => {
    // 報表產出後你要做的事情。
    // exportFile 會是個 Buffer。
    }).catch((error) => {
    // 如果有發生錯誤的話,會回傳錯誤訊息於此。
    })

compile(jrxml: string, output?: string)

  • 參數

    • jrxml: 要編譯的 jrxml 檔案路徑

    • output: (選擇性的) 編譯後的輸出路徑

  • 用法

    const jasperstater = require("node-jasperstarter")
      
    jasperstarter.compile(
      "/home/project/data/example.jrxml",
      "/home/project/data/temp/test.jasper",
    ).then((jasperPath) => {
      // Something what you want to do.
    }).catch((error) => {
      // It will return some error messages here if compiled error.
    })