There are several technical approaches to creating dynamic documents such as reports or other text documents:

  • Banded Reports

    A common approach to creating dynamic documents is to use banded reports. In this approach, the document is divided into bands. Each band is responsible for rendering a specific part of the document. For example, one band might be responsible for rendering the header, while another band might be responsible for rendering the body of the document. This approach is used in reporting tools such as Crystal Reports and JasperReports.

  • Template Engines

    Template engines are another approach to creating dynamic documents. Template engines allow you to define a template that contains placeholders for dynamic content to be inserted. Typically, the template is written in a markup language such as HTML or XML, and the placeholders are replaced with the actual content at runtime. Popular template engines include Smarty, Twig, and Mustache.

  • Document Generation Libraries

    Another way to create dynamic documents is to use the TX Text Control document generation library. This library allows you to create documents programmatically using a powerful API or from templates using the MailMerge engine. The library supports a wide range of document formats, including DOCX, PDF, and RTF.

Banded Reports Drawbacks

Banded reports are a popular approach to creating dynamic documents. However, they have several drawbacks that you should be aware of. The nature of banded reports makes them inflexible and difficult to maintain. Designing complex layouts can be challenging and banded reports are often tightly coupled to the data source, making it difficult to reuse the report with different data sources.

The missing WYSIWYG design experience is another drawback of banded reports. The design-time experience is often limited to a drag-and-drop designer that doesn't provide a true WYSIWYG experience. This can make it difficult to design complex layouts and can lead to frustration for developers.

Very often, templates must be designed by developers and can't be modified by end-users. This can be a significant limitation in scenarios where end-users need to customize the layout of the document.

Template Engines Drawbacks

Template engines require you to write templates in a markup language, which can be cumbersome and error-prone. The markup language used by template engines is often unexpressive, making complex layouts difficult to create.

In particular, PDF engines that fill dynamic content into placeholders have the drastic disadvantage of not being able to control the flow of text. Consider a template with a placeholder that dynamically fills with longer text. If the text is so long that a new page should be added, surrounding elements such as tables, table headers, or headers and footers should be automatically adjusted. But this is not the case with most template engines. Or, if only one line of a paragraph won't fit on the same page, you may want to move the entire paragraph to the next page. These are requirements that are usually not met by template engines.

Flow Type Layout Document Generation

The flow type layout reporting in TX Text Control is a method where the report content is integrated seamlessly into a continuous flow, similar to how word processing documents work. TX Text Control reporting is available for ASP.NET, ASP.NET Core, Windows Forms, and WPF applications. Front-end designers are available for any client-side framework, including ASP.NET MVC, Blazor, JavaScript, Angular, or React.

Live Demos

Check out our full-featured live demos to experience the TX Text Control reporting engine and easy-to-use document template editor.

Live Demo

Instead of using fixed bands or sections, this approach allows for dynamic adjustment of content, enabling elements like text, images, and tables to flow naturally across pages. The concept emphasizes flexibility and ease of use, ensuring that the report adapts to content changes automatically without requiring extensive reformatting, which makes it easier to handle complex documents and large data sets while maintaining a polished, professional appearance.

The reusability of templates in TX Text Control is enhanced because they are not directly bound to data sources. This decoupling allows templates to be designed and utilized independently of the specific data being inserted, making them highly versatile. A template contains only merge field names and repeating merge block names, not a connection string to databases.

Creating documents with TX Text Control

TX Text Control provides a WYSIWYG template designer that allows end-users to create and modify templates without requiring programming skills. The designer provides a true WYSIWYG experience, enabling users to see the final document layout as they design it. This empowers users to create complex layouts with ease, reducing the need for developer intervention.

Keep Lines Together

TX Text Control provides a feature called Keep lines together that ensures that a paragraph is not split across pages. This feature is particularly useful when you want to keep headings or paragraphs together on the same page.

When a paragraph is too long to fit on the current page, TX Text Control automatically moves the entire paragraph to the next page, ensuring that the paragraph remains intact. Consider the following template where a merge field is at the end of a page with only a few lines of space left at the end of the page.

Creating documents with TX Text Control

Normally, the paragraph would be split across pages, resulting in an unprofessional appearance as shown below.

Creating documents with TX Text Control

With the Keep lines together feature enabled, the entire paragraph is moved to the next page, ensuring that the paragraph remains intact and maintains a professional appearance.

Creating documents with TX Text Control

When a paragraph breaks across pages, you can also control how many lines should be at least on the current page and on the next page.

Creating documents with TX Text Control

To keep multiple paragraphs together, you can link them with the Keep with next setting. In the following example, you can see that there wouldn't be enough space on the current page for the dynamic paragraph and the following paragraph, which are linked. The result is that the entire block of paragraphs is moved to the next page.

Creating documents with TX Text Control

Pro Tip

This article explains why to avoid forced page breaks in document templates and how to create templates that automatically adjust to the content using other word processing features.

Document Templates Tip: Say No to Forced Page Breaks

Conclusion

Flow type layout reporting is a powerful method for creating dynamic documents that adapt to content changes automatically. This approach provides flexibility and ease of use, enabling you to create complex documents with ease. By using TX Text Control, you can take advantage of a WYSIWYG template designer that empowers end-users to create and modify templates without requiring programming skills. This approach allows you to create professional-looking documents that are easy to maintain and reuse.

Download a free trial of TX Text Control and start creating dynamic documents today!