Solved

Migrating Away from Crystal Reports to Straight PHP

Posted on 2011-09-06
6
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 110

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 110

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

730 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