Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Apache Software

ActivePDF-like Reports w/ Apache? 63

Martin71a asks: "I have recently been tasked with managing our website. I come from a mainframe and VB background and have a team of 3 people to work with. Our manager is having us switch from IIS to an Apache web server later this year. In the more immediate future, I need a solution to distribute print to our customers through our website. Previously, we had developed our reports using HTML, but we need more professional looking reports with more basic printing functionality, such as paging, built in. We have been testing ActivePDF in which we develop the reports in Crystal then use ActivePDF to send [those reports] to a virtual PDF printer, which allows the user to view them. We like the solution because it doesn't require our customer to download anything, other than a PDF viewer. We've also experimented with Crystal Enterprise, although it was an older version that required either a Java plug-in, or ActiveX download. My concern is that AcitvePDF does not appear to be supported for an Apache server. Does any know of a similar solution that would be appropriate for an Apache server?"
This discussion has been archived. No new comments can be posted.

ActivePDF-like Reports w/ Apache?

Comments Filter:
  • PHP + PDF generation (Score:5, Informative)

    by DamienMcKenna ( 181101 ) <{moc.annek-cm} {ta} {neimad}> on Friday February 20, 2004 @02:32PM (#8341347)
    Use PHP for your report generation and use its PDFlib support to output the final result to a PDF file, which you then shuffle off to the user. Et voila!

    Damien
  • PHP + FPDF (Score:5, Informative)

    by octover ( 22078 ) on Friday February 20, 2004 @02:35PM (#8341377) Homepage
    http://www.fpdf.org/ [fpdf.org] it is a completely contained PDF system for PHP. I haven't used it a lot but I've heard it is a lot more sane to use than PDF Lib plus it doesn't require you to compile in the library.
    • Re:PHP + FPDF (Score:5, Informative)

      by tweder ( 22759 ) <stwede@gmai l . c om> on Friday February 20, 2004 @03:46PM (#8342339) Homepage
      I have used about every PDF library for PHP under the sun, so here's my $0.02.

      pdflib [pdflib.com] - SUCKS, the API is a pain in the ass. I liken it to doing your own dental work -- in the dark. You can circumvent this a little using the pc4p wrapper, but it's fickle.

      fpdf [fpdf.org] - It's pretty good, although it doesn't natively support any sane ways of dealing with text in tables - I was trying to use it to generate PDF invoices and quotations. It would barf and break columns when my text should wrap to the next line. The only way around this would be writing custom extensions to the class.

      r&os [ros.co.nz] - This is what I really recommend using. Like fpdf, it doesn't require any additional libraries to be installed - everything runs within PHP itself. The documentation is pretty good and I've really enjoyed using it.
      • Re:PHP + FPDF (Score:4, Informative)

        by Phil John ( 576633 ) <philNO@SPAMwebstarsltd.com> on Saturday February 21, 2004 @11:15PM (#8353473)
        I agree with the r&os idea, however, if you are going to be producing bajilions of pdf's dynamically you're going to want a beefy server. If, on the other hand, you are simply delivering xxx copies of the same PDF you can use PHP's output buffering and cache the whole thing:

        ob_start();
        -do pdf creation and output here-
        $pdfcontents=ob_get_contents();
        ob_end_clean();
        $fp=fopen("/path/to/pdf/file.pdf","w[b]");
        fwrite($pdfcontents);
        fclose($fp);

        You only need the b in the fopen if you are running php/apache on windows as a file needs to be explicitly binary on that platform.
  • try this (Score:3, Informative)

    by farmy4700 ( 719453 ) on Friday February 20, 2004 @02:35PM (#8341379)
    You might look into Stellent, we started using it here at my office and it works pretty good.
  • PHP (Score:3, Insightful)

    by duffbeer703 ( 177751 ) * on Friday February 20, 2004 @02:36PM (#8341389)
    With the outrageous cost of Crystal, you'll probaly find that even after training your people in PHP (which isn't a very difficult language IMHO) you'll have saved a bundle of money.
  • by toygeek ( 473120 ) on Friday February 20, 2004 @02:37PM (#8341403) Journal
    There are tons of Perl, PHP, and other packages out there for creating PDF files from some sort of input. I found everything you'd need here at http://sourceforge.net/search/ [sourceforge.net]. Just do a search for "PDF" like I did. I *know* you'll find something there. Sourceforge.net [sourceforge.net] and google.com [google.com] are your friends! Hope this helps!
  • Same Problem (Score:5, Informative)

    by justanyone ( 308934 ) on Friday February 20, 2004 @02:41PM (#8341444) Homepage Journal

    I work at a large bank. We had reports we needed to produce in PDF format with nice graphics. We tried many solutions including print-to-HTML from Excel [microsoft.com], Crystal Reports [crystaldecisions.com], Ephiphany [epiphany.com], and Insightful's S-Plus [splus.com].

    The best solution for a compact format was a scripted solution (VBA / COM) that prints XLS, DOC, PPT, etc. to a file with thus creating a postscript file, then using ghostscript to convert .ps to .pdf, then moving the files to a Solaris Apache webserver.

    S-Plus required lots of programming and display was not compact enough. Ephiphany likewise. Crystal has a HUGE HUGE IMMENSE VAST WAY-BIG Learning curve and still didn't do what we wanted. Alas.

    For all it's worth.
    -- Kevin J. Rice, justanyone.com
    • Crystal has a HUGE HUGE IMMENSE VAST WAY-BIG Learning curve

      It does?! I must be a genius since I picked it up after a couple days... ;-P

    • Crystal has a HUGE HUGE IMMENSE VAST WAY-BIG Learning curve

      Please tell me you're joking.

      *looks around*

      This has to be a troll, right? Right?

      Crystal, while limited, is not the trickiest piece of reporting software.
      • Re:Same Problem (Score:3, Informative)

        by justanyone ( 308934 )
        Sorry to give the idea that Crystal is this memorization-intensive product. Not the case. I just found it to be quite non-intuitive, and limited from doing exactly what we wanted it to do.

        One of my teammates who I believed to be rather bright (but didn't work with her that long) was constantly harping on how it didn't work the way she expected it to, either.

        One thing she worked for a week on was a gui control that didn't look like it could be changed. Turns out Crystal had a 1 YES ONE pixel down-arrow
        • Yeah, crystal is for simple stuff. Not what you were trying to do.
          For simple queries, I always thought it had a rather intuitive interface. In fact, I'm looking at setting up a web offering with their tool so users can go in and build quick and dirty reports.
          Heavy lifting will have to come inside, though. ;-)
        • My experience was exactly the same. Doing really simple canned reports, easy, 10 minutes tops. Doing anything at all that they didn't expect required jumping through absurd hoops and creating reports that on the design side looked like they should produce complete garbage.

  • I use FOP in a production environment. Look at Cocoon. Roll your own XSL solution. Build the reports in OpenOffice.

    Save yourself a few bucks.
    • You may want to consider XEP [xattic.com], as well. Its a commercial XSL-FO processor and is much less buggy than FOP. FOP is a great idea, but as of several months ago it wouldn't produce documents I would call "professional". XEP has most of the formatting objects requirements already implemented and seems to work quite well.
      • I build all the reports for a market-leading commercial product in FOP and have been doing so since v0.20.3. All FO properties are not completely supported in current FOP, but it is not *buggy*. I have had to do a little code to help it around keeps (only supported on fo:table-row) but that's why they call it eXtensible.

        Performance is very robust. We build 400 page documents and batch runs of short reports customized for thousands of data points.
    • We are also using FOP.

      You can get thouroughly anal about positioning, attributes, etc.

      We are using it to generate Product spec sheets, provide a more "polished" look to invoices, order status inquiries... all sorts of stuff.

      The really nice thing is that because it's java, you can start messing with it now, then have a pretty simple conversion when you upgrade to apache.

      John
    • Cocoon & FOP is definitely an option, at least for relatively simpler documents.
  • Apache FOP (Score:5, Informative)

    by mapMonkey ( 207912 ) on Friday February 20, 2004 @02:42PM (#8341462) Homepage
    Take a look at Apache FOP [apache.org], although your starting documents would have to be XML. The pros: buzzword compliant, and the project has a name similar to an old Soundgarden song!!
  • PDF, XML, Java (Score:3, Informative)

    by fredrikr ( 593719 ) on Friday February 20, 2004 @02:44PM (#8341494) Homepage
    Take a look at Big Faceless Report Generator [faceless.org]. The Big Faceless Report Generator is a Java component for converting XML to PDF documents. Using JSP, ASP or similar technology, you can now create dynamic PDF reports as quickly and easily as HTML.
    Built on our popular Java PDF library, the Report Writer adds functionality including:
    • HTML-style Tables - auto-sized nested tables with full control over padding, margins and borders
    • Use cascading CSS2 stylesheets to control look and feel
    • Create inline graphs and charts with XML, direct from the database
    • Includes a servlet and a servlet filter for simple generation of PDF's from XML or JSP pages.
    • Auto pagination of content with page headers and footers
    • Familiar HTML syntax - <a>, <ul>, <p>, <table>, <td> and so on - simpler and faster than FOP
    • All the features of our PDF library - Unicode support, Encryption, TrueType fonts, Barcodes and more
    • We've used it... it's decent, though 1200 bucks IIRC.

      A free version somewhat similar to this is Jasper Reports. The negative side is that documentation is severely lacking. (I'm seriously thinking of writing a book on it when this project is finished.)

      Since you did mention Java already, I presume you're already comfortable with it.

      found at http://jasperreports.sourceforge.net/
  • Free print-to-pdf (Score:5, Interesting)

    by smoon ( 16873 ) on Friday February 20, 2004 @02:54PM (#8341624) Homepage
    If Crystal is running the report, then just set up a samba box with printpdf (see this site [linux-sxs.org] for some more info.

    Works great. It's free. Infinitely configurable.
  • by ratboy666 ( 104074 ) <<moc.liamtoh> <ta> <legiew_derf>> on Friday February 20, 2004 @03:01PM (#8341702) Journal
    You don't indicate whether the PDF generation needs to be dynamic.

    In either case, Ghostscript will produce a PDF for you, from a PS (Postscript) data source. A fairly trivial transformation.

    This leaves "printing" to a Postscript printer, which Windows, Unix *and* Mainframe is capable of.

    I assume that since you have (somehow) "outgrown" HTML encoding and features, that you probably need somewhat more advanced formatting than most direct PDF generation libraries will (easily) provide.

    I also assume that you want to reduce furture maintainance. With these two goals in mind, the PS->PDF transformation is most reasonable, giving you the flexibility to choose how to "print" the PS.

    Ratboy.
  • FPDF (Score:4, Informative)

    by ben_degonzague ( 222715 ) on Friday February 20, 2004 @03:04PM (#8341734)
    I've been using this for the past year and its worked great. I use it with apache, php and mysql. A department has begun using it for their reports and is very happy.

    http://www.fpdf.org/
  • Apache FOP + IText (Score:1, Informative)

    by adamshelley ( 441935 )
    Apache FOP and IText are great solutions.
  • Even the oldest version of Crystal Enterprise (version 8 - before that the product was know as Crystal Info) doesn't need to use a Java or ActiveX plugin - it can output straight to HTML and DHTML - though it might not be the prettiest web pages you've ever seen.

    Saying that, Enterprise has never been anythng other than a complete pain to use and I would find it hard to recommend it to anyone.

    Tk
  • PHP+pdflatex (Score:3, Informative)

    by marind ( 12895 ) on Friday February 20, 2004 @03:19PM (#8341915)
    I use a combination of PHP and pdflatex for report generation. I don't think there is a solution that gets you more "professional looking" output.
  • JasperReports (Score:3, Interesting)

    by aoteoroa ( 596031 ) on Friday February 20, 2004 @03:24PM (#8341999)
    You could use Jasper Reports [sourceforge.net] to design and create reports based on any JDBC datasource.

    To work on your apache server you will need to install apache-tomcat. Of course if you have never programmed in Java you might be better off looking at one of the PHP solutions mentioned elsewhere.
  • CSS (Score:5, Informative)

    by TheTomcat ( 53158 ) on Friday February 20, 2004 @03:27PM (#8342045) Homepage
    Have you evaluated CSS for the output?

    It's possible to switch "media" (from screen to print), and do absolute layout, without a second library.

    No vector art, but for layout, it can be done.

    S
    • Re:CSS (Score:3, Interesting)

      by styrotech ( 136124 )
      And it's even possible to control print media page breaks in CSS. Browser support is very spotty, although gecko seems to support most of it fairly well.

      My company makes a web based project management tool, and we got fed up with using 3rd party reporting engines and now just use print media style sheets for printing reports.
      • by pacc ( 163090 )
        Unfortunatly supported CSS in the browser and the printer engine isn't the same thing, there are lots of bugs [incutio.com]. Progress on IE is practically discontinued, (don't expect microsoft to produce an XML-aware printing engine that can replace Office), and it's not an area where Mozilla advances very quickly either.

        However if you find a simple form that suits you and can manage users changing margins etc. it can do just fine. XHTML table headers could be a simple and effective way to get multi-page layouts.
  • by swillden ( 191260 ) * <shawn-ds@willden.org> on Friday February 20, 2004 @03:29PM (#8342090) Journal

    Another option that makes for flexible and interactive reports is to output a spreadsheet document rather than a PDF, complete with calculated fields and modifiable fields that allow the user to experiment with options (where appropriate). If you format them well, spreadsheets can print very nicely.

    You can generate documents in Microsoft Excel format using the Jakarta POI HSSF API [apache.org], and of course OpenOffice Calc files are just XML documents zipped up with a manifest, easy to produce with just about any toolset.

  • If you're willing to do your own page layout, the CPAN module PDF::API2 lets you create PDF from Perl in a cgi-bin.

    It's not Crystal Reports, by any means. It comes without all that baggage :-)

  • by Anonymous Coward
    Reportman.sourceforge.net

    I use this in production at the hospital where I work. The project is mature, full featured, and free. It can work basicly as a Free replcement for Crystal.
  • by raygundan ( 16760 ) on Friday February 20, 2004 @04:28PM (#8343004) Homepage
    I did something similar with the iText libraries [lowagie.com] for java. Generate PDF's to your heart's content-- place text and images into the page, flatten it, and *pop* out comes your document.
    • It's worth noting that many of the Java-based reporting packages use iText to create the resulting PDF. iText does not have a UI, though, but it is simple enough to code with.

      Our team uses iText directly, though we have investigated many of the Java-based reporting packages noted earlier by others. We found plain iText to be much more flexible in dealing with our documents. Lay the code out properly, and it's easy to extend your class to support customizations that your customers may require.
  • I used to work in the Health Care biz, and for all of our enterprise reporting (including reports sent out to customers as well as internal use) we used Actuate. http://www.actuate.com/

    The good: Actuate is a very robust, powerful report generating machine. It is relatively simple to get the basics, but some more of the advanced features and such might take some time to get. The real plus is that it natively generates DHTML, Excel, and PDF - and does a good job with each.

    The bad: This monster is written ar
  • mod_python and (Score:4, Informative)

    by Lomby ( 147071 ) <andrea&lombardoni,ch> on Friday February 20, 2004 @04:51PM (#8343270) Homepage
    If I understand your requirements correctly, you may want to investigate the use of Python (in the form of Apache's mod_python) along with the ReportLab [reportlab.com] tools.
    You can find a nice article detailing its usage here [ibm.com]
  • by Tom7 ( 102298 ) on Friday February 20, 2004 @05:20PM (#8343697) Homepage Journal
    The PDF spec is open, and fairly simple. I wrote my own PDF output code in less than a week, with the benefit that the PDFs were much smaller than those generated by general-purpose converters.
  • Python + Reportlab (Score:3, Informative)

    by Dr. Smeegee ( 41653 ) * on Friday February 20, 2004 @05:52PM (#8344170) Homepage Journal
    One could try ReportLab [ibm.com], a Python module that allows one to create nice-looking pdf output from a python script. If you have some programming experience python should be fairly easy to pick up IMHO.

    Your apache install probably already has python enabled for cgi. You might consider modpython, which adds the interpreter in for quicker load times.

    Share and Enjoy!

  • I had to do the same thing. I set up a windows server with adobe distiller and created a simple active x object on the box. Threw it into a web service and made it 'thread safe'. Distiller is not thread safe so you have to use semaphores to do a little locking while one pdf is being generated. Get a quick server and its no biggie. Then make your active X object a web service either using dot net or get jacob ( java com bridge => http://danadler.com/jacob/) and java. I used jacob.

    You now have a web

  • Take a look at ReportMill [reportmill.com]. I've used it in several projects to generate PDF reports and it's always come through like a champ. Not cheap, but worth every penny.

    --Paul
  • Take a look at Apache Cocoon [apache.org] . Here are samples [xml-dev.com] that are converted to PDF, on the fly, using Cocoon.
  • Make your reports in HTML format (shouldn't be hard), then use HTMLdoc to convert it to PDF. It's the most painless solution I know (no API to learn, no XML language to master, no complex installation to perform)
  • I wrote quite a bit of code to do Sodipodi SVG files as templates into PDF using FPDF.. Theres quite a long description on my blog [akbkhome.com] with Code [akbkhome.com] and example usage [akbkhome.com] and the svg files [akbkhome.com]

    The current code had chinese language support and some support for vector graphics (lines and boxes work perfectly ok)

What is research but a blind date with knowledge? -- Will Harvey

Working...