mrc logo mrc logo
  • m-Power m-Power
    What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • Solutions Solutions
    What does m-Power build?
    Overview Database Front-Ends Reporting CRM Systems Business Intelligence Dashboards Inventory Management Mobile Apps ERP Enhancements Modernization Spreadsheets to the web MS Access to the web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs and Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Services Services
    Development Services Training Mentoring
  • About About
    Overview Partners Press Releases Careers Events Contact Blog
  • Support Support
    Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • m-Painter
  • Use Field Substitutions within HTML Attributes and Inline Styles
Back to Manual

Use Field Substitutions within HTML Attributes and Inline Styles

 

m-Painter allows field substitution parameters within HTML attributes and CSS styles. This document will help to explain how m-Painter can be used with field substitutions.

Some HTML attributes accept any character data as valid; for example, title, alt, and class can be set to any text value. Other HTML attributes, however, require values from a delimited list or range. An example of this would be the attribute align, which for most elements accepts only the following values: left, center, right, justify. Upon rendering the page, a field substitution may be rejected by m-Painter as invalid when used for these types of attributes. However, many of these types of attributes have been deprecated in recent HTML specifications in favor of inline styles, and m-Painter will now correctly handle these substitutions in inline styles.

Example 1

Sometimes you may wish to conditionally set an attribute within the HTML based on the data in your dataset. You may want to justify your data "center" or "right" depending on a value within the record.

Problem: m-Painter will reject the use of field substitutions when used with an attribute such an "align":

< td align="${row.CALCULA001}">${row.FLD1}</td>

Because ${row.CALCULA001} is not a valid value for the "align" attribute it is rejected and removed by m-Painter.

Solution: The appropriate way to accomplish this, which is now supported by m-Painter, is to use an inline style as follows:

<td style="text- align: ${row. CALCULA001}">${row.FLD1}</td>

m-Painter has now been enhanced to allow field substitutions with any style attribute. A full list of properties and valid values for each can be found here: https://www.w3.org/TR/CSS21/propidx.html.

Example 2

Suppose I have a report that displays various orders. In this report I want to highlight the orders in which my customers ordered a quantity of 20 or more of a given product. This is a situation where you can use a field substitution within an HTML inline style.

  1. Create a conditional calculation that will set the calc equal to the word "Yellow" if the quantity ordered is greater than or equal to 20.
  2. Compile the application.
  3. In m-Painter open the HTML source and find the field substitution for the field you wish to highlight.
  4. Add an inline style to the <td> tag associated with this field that sets the cell's background color equal to the calculation.

The resulting output is below:

Created: February 29, 2008 | Modified: August 18, 2017

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

Data Dictionary Database RPG Parameters Performance Record Selections Form Validation Dates SQL Admin Report Graphs Prompt Screens Production Summaries Dropdowns Graphing Graph Properties Email Advanced m-Painter Getting Started Maintainers Bootstrap Templates External Objects mrc-Productivity Series Calculations App Properties Popular Administration Video Tomcat Compiling Java Application Properties Security Bar Graphs Retrieval Reports DB2 Freemarker Build Process Retrievals Excel Maintainer

See all tags »

michaels, ross & cole, ltd. (mrc)

Privacy Policy Cookie Policy Cookie Settings Notice at Collection Do Not Sell or Share My Personal Information

mrc (US)

2001 Midwest Road
Suite 310
Oak Brook, IL 60523
630-916-0662

mrc (UK)

Mortlake Business Centre
20 Mortlake High Street
London, SW14 8JN
+44-20-335-59566


© 2024 mrc. All rights reserved.