2 Replies Latest reply on Mar 11, 2010 10:11 PM by kblief.kblief.gmail.com

    PDF rendering

    saratkumarm

      I used Itext examples and PDF generation work prefectly .



      But I have requirement below requirement
      when user clicks search button in portal, below tasks should be done at same time
      a) display the results in UI
      and b) export the search results in PDF .


      so here is how I am doing


      public List searchMaster(SearchVO searchVO) {
      ...
      ....
      ...
      list = entityManager.createQuery( ....) ;
      Renderer.instance().render(/pdf/pdf.xhtml);
      return list;
      }


      I am using the list result to show in the UI .
      but the problem is I am unable to render the pdftemplate (pdf.xhtml) .
      Please suggest , how can I render the PDF ?


      Thanks,
      S

        • 1. Re: PDF rendering
          saratkumarm

          can anyone help me !!!
          Its really urgent

          • 2. Re: PDF rendering
            kblief.kblief.gmail.com

            If I understand correctly you need 1 button to do 2 tasks. You could use an a4j:commandButton with a a4j:jsFunction.


            <a4j:commandButton value="Some Task" 
                action="#{backingBean.displayResultsInUi}"
                oncomplete="exportPDF();"
                reRender="uiSection">
            
                <a4j:jsFunction action=#{backingBean.exportPdf} name="exportPDF" />
            
            </a4j:commandButton>
            



            I don't know if this is what you are looking for, but it may work.