Solved

Migrating Away from Crystal Reports to Straight PHP

Posted on 2011-09-06
6
403 Views
Last Modified: 2012-05-12
I have interesting idea for a customer who uses Crystal Reports to run their invoices and certification letters on their Intranet.  

It is setup to pull data from a MySQL database, show the result in the web browser which they then click EXPORT then choose PDF and export it.  

My idea is to use fPDF (or something similar) to create the same report, PHP pulling in the data from the database and organizing it, then instantly making a PDF file with the file's default name (that they normally have to type in).  

Is there anything that Crystal Reports does that I could not simulate in PHP?
0
Comment
Question by:hydrazi
6 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 36489870
anything that Crystal Reports does...
That "anything" part covers a lot of ground.  But in my experience you can do a lot with FPDF.  It's time-consuming to set it up the first time, but once it's working, it is lightning fast and accurate in placement to about 1/100 inch.

Is there anything in particular that you are concerned about?
0
 
LVL 19

Expert Comment

by:GJParker
ID: 36495549
Why not use the development tools available with CR to automate the process with an ASP page
0
 
LVL 1

Assisted Solution

by:gimecoffee
gimecoffee earned 100 total points
ID: 36496516
anything that Crystal Reports does...
I've been working with PHP and MySQL for 14+ years and Crystal reports for almost 2.  There is nothing you can do in Crystal that can't be duplicated with PHP, SQL queries and FPDF if you've already got a web application running PHP.  Like Ray mentioned it is a little more time consuming to setup the layout in FPDF but I've found that pulling and organizing data with MySQL and PHP is a much easier and faster.  Could be because I've have a lot more experience with PHP than I do with Crystal but my data tends to be more complex to pull together (payroll services.)  I still write CR for staff that already have direct access to running CR reports but for everyone else I use PHP.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 109

Accepted Solution

by:
Ray Paseur earned 400 total points
ID: 36496735
In case you're interested here is the "hello world" exercise in FPDF.
http://www.laprbass.com/RAY_fpdf_hello_world.php

<?php // RAY_fpdf_hello_world.php
error_reporting(E_ALL);

// BRING IN THE PDF THING
require_once('fpdf16/fpdf.php');



// DEMONSTRATE THE BASICS OF FPDF



// SYNTHESIZE THE PDF FILE INFORMATION
$pdf_file_link = '/RAY_junk/' . 'temp_pdf_blue' . '.pdf';
$pdf_file_name = getcwd()     . $pdf_file_link;

// DO THE HELLO WORLD EXERCISE IN WHITE ON A BLUE BACKGROUND
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
$pdf->SetFillColor(  0,   0, 255);
$pdf->SetTextColor(255, 255, 255);
$pdf->Cell(40, 10, 'Hello World!', 0, 2, 'L', TRUE);

// WRITE THE PDF TO DISK
$pdf->Output($pdf_file_name, 'F');

// PRESENT A LINK
echo '<a target="my_PDF" href="' . $pdf_file_link . '">Blue PDF</a>';



// START OVER FOR A NEW PDF
unset($pdf);
echo PHP_EOL . "<br/>";

// SYNTHESIZE THE PDF FILE INFORMATION
$pdf_file_link = '/RAY_junk/' . 'temp_pdf_red' . '.pdf';
$pdf_file_name = getcwd()     . $pdf_file_link;

// DO THE HELLO WORLD EXERCISE IN WHITE ON A RED BACKGROUND
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial', 'B', 16);
$pdf->SetFillColor(255,   0,   0);
$pdf->SetTextColor(255, 255, 255);
$pdf->Cell(40, 10, 'Hello World!', 0, 2, 'L', TRUE);

// WRITE THE PDF TO DISK
$pdf->Output($pdf_file_name, 'F');

// PRESENT A LINK
echo '<a target="my_PDF" href="' . $pdf_file_link . '">Red PDF</a>';

Open in new window

0
 
LVL 100

Expert Comment

by:mlmcc
ID: 36496998
What is the concern or reason for migrating away from Crystal and not to another reporting tool?

If it is the user interaction, there is no need to have them display the report then export it.  With Crystal you can export directly to PDF then view the PDF.

Have you considered the effort involved in changing horses at this point?

mlmcc
0
 

Author Comment

by:hydrazi
ID: 36519024
I think changing horses at this point is just what we want to do.  We are looking for faster, lower-overhead reports that go directly to PDF.  Crystal Reports is becoming an increasing expense and I do not think we need all the power it comes with.  

Sorry for the "anything crystal reports does" line.  Much too vague.  Still, the answers here are extremely helpful in that I am now convinced after much playing around with the above suggestions, that we are going to start our migration away from Crystal Reports.

Many thanks!
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question