Ruby-on-Rails
  Home arrow Ruby-on-Rails arrow Creating Reports on the Desktop
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
RUBY-ON-RAILS

Creating Reports on the Desktop
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2010-03-23

    Table of Contents:
  • Creating Reports on the Desktop
  • Generating an Excel Spreadsheet
  • Creating a Spreadsheet Report
  • Dissecting the Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating Reports on the Desktop


    (Page 1 of 4 )

    You may know how create a report in Ruby using the Active Record, but that's only half the battle. Reports aren't any good if the users they're intended for can't read them. This article will explain how to adjust reports so that they're more user-friendly to their intended audience. It is excerpted from chapter four of the book Practical Reporting with Ruby and Rails, written by David Berube (Apress; ISBN: 1590599330).

    In the previous chapters, you've learned about creating reports using Active Record. However, its not enough to simply create a report; you need to place the report in a context where it will be useful. Often, this means making the report accessible on the users' desktop in a format that's familiar to them. You can accomplish this in a number of ways, as you'll learn in this chapter.

    Choosing a Desktop Format

    One powerful way to deliver reports to your users is to create a stand-alone graphical user interface (GUI) application that they can run on their desktop. This application can blend in with native applications written in other languages, so it will be familiar to the users. Furthermore, it won't be subject to the security restrictions that apply to web applications, so it can even control other applications-launching them and so forth.

    Of course, deploying desktop applications isn't an option for some applications. Many Ruby developers are restricted to deploying web applications only. If that's true for you, you'll need an alternate approach.

    One alternative is to offer the users the ability to download a file that can be opened in a desktop application. A common example is a Microsoft Excel file, which is familiar to many businesspeople. This is a useful approach, since many office workers have been trained to do simple calculations on Excel spreadsheets. (Of course, Microsoft Excel files can be opened in OpenOffice.org as well, so it's something of a spreadsheet lingua franca.)


    Note  Currently, there aren't any open source solutions for creating Microsoft Word or PowerPoint documents; Microsoft's proprietary format can make interoperability difficult. Additionally, Word and PowerPoint are commonly used for presentation purposes, and they can often be supplanted by HTML and PDF versions. You've already done several HTML examples. Chapters 6, 8, and 10 have examples of PDF output.


    In this chapter, you'll create a formatted spreadsheet for the end user, and then you'll see how to create a fully functional GUI application.  


     CONTROLLING QUICKTIME WITH A DESKTOP APPLICATION

    An example of a useful desktop  application is one that I created for  The Casting Frontier, a digital casting
    services firm. This application uses  FXRuby and the RubyOSA (rbosa) AppleScript library to control QuickTime Pro on Mac OS X.

    The program automates the process of
    storing national commercial auditions online. Before this solution, the
    camera operators, who videotaped the  auditions, needed to manually export  each movie to a file, manually export  the first frame of a movie as a  thumbnail, make sure both files were  named according to a convention, and  then manually upload the file through  FTP. (They also had a system to associate an actor’s digital profile with a movie; if the  users wanted to use this, the process became even  more complicated.)

    Using the new application, the users  simply entered the actor’s information,
    clicked Start, clicked Stop, and then
    clicked Upload. This sped up the  process considerably.

    If the solution were a web application, it would have been impossible to control QuickTime in order to export  the movies and thumbnails. The camera
    operators would have needed to do it by hand, which would slow them down  and cost money. The solution also reduced errors, since it ensured that all of the  movie files and thumbnail  files were correctly named  and  labeled. In fact, the time factor was very significant. Auditions are held in rented rooms, which cost extra if  auditions run overtime. Also, if actors wait longer than a certain time, the casting director holding the audition  must pay a large fee to the actors' union.


    Exporting Data to Spreadsheets

    Generally, clients love spreadsheets. Often, they don't have the expertise to manipulate data using SQL or a programming language like Ruby, but they do know how to perform calculations and analyze data using Microsoft Excel or a similar tool. If their data is directly delivered in their format of choice, they can skip a step and save time. (In fact, some less computer-savvy users may not realize that they can copy and paste data from a web page, so exporting to an Excel-compatible format may enable them to act on data in ways they could not before.)

    More Ruby-on-Rails Articles
    More By Apress Publishing


     

    RUBY-ON-RAILS ARTICLES

    - Application Deployment with Capistrano
    - Deploying an Application to the Server
    - Secure Application Deployment with Ruby on R...
    - Installing the Database for Application Depl...
    - Application Deployment
    - Recording Acceptance Tests
    - Commands for Acceptance Testing
    - Acceptance Testing
    - Checkout and Order Processing: the User Side
    - Checkout and Order Processing: the Administr...
    - Online Order Processing: Using PayPal
    - Order and Payment Handling for an Ecommerce ...
    - Checkout and Order Processing for an Ecommer...
    - Getting Text and Currency Working for Multip...
    - Translating a Site for Multiple Language Sup...





     


     


    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 11 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek