m-Power Documentation

Web 2.0 Reports include PDF Output

Web 2.0 reports now include the option to output to PDF. The painting for the PDF comes directly from the HTML presentation layer. This means that m-Painter is the WYSIWYG editor for all of these output types: HTML, Formatted Excel, and PDF.

Options (shown with default)

  1. Page Size and Orientation: Portrait (8.5in 11in) - (For landscape, use 11in 8.5in.)
  2. Outside Border Page Margin (.5 in)
  3. Border (thin solid black)
  4. Inside Border Page Margin Padding (.0 in)
  5. Footer (Page 1 of 100)

These can all be changed per application by tweaking the generated HTML output. To modify these settings from their default, use m-Painter, toggle to the source, and change the PDF settings within the style tag.

Issues to Consider:

  1. The conversion from HTML to PDF requires strictly-formed HTML. Simply put, this means that all HTML tags must be complete. For example, for every begin-table tag (<table>), there must be a corresponding end-table tag (</table>). Even though the HTML might render acceptably in a browser, it might not be complete enough for the conversion from HTML to PDF. If there is a problem with the HTML, you will see an appropriate error message when you attempt to create the PDF output, including some mention of the incomplete tag.

Note: For users with data dictionaries older than October of 2007, you will need to make two small changes to your Header file. Specifically look for the lines that begin with “< img ” and end with “>”.

Be sure to end them with “/>”. This ensures that the IMG tag is complete and will minimize the chance of generating an error message on the conversion. For example,

1. Change this

< img src ="/mrcjava/image/ top.jpg " border="0" >

to read this:

< img src ="/mrcjava/image/ top.jpg " border="0" />

By default, there are two images in the mrc header. Be sure to change both of them.

2. In your footer file, you will see one table referenced as <TABLE>, please change this to read <table>.

  1. If you will include images in the PDF output, the best practice is to specifically specify the image alignment. This means using align=”left” or align=”right” on the image tag. This should correct any problems you see with image alignment or unwanted spacing gaps.
  1. Repeating images used in backgrounds might cause performance problems. The performance problem appears in that it takes longer for the PDF to be created, and any PDF Reader takes a long time to both render and print the output. For the fastest possible responses, consider using a simple color for a background instead of an image. Specifically, in the inline style sheet, mrc_servlet_stylesheet_css.html, consider changing this line:

. back { color : black; background-image: url("/mrcjava/image/ back.gif "); font: 8pt verdana ;}

To something like this:

. back { color : black; background: #d8d8d8 ; font: 8pt verdana ;}

  1. To control the maximum number of rows on each page of the PDF output, set the max_rows parameter on the Print-Optimized tab in the Application Properties.

Common Question Regarding Using the PDF Output feature in existing Web 2.0 Reports

Q: I have an existing classic Web servlet report. Can I get the HTML formatting from that report into PDF output?

A: You cannot directly use the HTML output as the PDF formatting in classic Web servlet reports. However, you can use those report specifications by copying that to another report and using the Web 2.0 report template to compile it.

Q: I already have a Web 2.0 report defined. How can I use it?

A: Recompile the report and replace the HTML output. When you run it via the browser, you will see PDF as an output option.

Q: I already have a Web 2.0 report defined. Can I retain my screen painting?

A: Yes – if you already have existing Web 2.0 Reports, please contact the mrc hotline at support@mrc-productivity.com and we will supply you with the additional information. For most users, if your Application was developed after October of 2007, you already have this functionality!


subscribe to newsletter
Want to receive weekly insight, tips, viewpoints, and news from a 28-year industry veteran? Enter your email below to subscribe!

m-Power Customers

Customers


mrc (US)
555 Waters Edge
Suite 120
Lombard, IL 60148
630-916-0662
mrc (UK)
Argyle House
1 Dee Road
Richmond, Surrey
TW9 2JN
+44-20-8322-7720