Page 1 of 1

Report CODING with pure Servoy/Javascript

PostPosted: Sun Feb 17, 2013 7:04 pm
by lgormley
I have evaluated every development environment I could get my hands on for years and Servoy has generally beat them all. You probably know this but there is one glaring weakness which is reporting. I am very pleased with Servoy except for ease of reporting. I am successfully reporting using line-by-line coding of HTML as in the CRM example solution but there is no example for reports with a chart, graph, or even a picture. My question is "Can someone please furnish me code for each of (chart, graph, and picture)?

Re: Report CODING with pure Servoy/Javascript

PostPosted: Mon Feb 18, 2013 1:25 am
by sbutler
There are several reporting options for Servoy....

1. Built-in. You can build Servoy Forms using Title Headers, Headers, Footers, Summary, etc and build a report. This model's the FileMaker Pro way of doing thing if you are familiar with that.
Simple example here: http://omar4.dotnet35.hostbasket.com/se ... imple.aspx

2. Manual. You can of course retrieve the data on your own, and write data our in HTML, Excel, or PDF. This is old school and should generally not be done.

3. Jasper Reports. This is really the standard for reporting in Servoy and is now the vast majority of users do it. You can use a visual iReport design tool which will connect to your data via raw SQL, FoundSets, or DataSets, and can pass parameters into the report.
See:
Videos: http://www.servoy.com/reposition/generi ... omy_id=727
Jasper Plugin / WIki / Docs: https://www.servoyforge.net/projects/se ... perreports

4. Velocity Reports. This is an open source plugin using the Velocity Engine. Reports are built in XHTML using special templating functions
https://www.servoyforge.net/projects/velocity-report

5. Any other SQL Tool! Since Servoy connects to a SQL Database, you can use other tools and call them, like SQL Server Reporting Services, Crystal Reports, etc.


For my personal choices, I use Jasper most of the time. I'll use Velocity when I want a quick report to print our something like a datagrid because it has nice tools to dynamically build reports. You can also do that in Jasper with DynamicJasper, but it gets more complicated.

Re: Report CODING with pure Servoy/Javascript

PostPosted: Mon Feb 18, 2013 10:11 pm
by robwormald
My 2c -

If you're comfortable in HTML/CSS, VelocityReport is pretty unbeatable. I've got pretty limited HTML experience and I find Velocity to be super easy to use :
Code: Select all
//report template
<html lang="en">
  <head>
   <link href="../innit_app/assets/css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
   </head>
   <body>
     <div class="container">
   <h3>$reportHeader</h3>
   <table class="table table-bordered table-condensed"> 
       <thead> 
           <tr> 
               <th>OpCode</th> 
               <th>Hours</th> 
               <th>Rate</th> 
               <th>Total</th> 
           </tr> 
      </thead> 
        <tbody> 
        #foreach ($employee in $EmployeeFS)   
   <tr> 
      <td>$employee.op_code</td> 
      <td>$employee.hours</td> 
      <td>$employee.rate</td> 
      <td>$employee.calc_total</td> 
   </tr> 
   #end
   </tbody> 
   </table> 
   </div> <!-- /container -->
   </body>
</html>


Code: Select all
//servoy side

//create the data object ("context object")

var context = {}

//add some data

context.reportHeader = 'Sample Report Header'

var employeeFoundset = databaseManager.getFoundset('data','employee')
employeeFoundset.loadRecords()
context.EmployeeFS = employeeFoundset

plugins.VelocityReport.previewReport('template.html',context)


Pretty awesome and very simple IMHO.

I've also started playing with d3.js for much more complex rendering, but that's a whole different ballgame.

Re: Report CODING with pure Servoy/Javascript

PostPosted: Mon Feb 18, 2013 10:32 pm
by ptalbot
lgormley wrote:My question is "Can someone please furnish me code for each of (chart, graph, and picture)?

Download VelocityReport from ServoyForge https://www.servoyforge.net/projects/velocity-report, it comes with an example of report with many tables, charts, images, barcodes and a flexible layout.
Have a look at the wiki, there's lots of information out there: https://www.servoyforge.net/projects/velocity-report/wiki

Re: Report CODING with pure Servoy/Javascript

PostPosted: Tue Feb 19, 2013 10:43 am
by AlanBourke
This is unfortunately true of all the current solutions out there that aim to provide a more high-level development environment - Servoy, Lianja, Lightswitch, you name it. We were certainly spoiled in the Visual FoxPro world in terms of strong, built-in reporting tools. Reporting always seems to be left to third party providers like JasperSoft, which is generally fine except it's another stack of dependencies, gotchas and complications.