Skip to Content
avatar image
Former Member

how to print from iVews

Hi all,

How to generate & print iviews using Java .

Any report generation tools available?

Regards

Markandeya

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Feb 18, 2004 at 12:00 PM

    Hi

    There are no ready to use tools for this but there are some open source api´s out there to help you in getting this done. We actually implemented a pdf printing solution using one of these classes and it came out in a really nice way. That is I would think is the best bet for getting some nice printing options for iviews.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Dug up one of the documentations from this project. Maybe this can guide you to a solution. I know that you would probably want the whole thing, code and the documents but sorry.. not at this time.

      The design of the PDF generator was based on 4 main considerations

      • Centralizing the PDF functionality so that it can be accessed by multiple iViews using a simple interface and without duplication of code.

      • Use of existing open source PDF libraries to reduce coding effort

      • Easy implementing of future extensions

      These objectives were achieved by creating a portal service that implements the PDF functionality that can be used by any iView that requires it.

      The PDF Generator is implemented as a portal service. This means that once deployed, it can be accessed by any other portal component that requires a PDF capability. This allows the PDF code to be kept in one central location, instead of being replicated into each iview that needs it, reducing maintenance and efficiency problems.

      The core of the PDF Generator is the iText PDF library package (see http://www.lowagie.com/iText/). This package contains the classes that create the actual PDF elements. The portal component incorporates the iText.jar within it’s zar file.

      1) In the required jsp file insert a link to initiate the PDF routines eg.

      <hbj:link

      id="myLink"

      text="PDF document"

      onClick="LinkClick"

      target="_BLANK">

      <% myLink.setFontSize(LinkFontSize.STANDARD); %>

      </hbj:link>

      2) In the iViews profile file you need to add a reference to the PDFGenerator service

      ServicesReference=htmlb, jco, jcoclient, landscape, usermanagement, PDFGenerator

      ) Also in the profile you need to add an entry for the widths of the table columns

      eg PDFTableColumnSizes.value=6 7 8 8 23 8 8 8 8 8 8

      Each number represents the width in % of a table column. In the above case there are 11 columns.

      4) Add an onClick method into the main iview code

      The table column widths are read in from the property file. The other main factor is the referencing of the PDFGenerator service. This is the standard way of accessing services in the portal.

      The current default generator outputs a table, based on the contents an HTML TableModel object. If a more complex output format is needed a new generator class should be written.