Posts

Showing posts from January, 2015

IBI WebFOCUS - Calculation or re- computation at Subtotal and Subfoot using RECAP

In my Recent project, I had a requirement where I had to show subtotal based on the selection from launch page. And the Sub Total had both total as well as %'s to display. The percentage was nothing but for example. 100*Sum(Column A)/Sum(Column B). I thought to share this with all of you since it can be reused for similar requirement and can help others to save lot of time.  This situation could have handled by using RECOMPUTE (ON TABLE RECOMPUTE "OR" ON SORT_COLUMN  RECOMPUTE) concept. However there were some challenges with that.  1) First issue was when we do RECOMPUTE all the numeric columns will get RECOMPUTEd. So if RECOMPUTE is needed to only selected columns, all other should be changed to alpha format. That is not a feasible approach according to me.  2) If all alpha columns in the report are not sorted, Sub Total row will be coming in 2 rows. That is another issue. So to avoid RECOMPUTE and use SUBFOOT (which I prefer most because of it's flexibilit

IBI WebFOCUS - Difference (Preference) between Join and Match:

For most of the reports in our WebFOCUS reporting world, we usually pull data from multiple tables and and generate the report. We all know that we can either Join Data Sources(JOIN) or Merge Data Sources(MATCH) to create report from multiple tables. Which one to choose from JOIN and MATCH? Now the question is what is the diffrence between the two and which one to choose from the 2 option. To explain this let's understand how does they process. JOIN: Basically JOIN is temporary, virtual connection between 2 or more physical or logical sources. Data in the first data source (host file) determines which records are retrieved from cross-reference file. When a record from the host file of a one-to-many join has no corresponding record(s) in the cross-reference file, the record is automatically excluded from the report output.  To control this, you can SET ALL to ON, in which case records from the host file, without corresponding records in the cross-reference file, will be disp

IBI- WebFOCUS-Using Google High charts in webFOCUS

Image
Have you worked on creating graphical reports in WebFOCUS? Do you want to use google high charts in your WebFOCUS reports? The reason I like WebFOCUS over other reporting tool is it's adaptability and flexibility to integrate with other codes. You can write HTML, javascript, XML, Unix and lot more codes into your webFOCUS procedure. I was working on a POC with my colleague to implement google charts with webFOCUS. The Reason I chose that is because of look and feel on how chart is drawn on step by step basis. Just try it running once. It looks awesome.  Below are the code for data creation file(chart_data.fex) and highchart_test.fex: Fex File for Data -* File chart_data.fex TABLE FILE CAR SUM  SALES DEALER_COST BY COUNTRY -*WHERE FLG EQ 1 ON TABLE PCHOLD FORMAT XML END -****************************************************** Fex file for highchart -* File highchart_test.fex -HTMLFORM BEGIN <html xmlns="http://www.w3.org/1999/xhtml">   <hea

IBI WebFOCUS - Difference between DEFINE and COMPUTE

Image
In our day to day coding in WebFOCUS we would have used DEFINE and COMPUTE many a times. Even if you go for an interview this is the most common question (More than 90%). Surprising fact is there are many who cannot answer this question properly. Answering this question doesn't guaranty you the job but it is expected from a WebFOCUS developer to know the difference. First of all what is DEFINE and COMPUTE in WeBFOCUS term? The Answer is simple. Both does create virtual fields. They are used in WebFOCUS to perform calculated fields. Now when both does calculation, why do we have 2 options to do that? There are few differences listed below: 1) Calculation using DEFINE is on row by row basis meeting the selection criteria and Calculation using COMPUTE is done when all aggregation and sorting is done. For example- if the database has 100000 records for sales transaction and we want to aggregate it by 4 Regions. In case of DEFINE the calculation will happen 100000 times however

IBI WebFOCUS - Testing and Debugging in WebFOCUS codes

You can debug a Web FOCUS application by querying your environment to display information such as file status, release, server information, and joins, as well as by identifying files you are using. Other debugging methods are available in Web FOCUS, including specialized Dialogue Manager Variables and traces performed from the Web Console. Debugging Your Application with Query Commands You can use query commands to display information about your metadata, data sources, language environment, Developer Studio, and Web FOCUS. This is useful for determining any aspects of your application that may be preventing the proper behavior of your application. You can query your environment with a query command executed in Developer Studio or Web FOCUS. The result of a query command is returned in your browser window or as a comment in the HTML file. Use the applicable Web browser functions to view the HTML comments (for example, View Source in Microsoft Internet Explorer). How to Issue