Printing

Whilst IJC is largely designed around being able to dynamically explore your data using the Form and Grid views, this information can also be printed. The printed representation of the information is often more restrictive than exploring your data in the form or grid view, for instance you can't use scroll bars in a printout.

Since the 15.10.5.0 release the user has to have the ROLE_EXPORT_DATA assigned to be able to control all types of export actions including also printing. This allows the administrator to improve the database security. The user roles are described here.

Printing the grid view

Printing a grid view provides a printed representation very similar to what is seen on screen. All the columns present in the grid view are squeezed onto the printed page. For this reason you may need to limit the number of columns that are present in the grid view to obtain a reasonable printout.

Page breaks are added between rows so that the contents are printed on multiple sheets.

Printing the form view

The form view is printed in a way that is as close as possible to the on screen representation of the form view. The form is scaled as best it can be to fit onto the printed page if it is too big. This may result in problems if significant scaling is involved, so in general you should design your form with the printed pages size in mind. You might want to have a specific form just for printing.

Form elements that use scrollbars, such as tables are problematical when printing. If your table in the form view has too many rows and has a vertical scrollbar then when you print that record you will not see all the records in the printout. When this happens the title of the table will be updated to indicate that only some records are present in the print out. The title will contain a message like this [4 of 20] to indicate that only four of the twenty rows are present in the printout.

Page Setup

The Page Setup item from the File menu lets you specify:

  • The page size e.g A4 or Letter

  • The page orientation: portrait or landscape

  • The size of the page margins

When the natural view size is bigger than the page size set in the 'Page Setup' menu, the view output is scaled to the area set in this menu, while the header and footer is not scaled.

How to print

IJC prints using the PDF document format. A PDF document is generated and then printed. This also allows a PDF document to be generated, rather than a paper printout.

To preview what would be printed before printing use the 'Print preview' option available from the File menu or from the main toolbar. To print directly use the 'Print' item from the File menu or the main toolbar. To print directly to a PDF file either use the 'Print to file' option from the File menu or use the print preview function and then save the generated PDF document.

All of these approaches will result in the print dialog opening.

Print dialog settings

Row selection tab

This lets you specify which records you want to print. These are the records in the current result set, so, for instance, you will only see the pages for the results of the current query. You can specify all records in the result set, the currently selected record, or a range of records to print (e.g. records 10-20).

images/download/attachments/48850790/printing.png

Header / Footer tab

This tab lets you define the page header and footer. A default header and footer is defined, but you can change the appearance of these. Elements can be added to the header and footer elements by placing the mouse cursor at the appropriate place and selecting an item from the 'Insert dynamic field' combo box. Elements can be deleted using the delete key. Plain text can also be entered. Since 15.8.24.0 version the user can define one custom image file that can be (re)used later in printing header / footer definition tab by selecting 'Custom image' option in the dynamic field drop down menu. The chosen file is stored in user's preferences.

images/download/attachments/48850790/printing2.png

N-up Printing tab

Form view supports printing of multiple records on a single page (N-Up printing tab is NOT present when you print a grid view or a form view where the only one MolMatrix widget is present).

This tab lets you specify how many records to print on each page. You do this by first specifying how many columns you want, and then how many rows. You can specify a fixed number of rows or choose the 'As many as fit' option to let IJC work it out for you.

images/download/attachments/48850790/printing3.png

Generating the printout or preview

Click the OK button and the print will be generated. If you chose to generate a print preview then the PDF document will be generated and displayed. If you chose to print directly the PDF document will not be displayed but will be printed directly.

Printing Asian Languages into PDF

Using default settings of Instant JChem it is not possible to print into pdf characters specific for asian languages such as japanese or chinese. In 15.12.7.0 version of Instant JChem we have introduced a new print.properties configuration file which can be found in the /instantjchem subdirectory of the installation. This file contains as default the following data.

# Contains configuration parameters of IJC printing.
# Complete reference: http://jasperreports.sourceforge.net/config.reference.html

net.sf.jasperreports.awt.ignore.missing.font=true

#net.sf.jasperreports.default.pdf.font.name=HeiseiKakuGo-W5
#net.sf.jasperreports.default.pdf.encoding=UniJIS-UCS2-H

By removing the # sings from the front of lines 7 and 8 the default font name and encoding is set to the one supporting japanese characters. To be able to print characters from other languages, the print.properties file has to be changed to contain the font and encoding relevant to the language of choice.

A simple overview of language and encoding suggestions is provided in the table below.


Language

Font name

Encoding

traditional chinese

MSungStd-Light

UniCNS-UCS2-H

simplified chinese

STSongStd-Light

UniGB-UCS2-H

korean

HYSMyeongJoStd-Medium

UniKS-UCS2-H

japanese

HeiseiKakuGo-W5

UniJIS-UCS2-H

It is possible to use command line parameters --pdfFontName and --pdfEncoding that can override corresponding parameters from configuration file print.properties . These can be also utilized in the Java Web Start distribution, by adding the argument into the relevant part of the *.jnlp file as in the example below.

<application-desc main-class="com.im.ijc.jnlpinstaller.Main">
	<argument>—pdfFontName=HeisekiKakuGo-W5</argument>
	<argument>—pdfEncoding=UniJIS-UCS2-H</argument>
</application-desc>