[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Migrating Away from Crystal Reports to Straight PHP

Posted on 2011-09-06
6
Medium Priority
?
410 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 111

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 400 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
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!

 
LVL 111

Accepted Solution

by:
Ray Paseur earned 1600 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 101

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

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

831 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