Giter Site home page Giter Site logo

ankareport / ankareport Goto Github PK

View Code? Open in Web Editor NEW
20.0 2.0 9.0 662 KB

Free & Open Source Web Report Designer & Report Viewer

Home Page: https://ankareport.js.org

License: MIT License

JavaScript 1.85% CSS 8.19% TypeScript 85.62% HTML 4.34%
designer report reporting reporting-tool report-designer layout report-viewer

ankareport's Introduction

Anka Report

designer

Anka Report

Purpose

Free & Open Source Web Reporting Tool

Features

  • Add/Remove Item
  • Bindings
  • Styles
  • Color Picker
  • Move & Size
  • Bulk Move & Resize
  • Add Sub Group
  • Remove Sub Group
  • Style By Group
  • Undo/Redo
  • Elements List
  • Report Viewer
  • Export To PDF
  • Custom PDF Converter

Contributing

yarn install
yarn dev
# open localhost:8080

Setup

<html>
  <head>
    ...

    <link
      rel="stylesheet"
      href="https://unpkg.com/ankareport/dist/ankareport.css"
    />
  </head>
  <body>
    ...

    <script src="https://unpkg.com/ankareport/dist/ankareport.js"></script>
  </body>
</html>

Quick Start

<div id="designer"></div>

<script>
  const designerDiv = document.getElementById("designer");
  const designer = AnkaReport.designer({
    element: designerDiv,
    dataSource: dataSource,
    layout: layout,
    onSaveButtonClick: (layout) => {
      console.log(layout);
    },
  });
</script>
<div id="report"></div>

<script>
  const reportDiv = document.getElementById("report");
  const report = AnkaReport.render({
    element: reportDiv,
    layout: layout,
    data: data,
  });
</script>
Example Data Source
const dataSource = [
  { label: "Header 1", field: "header1" },
  { label: "Header 2", field: "header2" },
  {
    label: "Content",
    children: [
      { label: "Name", field: "name" },
      { label: "Surname", field: "surname" },
    ],
  },
  { label: "Footer 1", field: "footer1" },
  { label: "Footer 2", field: "footer2" },
];
Example Layout
const layout = {
  width: 500,
  headerSection: {
    height: 50,
    items: [
      {
        text: "Header 1",
        binding: "header1",
        x: 5,
        y: 4,
        width: 100,
        height: 20,
      },
      {
        text: "Header 2",
        binding: "header2",
        x: 5,
        y: 28,
        width: 200,
        height: 20,
      },
    ],
  },
  contentSection: {
    height: 75,
    binding: "content",
    items: [
      {
        text: "Label1",
        binding: "name",
        x: 9,
        y: 6,
        width: 100,
        height: 20,
      },
      {
        text: "Label2",
        binding: "surname",
        x: 9,
        y: 26,
        width: 200,
        height: 40,
      },
    ],
  },
  footerSection: {
    height: 40,
    items: [
      {
        text: "Copyright",
        x: 150,
        y: 8,
        width: 100,
        height: 20,
      },
      {
        text: "Desc",
        binding: "footer2",
        x: 250,
        y: 8,
        width: 100,
        height: 20,
      },
    ],
  },
};
Example Data
const data = {
  header1: "Header 1",
  header2: "Header 2",
  content: [
    {
      name: "John1",
      surname: "Doe1",
    },
    {
      name: "John2",
      surname: "Doe2",
    },
    {
      name: "John3",
      surname: "Doe3",
    },
  ],
  footer1: "Footer 1",
  footer2: "Footer 2",
};

ankareport's People

Contributors

aghahuseynov avatar metiftikci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ankareport's Issues

TODO v1

  • Better data source tree
    • Set data source tree
  • Fix: Property grid can set different data source types
  • Fix: Move Selector keydown event from document to element
  • Section bindings
  • Delete item by delete key down
  • Sub sections
  • Add font and font-size variables
  • Remove section button on context menu
  • Implement svg icons
  • #2
  • Line css for Data Source
  • Fix top-down style for report generation
  • Add onChange event
  • Fix elements. Adopt onChange event
  • Collapse Element(Section) by only arrow
  • Element click must select element
  • Add undo/redo #4
  • Fix report section default values
  • Multiple Selector
  • Number format
  • Date format
  • Add custom pdf creator

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.