Giter Site home page Giter Site logo

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",
};

Anka Report's Projects

ankareport icon ankareport

Free & Open Source Web Report Designer & Report Viewer

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.