<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[programming - ]]></title><description><![CDATA[programming - ]]></description><link>https://app.mis.io/pub/</link><generator>Ghost 0.11</generator><lastBuildDate>Fri, 03 Apr 2026 18:31:02 GMT</lastBuildDate><atom:link href="https://app.mis.io/pub/tag/programming/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[MIS Cloud Fingerprinting Coming Soon!!!]]></title><description><![CDATA[<p><img src="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/08/gym_software_fingerprinting.png" alt="" fingerprint="" gym="" software="" cloud""=""></p>

<p>We are getting really close to beta releasing the fingerprint check in add on feature, which will allow for member front desk check in using their finger as their id.</p>

<p>Fingerprinting programming in a desktop application is very easy to accomplish, but fingerprinting in a web application is a real</p>]]></description><link>https://app.mis.io/pub/mis-cloud-fingerprinting-coming-soon/</link><guid isPermaLink="false">38ed1f18-0094-4d5b-b926-fbc437bc34fa</guid><category><![CDATA[programming]]></category><dc:creator><![CDATA[Admin]]></dc:creator><pubDate>Thu, 31 Aug 2017 23:36:10 GMT</pubDate><media:content url="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/08/gym_software_fingerprinting-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/08/gym_software_fingerprinting-1.png" alt="MIS Cloud Fingerprinting Coming Soon!!!"><p><img src="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/08/gym_software_fingerprinting.png" alt="MIS Cloud Fingerprinting Coming Soon!!!" fingerprint="" gym="" software="" cloud""=""></p>

<p>We are getting really close to beta releasing the fingerprint check in add on feature, which will allow for member front desk check in using their finger as their id.</p>

<p>Fingerprinting programming in a desktop application is very easy to accomplish, but fingerprinting in a web application is a real challenge due to the browser not allowing web sites to directly communicate with devices, which is required for capturing the finger image from the fingerprint scanner.</p>

<p>We are very excited to inform that we found a very efficient way to solve this browser limitation.</p>

<p>Let us know if you would be interested in adding fingerprinting capabilities to your business and we can give you more details about this and how you can get started. </p>

<p>Thanks</p>]]></content:encoded></item><item><title><![CDATA[How to create a jasper pdf report from a json datasource in Java?]]></title><description><![CDATA[<p>Today, I will be showing you how to easily create a jasper pdf report from a json datasource and how to pass parameters to jasper in Java. In this example, I will be reporting off the following simple small json array.</p>

<p><code>[
  {"name":"Jerry", "value":"Jesus"},
  {"name":"Gideon", "value": "Loves"},
  {"name"</code></p>]]></description><link>https://app.mis.io/pub/how-to-create-a-jasper-pdf-report-from-a-json-datasource-in-java/</link><guid isPermaLink="false">496d5cbe-fe0b-44a2-9493-90264f1f258f</guid><category><![CDATA[programming]]></category><dc:creator><![CDATA[Admin]]></dc:creator><pubDate>Tue, 30 May 2017 21:30:00 GMT</pubDate><content:encoded><![CDATA[<p>Today, I will be showing you how to easily create a jasper pdf report from a json datasource and how to pass parameters to jasper in Java. In this example, I will be reporting off the following simple small json array.</p>

<p><code>[
  {"name":"Jerry", "value":"Jesus"},
  {"name":"Gideon", "value": "Loves"},
  {"name":"Eva", "value": "You"}
]</code></p>

<p><strong>Setting Up Jasper Report In Jaspersoft Studio</strong></p>

<p>Open up Jaspersoft Studo Community and create a new blank report. On the left hand outline pane, add the following  </p>

<p><u><strong>Parameters</strong></u> <br>
title <br>
name <br>
value</p>

<p><u><strong>Fields</strong></u> <br>
name <br>
value <br>
<b><i style="font-size:14px; color:blue;">Note: Make sure you name these fields the exact same as your json fields</i></b>. </p>

<p>Now do the following. <br>
1. Drag the parameters to the title and/or column header bands <br>
2. Drag each field to the detail band.</p>

<p>Next, just click the build all toolbar button and jasper will compile your report. The compiled report will be named ending in .jasper.</p>

<p>In this example, I will be moving this compiled report to a directory called /home/jerry/ for simple demonstration. You can put this file anywhere your app has permission to read from.</p>

<p><strong>Setting up java environment for Jasper development using gradle build tool</strong></p>

<p>If you do not have gradle installed on your system, please install it now before you proceed. For instructions on installing gradle, go to <a href="https://gradle.org/">https://gradle.org/</a>. </p>

<p>The first thing we want to do is create the following directory structure. <br>
<img src="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/05/Screenshot-2017-05-30-16-02-24.png" alt=""></p>

<p>When this is done create a file called build.gradle under the root of your project and put the following code in it.</p>

<pre><code>apply plugin:'application'  
apply plugin: 'java'

repositories {  
    //tells gradle to look in maven for dependencies
    mavenCentral()
    //tells gradle to look for jasper artifacts in this repository
    maven {
        url 'http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/'
    }
}
//configuration when creating jar file
jar {  
  //main class of jar file
  manifest {
    attributes "Main-Class": "JasperPDFExample"
  }
  //excludes all signed files when gradle creates jar
  from({configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }}) {
    exclude "META-INF/*.SF"
    exclude "META-INF/*.DSA"
    exclude "META-INF/*.RSA"
  }
}
//external dependencies required for jasper
dependencies {  
  compile group: 'commons-codec', name: 'commons-codec', version: '1.9'
  compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2'
  compile group: 'org.apache.poi', name: 'poi', version: '3.10.1'
  compile group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.3.0'
}
//tells gradle the main class of your java application
mainClassName = 'JasperPDFExample'  
</code></pre>

<p>Once this is complete, create a file called <br>
JasperPDFExample.java file under the src/main/java/jasperpdfexample directory and put the following code in it. I went ahead and commented each line to explain what is happening.</p>

<pre><code>import net.sf.jasperreports.engine.export.JRHtmlExporterParameter;  
import net.sf.jasperreports.engine.export.JRXlsExporterParameter;  
import net.sf.jasperreports.engine.export.JRHtmlExporter;  
import net.sf.jasperreports.engine.export.JRXlsExporter;  
import net.sf.jasperreports.engine.data.JsonDataSource;  
import net.sf.jasperreports.engine.JRExporterParameter;  
import net.sf.jasperreports.engine.JasperExportManager;  
import net.sf.jasperreports.engine.JasperFillManager;  
import net.sf.jasperreports.engine.util.JRLoader;  
import net.sf.jasperreports.engine.JasperReport;  
import net.sf.jasperreports.engine.JRException;  
import net.sf.jasperreports.engine.JasperPrint;  
import org.apache.commons.codec.binary.Base64;  
import java.util.HashMap;  
import java.util.Locale;  
import java.util.ArrayList;  
import java.util.List;  
import java.util.Map;  
import java.io.*;

//Class Name. This must match the class name you put in your build.gradle file
public class JasperPDFExample {  
 public static void main(String[] args) {
  try {
   try {
    //Our json object. This can be loaded from file
    String rawJsonData = "[{\"name\":\"Jerry\", \"value\":\"Jesus\"},"
                       + "{\"name\":\"Gideon\", \"value\": \"Loves\"},"
                       + "{\"name\":\"Eva\", \"value\": \"You\"}"
                       + "]";
    //Load compiled jasper report that we created on first section.
    JasperReport report = (JasperReport) JRLoader.loadObject(new File("/home/jerry/Sample.jasper"));
    //Convert json string to byte array.
    ByteArrayInputStream jsonDataStream = new ByteArrayInputStream(rawJsonData.getBytes());
    //Create json datasource from json stream
    JsonDataSource ds = new JsonDataSource(jsonDataStream);
    //Create HashMap to add report parameters
    Map parameters = new HashMap();
    //Add title parameter. Make sure the key is same name as what you named the parameters in jasper report.
    parameters.put("title", "Jasper PDF Example");
    parameters.put("name", "Name");
    parameters.put("value", "Value");
    //Create Jasper Print object passing report, parameter json data source.
    JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, ds);
    //Export and save pdf to file
    JasperExportManager.exportReportToPdfFile(jasperPrint,"/home/jerry/jasperpdfexample.pdf");
   } catch (JRException ex) {
    ex.printStackTrace();
    throw new RuntimeException(ex);
   } catch (Exception ex) {
    ex.printStackTrace();
    throw new RuntimeException(ex);
   }
  } catch (Exception ex) {
   ex.printStackTrace();
   throw new RuntimeException(ex);
  }
 }
}
</code></pre>

<p>Once this is done, you are ready to tell gradle to run your app. Before doing this, your directory structure should look like this.</p>

<p><img src="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/05/Screenshot-2017-05-30-16-10-58.png" alt=""></p>

<p>From the root of your project, run the following command:</p>

<pre><code>gradle run  
</code></pre>

<p>Gradle will then build the app and run your main class and when completed successfully, the pdf should be created and saved to the location you set in code. Here is how the pdf should look.</p>

<p><img src="https://s3.amazonaws.com/mis.io.blog.prod.us/2017/05/Screenshot-from-2017-05-30-16-05-07.png" alt=""></p>

<p><strong>Conclusion</strong></p>

<p>Creating a jasper pdf report from a json datasource in java is pretty straightforward. I found the hardest thing to this is the setup of Jasper java dependencies. I hope this blog helps someone get over the hurdle of using jasper in their current or next project.</p>

<p>Happy Coding!!!</p>]]></content:encoded></item></channel></rss>