Tuesday, November 23, 2010

Where to Store HTML Forms?

With the -HTMLFORM syntax, WebFOCUS provides web app developers with a way to utilize HTML forms and syntax within the FOCUS 4GL code.  You can include not only web pages for displays and user input but JavaScript processing as well.

You have two options when doing this: either embed the HTML code inside the WebFOCUS code or reference an existing HTML page stored elsewhere.  

Syntax for inline HTML code:



Syntax for referencing separate HTML code:



You can see your Information Builders documentation for more details on the -HTMLFORM command. I have seen both of the above options in use at client sites and only recently encountered an issue that would cause me to suggest one approach over the other.

If you embed the HTML form inside the 4GL code using the BEGIN and END tags, the WebFOCUS pre-processor for Dialogue Manager symbolic variables will read that HTML code. If you have ampersand variables referenced in the HTML form, you run the risk of having substitution happen when you do not want it. Then, you need to take extra steps to make sure your variables are not evaluated and changed to their literal values. For example, if your HTML contains a servlet call with variables, those will get evaluated and changed (not what you want to happen).

If on the other hand your program just references the HTML form stored in an HTML file, WebFOCUS does not do the symbolic variable evaluations. Problem avoided. 

So here is my advice. If you need to dynamically build an HTML form, then putting it inline and using Dialogue Manager is your best approach. However for static HTML forms, you should always put the HTML code elsewhere and reference it by name inside your WebFOCUS code.

Another note: I believe that as of the latest 7.6 release, your HTML form file must be on the WebFOCUS Report Server in the app path and not in the Managed Reporting Environment. When searching for the referenced HTML form file, WebFOCUS is currently only searching the WFRS applications and not looking in MRE (I have asked IBI for an enhancement to the command).

No comments:

About Me

My photo

I am a project-based software consultant, specializing in automating transitions from legacy reporting applications into modern BI/Analytics to leverage Social, Cloud, Mobile, Big Data, Visualizations, and Predictive Analytics using Information Builders' WebFOCUS. Based on scores of successful engagements, I have assembled proven Best Practice methodologies, software tools, and templates.

I have been blessed to work with innovators from firms such as: Ford, FedEx, Procter & Gamble, Nationwide, The Wendy's Company, The Kroger Co., JPMorgan Chase, MasterCard, Bank of America Merrill Lynch, Siemens, American Express, and others.

I was educated at Valparaiso University and the University of Cincinnati, where I graduated summa cum laude. In 1990, I joined Information Builders and for over a dozen years served in regional pre- and post-sales technical leadership roles. Also, for several years I led the US technical services teams within Cincom Systems' ERP software product group and the Midwest custom software services arm of Xerox.

Since 2007, I have provided enterprise BI services such as: strategic advice; architecture, design, and software application development of intelligence systems (interactive dashboards and mobile); data warehousing; and automated modernization of legacy reporting. My experience with BI products include WebFOCUS (vendor certified expert), R, SAP Business Objects (WebI, Crystal Reports), Tableau, and others.