Report CODING with pure Servoy/Javascript

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Report CODING with pure Servoy/Javascript

Postby lgormley » Sun Feb 17, 2013 7:04 pm

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)?
lgormley
 
Posts: 13
Joined: Tue Jun 28, 2011 8:02 pm

Re: Report CODING with pure Servoy/Javascript

Postby goldcougar » Mon Feb 18, 2013 1:25 am

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.
Scott Butler
iTech Professionals, Inc.
SAN Partner

Servoy Consulting & Development
Servoy University- Training Videos
Servoy Components- Plugins, Beans, and Web Components
Servoy Guy- Tips & Resources
ServoyForge- Open Source Components
User avatar
goldcougar
Servoy Expert
 
Posts: 665
Joined: Sun Jan 08, 2006 7:15 am
Location: Cincinnati, OH

Re: Report CODING with pure Servoy/Javascript

Postby robwormald » Mon Feb 18, 2013 10:11 pm

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.
robwormald
 
Posts: 20
Joined: Sun Feb 13, 2011 7:55 am

Re: Report CODING with pure Servoy/Javascript

Postby ptalbot » Mon Feb 18, 2013 10:32 pm

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
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
http://www.servoy-stuff.net
https://www.servoyforge.net
--------------------------------------------
Servoy 5.2.16 / 6.0.9 / 6.1.6 / 7.3.1
All OSes / Java 5 & 6 & 7
User avatar
ptalbot
 
Posts: 1612
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Report CODING with pure Servoy/Javascript

Postby AlanBourke » Tue Feb 19, 2013 10:43 am

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.
-------------------------------------------------------------------------------------------
Servoy SAN Developer
User avatar
AlanBourke
 
Posts: 198
Joined: Tue Aug 02, 2011 3:32 pm
Location: Dublin, Ireland


Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron