i-net Clear Reports

Export FAQ

Does i-net Clear Reports support the export feature?

Yes, i-net Clear Reports supports the export in multiple file formats, e.g.: PDF, RTF, HTML, … (see Supported Output Formats). You can start the export either with the button in the Java Client, via the API of the Java Client or via the Engine API without a preview in the Java Client.

For more information about this please refer to the API documentation. The Java code samples can be installed using the i-net Clear Reports setup that you can download from i-net software's website.

Which export formats are supported?

You can find the list of the supported output formats in the documentation.

Does i-net Clear Reports support the .xls, .pdf, .doc, etc. format?

Yes, it is possible to export a report to the .xls, .pdf, .doc format. In the documentation you can find the complete list of the supported export formats.

With Microsoft Word you can import *.rtf documents.

Restrictions of the CSV export and/or the CSV viewer (init=csv)

Feature Supported Comments
Field objects Yes  
Text objects Yes  
Graphics - and Blob objects No  
Crosstab objects No  
Sub-Reports No  
Lines- and rectangle objects No  
Overlapping objects No Restriction of the CSV file format
Refresh report (refresh button) Yes Property “ReloadOnNewRequest” need to be true: Cache Properties.
Export in a single file Yes  
Hyperlinks No  
Drill Down No  
Mailing Label No  

Restrictions of the HTML export and/or the HTML viewer (init)

The HTML export currently only supports the HTML 3 format.

Feature Supported Comments
Field objects Yes  
Text objects Yes  
Graphics-, blob- and diagram- objects Yes as JPEG images
Crosstab objects Yes (with table width <page)
Sub-Reports Yes  
Vertical lines- and rectangle objects No Restriction of the HTML 3 file format. HTML 4 format will be supported in future version.
Overlapping objects No Restriction of the HTML 3 file format.
HTML 4 format will be supported in future version.
Refresh report (refresh button) Yes Property “ReloadOnNewRequest” need to be true: Cache Properties.
Export in a single file Yes Supported since version 5.2.
With the property “layout” it is possible to set the format of the HTML export. The following value are possible:
- single: complete report in one HTML file with one Page Header and one Page Footer
- concat: complete report in one HTML file with Page Header and Page Footer per report page
- property not specified (default): single HTML file for each report page.
Hyperlinks Yes  
Drill Down No  
Mailing Label Yes  

Restrictions of the PDF export and/or the PDF viewer (init=pdf)

Feature Supported Comments
Field objects Yes  
Text objects Yes  
Graphics- and Blob objects Yes as JPEG images
Crosstab objects Yes (with table width <page)
Sub-Reports Yes  
Lines- and rectangle objects Yes  
Overlapping objects Yes z-order: boxes, lines, other elements
Refresh report (refresh button) Yes Property “ReloadOnNewRequest” need to be true: Cache Properties.
Export in a single file Yes  
Hyperlinks Yes  
Drill Down Yes
Mailing Label Yes  

Restrictions of the RTF export and/or the RTF viewer (init=rtf)

Feature Supported Comments
Field objects Yes  
Text objects Yes  
Graphics- and Blob objects Yes as JPEG images
Crosstab objects Yes (with table width < page)
Sub-Reports Yes  
Lines- and rectangle objects Yes  
Overlapping objects Yes z-order: boxes, lines, other elements
Refresh report (refresh button) Yes Property “ReloadOnNewRequest” need to be true: Cache Properties.
Export in a single file Yes
Hyperlinks Yes
Drill Down No  
Mailing Label Yes  

Restrictions of the XLS export and/or the XLS viewer (init=xls)

Feature Supported Comments
Field objects Yes  
Text objects Yes  
Graphics- and Blob objects Yes Supported since version 8.0
Crosstab objects Yes Supported since version 6.0
Sub-Reports Yes  
Lines- and rectangle objects Yes Supported since version 7.0
Overlapping objects No Restriction of the XLS file format
Refresh report (refresh button) Yes Property “ReloadOnNewRequest” need to be true: Cache Properties.
Export in a single file Yes  
Hyperlinks No  
Drill Down No  
Mailing Label Yes  

PDF export: Is it possible to embed fonts in the pdf file?

Yes, it is possible to embed ttf fonts in the exported pdf file.
To do you need to:

  • Create a font directory, e.g.: “C:/ClearReports/fonts”.
  • Set this font directory in the property “fontpath”. You can do this either with the Configuration Manager (double click on ClearReports.jar) or in file crystalclear.properties directly.
  • Copy the .TTF and/or .TTC files for the used fonts in this font directory.
  • Restart i-net Clear Reports and export your report to PDF.

XLS Export: Which Excel versions are supported?

The i-net Clear Reports XLS export supports MS Excel version 97 (or higher).

Is the export supported in the Engine, or do i have to be using the client (Java viewer) to get this functionality?

You can use all supported export formats on the:

  • Client with a Java viewer
    You can use the export button in the viewer or the viewer API to export a report on the client.
  • Client without a Java viewer (init parameter in the report URL, e.g.: …&init=xls).
    In this case i-net Clear Reports (listener or Servlet) returns the rendered report to the client in the requested format.
  • Server without a Java viewer
    You can use the Engine API to export the reports on the server without preview (e.g. to XLS):
    …
    Engine eng = new Engine(Engine.EXPORT_XLS);
    eng.setReportFile( "file:C:/report/MySample.rpt" );
    …
    eng.execute();
    File exportedFile = new File("c:/sample.xls");
    FileOutputStream fos = new FileOutputStream(exportedFile);
    for(int i=1;i<=eng.getPageCount();i++) {
    	fos.write(eng.getPageData(i));
    }
    fos.close();

    This code works for all export formats except the HTML format. The export to HTML produces an HTML file for each report page and an image file for each image in the report. The format of the byte array that is returned by getPageData is the following:

    size of the file name
    file name
    size of the file content
    file content
    size of the file name
    file name
    size of the file content
    file content
    …

    The sample “Export_without_Viewer_to_HTML.java” demonstrates how you can export to HTML on the server without preview.

How can i use PDF export?

After you have created a report template with the i-net Designer you can export this report:

  1. With Java viewer:
    • using export button of the Java viewer (Java viewer in the browser or in the Result tab of the i-net Designer).
    • using API of the Java viewer (you can find the complete Java code sample “Export_with_Viewer.java” in the directory “samples/export” of the i-net Clear Reports documentation):
      // Initialize the viewer, add a report view connected to the URL of a report.
      URLRenderData renderData = new URLRenderData("http://<ServerName>:9000/?report=file:C:/samples/sample.rpt");
      SwingReportViewer viewer = new SwingReportViewer();
      ReportView view = viewer.addNewReportView(renderData);
       
      // Export report to desired file 
      view.export(ReportView.EXPORT_PDF, "C:/myExports/sample.pdf");
  2. Without Java viewer (using Acrobat Reader on the client as report viewer)
    • init parameter in the report URL (e.g. init=pdf); in this case i-net Clear Reports returns the pdf document to the client instead of the Java viewer, e.g.: http://ServerName:9000/?file:c:/sample.rpt&init=pdf
    • using API of i-net Clear Reports without preview on the screen (you can find the complete Java code sample “Export_without_Viewer.java” in the directory “samples/export” of the i-net Clear Reports documentation)
      Engine eng = new Engine(Engine.EXPORT_PDF); // Set the export format e.g. pdf
      eng.setReportFile( "file:C:/MyReports/Sample.rpt" );
       
      // Set values for needed parameters
      //eng.setDll("....dll");
      //eng.setHost("...");
      //eng.setPrompt("...",0);
       
      eng.execute();
      File pdfFile = new File("C:/MyExports/Sample.pdf");
      FileOutputStream fos = new FileOutputStream(pdfFile);
      for(int i=1;i<=eng.getPageCount();i++){
      	fos.write(eng.getPageData(i));
      }
      fos.close();

You can find the complete sample “Export_without_Viewer.java” in the directory “sample\export” that is part of the i-net Clear Reports documentation.

I have 2 or more reports and I want to merge them as a single rtf document. How can I do it with Clear Reports.

We assume that you have requested two or more input streams (see java's urlConnection.getInputStream()) by sending the following URL:

http://<server>:port/?report=<reportname>&init=rtf

If stream1 corresponds to the first rtf file and stream2 to the second, then the last byte of stream1 must be deleted, byte string ”/page” must be attached to stream1 and finally stream2 without the first byte must be attached.

How do I sort columns in the excel sheet that i-net Clear Reports has generated?

If you receive the error: “This operation requires the merged cells to be identically sized.”, then you must split the cells first.

Please mark all cells (with ^A) and then:

  • In Open Office: format → merge cells → remove
  • In Gnumeric: click on toolbar “split merged cells”
  • In MS-Office: cells, format, merge: uncheck the box

After that you can sort the columns.

Should I use postscript level 1, 2 or 3?

The i-net Clear Reports postscript export supports postscript levels 1, 2 and 3. In general the PS level 1 export creates larger documents but is very fast. Postscript level 2 export is slower but can be previewed with ghostview for example because it contains proper DSC comments. Postscript level 3 is like postscript level 2 but embeds the TTF fonts used by the document into the document itself.

Level 1 Level 2 Level 3 (supported since version 5.1)
Streaming possible yes no no
Page preview in ghostview no
(page n of m - DSC comment is missing because streaming)
yes yes
TTF font embedding no no yes
Report generation fast slow
(because page n of m - DSC comment used)
slow
(because page n of m - DSC comment used)

How do I view CSV in my browser (how do I set the mime type)?

Assuming that your application to view CSV responds to application/MyApp and you want to view CSV in your application, please create a checkProperties() method:

public void checkProperties (Properties props, Object servletRequest) {
	if(props.getProperty("content").equals("text/x-comma-separated-values") {
		props.put("content", "application/MyApp");
	}
}

After that your application MyApp starts and reads CSV whenever you type init=csv.

PDF export: Problems with quotation marks in the report URL with Internet Explorer.

If you use quotation marks in the report URL (e.g. for multiple value string prompt fields) and you use the Internet Explorer to display the exported .pdf file directly with init=pdf then you will get a corrupt pdf file that cannot be displayed in the Adobe Acrobat Reader 6 plug-in.

Solution:

  1.  Use encoded quotation marks in the report URL, e.g.: use …&prompt0=[%22promptValue%22]&… instead of …&prompt0=['promptValue']&… or
  2. Use the Adobe Reader 7.0 (or higher). This version of the Adobe Reader does not have this bug.

i-net software strives to provide accurate product documentation. Please give us your feedback using the form below.
NOTE: This form is for documentation feedback only. For technical assistance, please send an email to clearreports@inetsoftware.de.

 

© Copyright 1996 - 2012, i-net software; All Rights Reserved.