Import Tag

The Import tag is generally only used for workaround purposes. If you have an image that is smaller than the width of the page, you may need to use the Import tag to include the image in your generated document. When you use an Import tag for this purpsoe, set the Source to File.

To view more examples and tutorials, see the Import Tag Tutorial.

Limitations

There are several limitations when you import an RTF or WordML file, because there can only be one final document (your resulting report). All header information in the imported file is ignored, including the default language, font, style, page size, margins, headers and footers. However, section breaks and their settings are imported into the final document.

All styles will map over by name. Identical style names are not checked for, and if they occur, there is no check to see if they have identical settings. The settings used will be those of the parent template, which is the template you are importing files into.

Fonts and colors map to the resulting document using existing entries from the parent document, if they exist, and adding new entries if they don't exist. All list entries in the imported document become new list entries in the parent document — no attempt is made to map identical list entries together.

Attributes

One of these two attributes must be set:

  • select - required
  • break -
    • before-page - places a section page break before the import
    • after-page - places a section page break after the import
    • both-page - places a section page break BOTH before AND after the import
    • before-inline - places the section page break before the import
    • after-inline - places the section page break after the import
    • both-inline - places the section page break BOTH before AND after the import
  • credentials - The credentials for opening the imported file. In the form username:password or ${var} 
  • source – optional (Java engine only). The URL will ordinarily be read in this order: To force the URL to be read as one specified source, set the source attribute to one of these values:
    • THREAD - Thread.currentThread().getContextClassLoader()
    • APP-CLASS - ProcessReport.class.getClassLoader()
    • SYSTEM-CLASS - ClassLoader.getSystemResource(propFile)
    • URL - as a URL (using URL.openStream())
    • FILE - as a file via filename, local path or UNC path
                        These protocols are only used if explicitly set
    • REST - read using the REST protocol for http requests and responses.
    • ASSEMBLY - (.net only) read from the application's assembly.
    • SHAREPOINT - (.net only) read using the SharePoint forms based authentication API. You must set credentials to use this mode.
  • type – optional. The file type to import. If this attribute is set, the file’s extension is ignored. Valid file types are: TEMPLATE, BITMAP, PDF AND TXT.
    If using PDF, type=’PDF’/filename.pdf. How this functions will depend on what report type you output to:
    If you output your report to PDF format, the PDF file(s) are separate pages inserted at the beginning of your report. AutoTag starts a new page, adds the imported file as the next N pages, then resumes the report at the top of a new page following the imported PDF. If there are two PFF imports in a row, the second starts on a new page after the first. In other words, the imported PDF pages are not modified or combined with any AutoTag commands; they are inserted at the start of your report.
    Other formats that are page-based (DOCX, XLSX, WordML) will have a single blank page for each imported PDF file.
    Other formats that are not page-based (html) will skip the PDF file.
  • default – optional. If the node in the select attribute does not exist or is empty, it will use the URL of this attribute. Note that this is used as a URL or filename, not as the contents of a file
  • wrap – optional. For bitmaps only, set this attribute to control how the image is placed.
    • INLINE (default) - This is the way Word normally places an image into a document, with text before and after it continuing to flow, but with only one line of text matched up with the image.
    • FRONT – The image is placed above the text. The text is not moved around the image.
    • BEHIND – The image is placed below the text. The text is not moved around the image.
    • SQUARE – The text is placed on both sides of the image – if it fits – but will have multiple lines of text to the sides, depending on how tall the image is.
    • display – optional. This tag, under the conditions below, will not display a line if the line is composed of just these tag(s) and all tags have a display value of false. The default value for display is “always” (unless overwritten/set in display.default in properties or configuration file). Values for display are:
  • display - 
    • notEmpty. Display only if string is not empty.
    • notNull. Display if the data node exists, even if it is an empty string.
    • Always. Display even if the node does not exist.

A boolean expression. For example you could use <wr:out select=’\root\company\address2’ display=’expression’/> where true is displayed and false isn’t.