12 Replies Latest reply on Jul 3, 2008 2:30 AM by marcbc

    Flex project to auto-generate reports

    Solerous Level 1
      The requirements for the project I'm working on are to:

      1) Create a chart-based report definition
      2) Publish the definition to the database
      3) Auto generate the chart/report every X minutes/hours/days, etc as a pdf
      4) Notify users where to download the report

      So far, I've gotten the first part done so that the user can define the report. And, I think publishing to the database should be easy enough, however for the auto-generation, I was thinking of using flex with charting to draw the reports, but I'm a little fuzzy about generating the pdf and also about having the program auto-generate things. I have been using a simple servlet up to this point to communicate with the database (Oracle). However I was thinking of using BlazeDS since I've been reading about it.

      Does anyone have any experience with BlazeDS? Is it even necessary? Do you have any comments or suggestions about which technologies I should use to implement this solution?

      And as far as the PDF generation, I had looked into Alive PDF, but is there a better/easier solution?

      Thanks for any help you can offer!
        • 1. Re: Flex project to auto-generate reports
          Ratsnackbar Level 2
          If you have access to ColdFusion it has reporting and PDF generation built into it. It's actually quite easy to use and easily makes up for the expense if you do not already have a copy. With it you can make your PDF's interactive if you wish. It's also very easy to use with Flex.
          • 2. Re: Flex project to auto-generate reports
            Solerous Level 1
            Thanks for the ColdFusion idea. I wish we could use that, but I am restricted as to the server side of things and not able to use that technology on this project.

            Assuming I could find some solution for PDF generation, do you have any idea about the messaging side of things? I have tried out the test run for BlazeDS and they have a nice example of subscribing to a channel on the server for updates, but they do not explain how to publish data to the server. What technology should I use to get the same server-side app to receive new requests for publishing reports as well as pushing them out to the PDF creation application?


            • 3. Re: Flex project to auto-generate reports
              camfieldaj Level 1
              Not sure what platform you're working on or if that makes a difference, but I've done the auto generation to a pdf and email using perl and cron under Linux. Very easy. If you want I can get you some links to example code.
              • 4. Flex project to auto-generate reports
                Solerous Level 1
                I'm using Mac OS X. As for the pdf generation, I want to create the charts using flex and then generate a pdf of those images. I've used perl (a long time ago) and would consider it, but I don't know anything about cron. Do these work somehow with Flex?

                Also, doesn't LiveCycle somehow generate PDFs? Or is it only the Enterprise edition that does that?
                • 5. Re: Flex project to auto-generate reports
                  Ansury Level 3
                  Also might want to look into...

                  ClearBI

                  and

                  OracleBI Publisher
                  • 6. Re: Flex project to auto-generate reports
                    Ratsnackbar Level 2
                    Not that I would recommend this in most case's but if the PDF's do not need to be dynamic you could use something like PDF995 and send your page to it as a formatted print job. I had a client that wanted printouts from Filemaker in PDF so they could Email them to a list. Had to be automated so we just set up a print script in filemaker to print to a PDF converter. Don't think it was actually PDF995 and I do not remember what it was but I mention PDF995 because I use it at home. You just need something where the API allows you to specify the location to save too and the name of the file as part of the printjob. Send the files to a standard location on your server and trap the name of the file in a database. Bingo. Easy PDF's.

                    Of course the alternate option is to auto generate your chart as a web viewable formatted for print version. As it changes notify your users with an email link of where to view it and then let them print their own PDF using PDF995 or other such utilities if they want to.

                    And then get back to the Game of Half-Life2 Death Match going on in the server room.
                    • 7. Re: Flex project to auto-generate reports
                      marcbc Level 1
                      I'm facing a very similar problem...
                      I'd like to generate PDF reports including the same content I'm seeing in my flash movie generated using Flex (datagrids, charts,...). The option I tried was doing it using AlivePDF, but has no sense to generate this in the client to send the binary pdf data to the server to get the pdf file as response. In my environment does not work, because I can't do POST requests.

                      So definitely I've got to generate this in the server... There is no way to do it look like if it was done in the flex movie? Using this LiveCycle or something... otherwise, I suppose I must use another technology, like Jasper Reports for Java...

                      any suggestions?

                      thanks
                      • 8. Re: Flex project to auto-generate reports
                        Karl_Sigiscar_1971 Level 3

                        Blaze DS does not allow PDF generation (it has "only" Remote Objects and Flex Messaging).

                        LCDS does have PDF generation included.

                        Download the LCDS documentation on adobe.com and search for PDF in the lcds_dev_guide.pdf

                        Basically, what you do is that you create a Java remote object that uses a XFAHelper in order to generate a PDF file from the XML data sent by Flex and from the PDF template you create in LiveCycleDesigner (save either as Adobe XML Form .XDP or as Adobe Dynamic XML Form .PDF).

                        You could have a timer that fires a Cairngorm Event every 10 hours. The corresponding Cairngorm Command would call the Remote Object that generates the PDF.
                        • 9. Re: Flex project to auto-generate reports
                          marcbc Level 1
                          But even with this LiveCycleDesigner it isn't as easy to generate graphic charts or DataGrids as it is in Flex, in the client side, isn't it?
                          • 10. Re: Flex project to auto-generate reports
                            Ansury Level 3
                            I'm withdrawing my "look into" suggestion for ClearBI after being very disappointed with it's strict setup requirements... and seeming total lack of support, or a user base!

                            Oracle BI publisher still may be worth looking into, and I recently discovered that apparently Crystal Reports 2008 has some Flex/Flash integration features. Whether that translates also to PDF generation, I can't say, but it "looked" interesting.

                            Jasper (unless the version I saw was very old) was almost a nightmare getting exactly what you want, last time I spoke to someone using it.

                            LCDS is supposed to make PDFs, but if cost is an issue it might be out of reach unless Adobe changed their pricing when they released Flex 3.
                            • 11. Re: Flex project to auto-generate reports
                              Karl_Sigiscar_1971 Level 3

                              marcbc:

                              Adobe LiveCycle Designer is not on the server side. It is a tool, just like Adobe Illustrator. You use it to create PDF Forms. A form can either be filled manually or dynamically (by a server using XML data). With Flex, you can create a snapshot of a datagrid or chart, encode it in Base64 and send it along with other XML data to a remote object that generates the PDF document.

                              LiveCycle Data Services resides on the server side and hosts the remote object that generates the PDF (using the XFAHelper class).

                              • 12. Re: Flex project to auto-generate reports
                                marcbc Level 1
                                Thanks for clarifying Karl, that's not a valid solution for me then, I want to avoid generating the PDF view in the client and sending it to the server.

                                Thanks,