Users can export jasper reports results in several formats, such as PDF and CSV. If you need another file format, you can create a custom export channel. You must implement a custom Java class that generates the required file format then integrate the new class into the server. This customization must be made in the source code of JasperReports Server. To create this new export channel I followed instructions found at "Adding custom export channels" document, in Jaspersoft community portal. As it's required to work within che Jasper Server source code, it's mandatory to work with JasperResports Server Source Code and, in a second time, deploy the built-in code on your Produciton JasperReports Server. So please first of all, follow the above link and create your source code environment.
I'll add a new export channel to TXT format. The TXT result file will we sent to direct print; printer name will be passed as a parameter.
This new channel will be added to the report viewer. Please note that it can be added to scheduler and web services too.
Export parameters - printer name
Export parameters define how JasperReports Server generates your output format. For example, "layout" parameter to define page appearance, with possibile values like LANDSCAPE and PORTRAIT.
Export parameters have default values that can be set at report or application level. Many parameters are optional; others are valid only for certain export channels. When you create an export channel, you can define new parameters to control how your reports will be exported in the new format.
In our case, a parameter will be used to define the printer name.