{"id":17703868,"url":"https://github.com/birddevelper/salmos-report-spring-boot-starter","last_synced_at":"2026-03-04T05:31:45.084Z","repository":{"id":57732622,"uuid":"411709665","full_name":"birddevelper/salmos-report-spring-boot-starter","owner":"birddevelper","description":"A useful simple to use spring-boot library that help you to build beautiful html table, xml document, PDF or any other formats with very specific features from sql or list of objects","archived":false,"fork":false,"pushed_at":"2025-09-25T11:18:09.000Z","size":233,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-25T13:23:43.657Z","etag":null,"topics":["generator","hibernate","html","java","jdbc","jdbctemplate","pdf","report","reportgenerator","spring","spring-boot","xls","xml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/birddevelper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-29T14:34:49.000Z","updated_at":"2025-09-25T11:18:13.000Z","dependencies_parsed_at":"2024-10-25T00:20:23.879Z","dependency_job_id":"1cb146dd-d817-44fe-a903-993e8bace905","html_url":"https://github.com/birddevelper/salmos-report-spring-boot-starter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/birddevelper/salmos-report-spring-boot-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2Fsalmos-report-spring-boot-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2Fsalmos-report-spring-boot-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2Fsalmos-report-spring-boot-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2Fsalmos-report-spring-boot-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/birddevelper","download_url":"https://codeload.github.com/birddevelper/salmos-report-spring-boot-starter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/birddevelper%2Fsalmos-report-spring-boot-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30072507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:13:31.218Z","status":"ssl_error","status_checked_at":"2026-03-04T05:10:24.293Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generator","hibernate","html","java","jdbc","jdbctemplate","pdf","report","reportgenerator","spring","spring-boot","xls","xml"],"created_at":"2024-10-24T21:06:18.524Z","updated_at":"2026-03-04T05:31:45.056Z","avatar_url":"https://github.com/birddevelper.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"What is SalmosReport\n======\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.birddevelper/salmos-report-spring-boot-starter.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.birddevelper%22%20AND%20a:%22salmos-report-spring-boot-starter%22)\n\nSalmosReport is a spring boot library that facilitates the creation of HTML reporting tables and documents in various formats such as HTML, XML, PDF, and custom formats from SQL queries, arrays, and lists. Presently, the tool can generate HTML, XML, PDF documents, and customized format reports.other custom formats.\n\n![Salmos Report](https://raw.githubusercontent.com/birddevelper/salmos-report-spring-boot-starter/master/salmosReport_SQL_Hibernate.jpg)\n\n\n### Features\n\n* Read data from List of Objects and Entities\n* Read data from database by sql query\n* Aggregation functions (Sum, Average, Count)\n* Generate HTML Report\n* Generate XML document\n* Generate PDF document\n* Generate custom structure report\n* Generate TEXT file from report\n* Css Classes for HTML report\n* Embedded Css Style for HTML report\n\n### Getting started\n\n\nCurrent Version of the  plugin is 2.1.0\n\nGradle :\n```shell\nimplementation 'io.github.birddevelper:salmos-report-spring-boot-starter:2.1.0'\n```\n\n\nMaven :\n```shell\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.birddevelper\u003c/groupId\u003e\n  \u003cartifactId\u003esalmos-report-spring-boot-starter\u003c/artifactId\u003e\n  \u003cversion\u003e2.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Usage\n\nThere exist 3 classes in this plugin to make amazing things for you.\n\n* HtmlReportMaker : A class that generates HTML table from records retrieved from sql query or from list of objects.\n* XmlReportMaker : A class that generates XML document from records retrieved from sql query or from list of objects.\n* GeneralReportMaker : This class generates output in any given structure and format from sql query or list of objects.\n\n#### HtmlReportMaker Sample code\n\n```java\nimport io.github.birddevelper.salmos.HtmlReportMaker;\nimport io.github.birddevelper.salmos.setting.HtmlReportTemplate;\nimport io.github.birddevelper.salmos.setting.SummaryType;\n\n\n@Service\npublic class ReportService {\n\n    @Autowired\n    DataSource dataSource;\n\n    public String generateReport() {\n\n        // Creating instance of HtmlReportMaker\n        HtmlReportMaker hrm = new HtmlReportMaker(dataSource);\n        // specify columns of data that must be summarized in table footer row\n        hrm.addSummaryColumn(\"Age\", SummaryType.AVERAGE);\n        hrm.addSummaryColumn(\"Salary\", SummaryType.SUM);\n        \n        // template specifies the report table appearance\n        HtmlReportTemplate myTemplate = new HtmlReportTemplate();\n        myTemplate.setTableCssClass(\"tblReport\");\n        myTemplate.setEvenRowCssClass(\"myEvensRow\");\n        myTemplate.setOddRowCssClass(\"myOddsRow\");\n        myTemplate.setHeaderRowCssClass(\"myheader\");\n        myTemplate.setRightToLeft(true);\n        myTemplate.setRowIndexHeader(\"#\");\n        myTemplate.setRowIndexVisible(true);\n        \n        hrm.setTemplate(myTemplate);\n        \n        //  summary section numbers decimal point setting\n        hrm.setSummaryDecimalPrecision(1);\n        \n        //  summary section numbers seperated by comma \n        hrm.setSummaryCommaSeperatedNumbers(true);\n        \n        // show  row's index\n        hrm.isRowIndexVisible(true);\n        \n        // set the query retrieving data from database\n        hrm.setSqlQuery(\"select fullname as 'Name', age as 'Age', salary as 'Salary'   from chamber limit 0,10\");\n        \n        return hrm.generate();\n\n      \n\n    }\n}\n```\n\n\n\n\n#### XmlReportMaker Sample Code\n\n```java\nimport io.github.birddevelper.salmos.XmlReportMaker;\nimport io.github.birddevelper.salmos.setting.SummaryType;\nimport io.github.birddevelper.salmos.setting.XmlReportElementType;\n@Service\npublic class ReportService {\n\n    @Autowired\n    DataSource dataSource;\n\n    public String generateXMLReport() {\n        // Creating instance of XmlReportMaker\n        XmlReportMaker xrm = new XmlReportMaker(dataSource);\n\n        // specify columns of data that must be summarized (they will put in root element as attribute) \n        xrm.addSummaryColumn(\"Age\", SummaryType.AVERAGE);\n        xrm.addSummaryColumn(\"Salary\", SummaryType.SUM);\n\n        // summary section numbers decimal point setting\n        xrm.setSummaryDecimalPrecision(0);\n        \n        xrm.setRootElementName(\"Persons\");\n        xrm.setChildElementName(\"person\");\n        \n        // this line set the generator to put row data in attributes of row element\n        xrm.setXmlReportElementType(XmlReportElementType.RecordColumnAsElementAttribute);\n        \n        // set the query retrieving data from database\n        xrm.setSqlQuery(\"select fullname as 'Name', age as 'Age', salary as 'Salary'   from chamber limit 0,10\");\n        \n        return xrm.generate();\n    }\n}\n```\n\n\n\n\n\n\n#### GeneralReportMaker Sample code\n\n```java\nimport org.log.carvan.utils.GeneralReportMaker;\nimport io.github.birddevelper.salmos.setting.SummaryType;\n\n@Service\npublic class ReportService {\n\n    @Autowired\n    DataSource dataSource;\n\n    public String generateUniversalReport() {\n\n        GeneralReportMaker grm = new GeneralReportMaker(dataSource);\n        // load template from file located in resources \n        grm.loadTemplateBodyFromFile(\"templates/salmosTemplates/template1.html\");\n\n        // set the query retrieving data from database\n        grm.setSqlQuery(\"select fullname as 'Name', age as 'Age', salary as 'Salary'   from chamber limit 0,10\");\n\n        // specify columns of data that must be summarized \n        grm.addSummaryColumn(\"Age\", SummaryType.AVERAGE);\n        grm.addSummaryColumn(\"Salary\", SummaryType.SUM);\n\n        // set footer template with String (to have a column summary in footer, you should use ::[column name]Summary in template \n        grm.setTemplateFooter(\"\u003cp \u003e\u003cb\u003e CityCount \u003e\u003e ::AgeSummary ---- Capacity Average \u003e\u003e ::SalarySummary \u003c/b\u003e \u003c/p\u003e\");\n\n        \n        return grm.generate();  // return String containing the produced report\n\n\n    }\n}\n```\n\n### Generate PDF report \n```java\nimport io.github.birddevelper.salmos.HtmlReportMaker;\nimport io.github.birddevelper.salmos.setting.HtmlReportTemplate;\nimport io.github.birddevelper.salmos.setting.SummaryType;\n\n\n@Service\npublic class ReportService {\n\n    @Autowired\n    DataSource dataSource;\n\n    public File generatePDFReport() {\n\n        // Creating instance of HtmlReportMaker\n        HtmlReportMaker hrm = new HtmlReportMaker(dataSource);\n        // specify columns of data that must be summarized in table footer row\n        hrm.addSummaryColumn(\"Age\", SummaryType.AVERAGE);\n        hrm.addSummaryColumn(\"Salary\", SummaryType.SUM);\n        \n        \n        //  summary section numbers decimal point setting\n        hrm.setSummaryDecimalPrecision(1);\n        \n        //  summary section numbers seperated by comma \n        hrm.setSummaryCommaSeperatedNumbers(true);\n        \n        // show  row's index\n        hrm.isRowIndexVisible(true);\n        \n        //sql query to retrieve data rows\n        String sql = \"select fullname as 'Name', age as 'Age', salary as 'Salary'   from chamber limit 0,10\";\n        // set the query retrieving data from database\n        hrm.setSqlQuery(sql);\n        String[] fonts = {\"fonts/ArialBold.ttf\", \"fonts/MyOtherFont.ttf\"}; // path to fonts that you want embed in pdf document \n        String baseUri = \"the base uri\";\n        \n        return hrm.generatePDF(\"D:/mypdf.pdf\",fonts,baseUri);\n\n      \n\n    }\n}\n```\n\n\n\n\n#### Generate from list of objects ( for example : hibernate output )\n\n```java\nimport io.github.birddevelper.salmos.XmlReportMaker;\nimport io.github.birddevelper.salmos.setting.SummaryType;\nimport io.github.birddevelper.salmos.setting.XmlReportElementType;\nimport lombok.Getter;\nimport lombok.Setter;\n@Service\npublic class ReportService {\n\n    @Getter\n    @Setter\n    public class Student {\n        private String name;\n        private int age;\n        private Date birthDate;\n        private List\u003cString\u003e skills;\n        \n    }\n    \n    @AutoWired\n    StudentRepository studentRepository;\n\n    public String generateHTMLReport() {\n\n        \n        List\u003cStudent\u003e studentList = studentRepository.findAll();\n\n        \n        // Mapping the class fields to report columns (here we want only name and age, the reset of entity fields will be ignored)\n        Map\u003cString,String\u003e fieldMap = new HashMap\u003c\u003e();\n        fieldMap.put(\"name\", \"Full Name\");\n        fieldMap.put(\"age\", \"Age\");\n        \n        // buidling instance of ObjectFactory class\n        ObjectFactory objectFactory = new ObjectFactory();\n        \n        // setting mapping fields\n        objectFactory.setReportFields(fieldMap);\n        // setting entity lists\n        objectFactory.loadObjects(studentList);\n        \n        // building instance of HtmlReportMaker with ObjectFactory as input parameter\n        HtmlReportMaker htmlReportMaker = new HtmlReportMaker(objectFactory);\n        \n        // generate report\n        return htmlReportMaker.generate();\n    }\n}\n```\n\n\n\n\n\n\n[Read More at Medium.com ](https://medium.com/javarevisited/with-salmos-report-in-spring-boot-generate-reports-in-few-lines-of-code-b5212486b921)\n\n\n\n### Change Logs :\n\n2.1.1 :\n- Maven modelVersion changed to 4.0.0\n- builder pattern\n\n2.1.0 :\n- Embedded css style attribute for HTML report\n\n2.0.0 :\n- Generate reports from list of objects (for example: list of entities retrieved by hibernate)\n\n1.2.0 :\n- Export to PDF and TEXT files added. \n\n1.1.0 :\n\n- GeneralReportMaker class added.\n- Bugs fixed.\n\n1.0.0 : \n- First release.\n- Generate Reports from Sql Query\n- Generate HTML and XML reports\n\n\n\n[Salmos report](https://m-shaeri.ir/blog/with-salmos-report-generate-reports-in-any-format-you-need/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirddevelper%2Fsalmos-report-spring-boot-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbirddevelper%2Fsalmos-report-spring-boot-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbirddevelper%2Fsalmos-report-spring-boot-starter/lists"}