Loading ...
Sorry, an error occurred while loading the content.

Re: Is this a job for XSLT/FO?

Expand Messages
  • Paul Furbacher
    ... Since your Web page is based on XML, you could render that XML on the server side, creating a PDF which could be downloaded to the client through the Web
    Message 1 of 1 , Jun 12, 2001
    • 0 Attachment
      Anne Goguen wrote:

      > ad-hoc reporting
      >
      > I have a dynamic report that is querying data from oracle and is
      > displaying
      > it on an XML based web page. There are some basic javascripts in the
      > code
      > that allow the user to sort the data after it is displayed.
      >
      > PROBLEM
      >
      > How can I get it to print. Here is one solution that I have tried and it
      > works. This copies the data on the screen
      > and allows you to paste it into either work or excel upon which you can
      > then
      > further manipulate it or print it. This solution works good but the
      > boss
      > wants it all in one button and not using any other client side programs.
      >
      > <input type='button' value='Send To Word'
      >
      > onClick="fnDoCopyWord();
      > <script language="Javascript">
      > function fnDoCopyWord(){
      > textRange=document.body.createTextRange();
      > textRange.moveToElementText(listTable);
      > textRange.execCommand("Copy");
      > window.open("c:\WordOutput.doc","printing");
      > }
      > </script>

      Since your Web page is based on XML, you could render that
      XML on the server side, creating a PDF which could be downloaded
      to the client through the Web page. I'm assuming that a servlet
      (or JSP?) handles the database -> XML and construction of the
      Web page you mention above -- is this not true?

      Have you thought about simply putting a button on that Web page
      which would post a request to your Web application to take the data,
      make a PDF of it, and stream that PDF back to the client? You
      would use FOP (http://xml.apache.org/fop) or one of the
      commercial packages (AntennaHouse or RenderX) to do the
      XML -> PDF rendering. Streaming a PDF back to the client
      is pretty straightforward -- the FOP examples show you how
      to do that.

      Of course, the client would have to print the PDF using Acrobat
      reader. Would the boss object to even that piece of client side
      software?


      Paul Furbacher
    Your message has been successfully submitted and would be delivered to recipients shortly.