Is anyone creating Flex reports without using IB's Flex Enable and InfoAssist? That is, just writing Flex code in an HTML file and calling WebFocus in a similar fashion as writing HTML/Javascript/Ajax code making calls to WebFocus as needed from within the page?
Apparently InfoAssist needs to be licensed along with the Flex Enable product and this is cost prohibitive at this time. However, I would like to leverage Flex's capabilities to create some very Flexy WebFocus reports. If anyone is doing this could you send me some code examples to get me started? I am poring over the Flex Builder product at this time.
I hop everyone is having a wonderful holiday season in spite of the horrendous state of the world. Merry Christmas!
NorbThis message has been edited. Last edited by: Kerry,
I've created one app, that has some lists, pei charts, and drill downs.
For the same reason, I decided to build it my self.
The only real issue I had was parsing WebFOCUS's XML output, as it is just HTML in a wrapper.
I created a custom XML output for my data, and things worked quite well.
It is not as functionally rick as Enable but does the job.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 15, 2009, 02:29 PM
Norb Eckert
Hi Waz,
Thanks for the prompt reply. Good to hear that I have an alternative to using the Flex product. Can you point me to any quick start references for Flex. I'm using the trial right now. Or can you provide some brief code examples?
As for references, I only used the Flex Help, and a lot of Googling. Most of the time there were examples of what I needed.
I have a utility that will return any hold file/datasource to Flex an XML document with proper tags.
I could send it to you.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 15, 2009, 11:36 PM
dhagen
I did some testing with this as well. I wrote a java filter that essentially takes over the http servlet response of webfocus, and applies an xslt against the proprietor XML response thereby converting it to style of XML I want. I actually use ON TABLE PCHOLD FORMAT XMLR because that xml output keeps the column titles, report heading and footing. It's kind of neet, because you can just build the report like any other, and the xslt does the rest. All I have to do is send a single parameter to the WFServlet that is the name of the xslt I want it to use.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
December 16, 2009, 01:49 AM
Tony A
Think about it Guys, who ever said that the response from an XMLHTTP request had to be XML?
Why bother with parsing the output? Why not just send back pure HTML and dump the response into a DIV or SPAN ID? I do this alot on my own websites (admittedly using ASP but the principles the same) and it works very well. Careful construction of the JavaScript and you can have interactivity to your hearts desire!
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
December 16, 2009, 09:40 AM
dhagen
Tony,
That is a good point. When you consider that json is the most popular response type for an XMLHTTP requests these days, you are not alone in this thought. For me it all comes down to performance. I know that you know xsl(t), so you also know that using an xslt is a high performance way to transform an xml document. From a webfocus standpoint, there seems to be little to no difference between the html and xml output types (although the xml output will be smaller for larger answer sets). Now push that transformation work to the application server (tomcat, websphere etc.) that can be tuned to handle it, and will scale to support large scale deployments. It just strikes me as a more consistent approach for consuming data in a flex/ajax type environment.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
December 16, 2009, 12:55 PM
Norb Eckert
I've never heard of the XMLR output so I need to take a look at that. I usually just write my own XML output as it's easier for me to understand and then apply.
What is an "xslt"? I'm sorry but I haven't heard of that before.
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
December 16, 2009, 03:41 PM
Waz
Keep in mind that if you are Flex to do some bells and whistles, it seems to be very good and quick at parsing XML, Well Formed XML.
The XML returned by PCHOLD FORMAT XML, is difficult to use as is.
Flex likes XML with tags that are column names, not TABLE, TR, TD, etc.
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
December 17, 2009, 10:04 AM
dhagen
I agree. The way I did this, the process becomes pretty simple.
The fex:
-DEFAULT &COUNTRY = 'FOC_NONE'
SET PAGE=NOPAGE
SET LINES=99999
TABLE FILE GGSALES
HEADING
"THIS IS A HEADING as of <+0> &YYMD"
SUM
DOLLARS BUDDOLLARS
COMPUTE VARIANCE/D12 = BUDDOLLARS - DOLLARS; AS 'Variance'
BY REGION
FOOTING
"THIS IS A FOOTING"
ON TABLE PCHOLD FORMAT XMLR
END
{"root":
{
"data":
[
{"VARIANCE":-57545,"BUDDOLLARS":3866856,"CITY":"Chicago","REGION":"Midwest","DOLLARS":3924401},
{"VARIANCE":-34299,"BUDDOLLARS":3680679,"CITY":"Houston","REGION":"Midwest","DOLLARS":3714978},
{"VARIANCE":-114448,"BUDDOLLARS":3646838,"CITY":"St. Louis","REGION":"Midwest","DOLLARS":3761286},
{"VARIANCE":110411,"BUDDOLLARS":3818397,"CITY":"Boston","REGION":"Northeast","DOLLARS":3707986},
{"VARIANCE":50153,"BUDDOLLARS":3832202,"CITY":"New Haven","REGION":"Northeast","DOLLARS":3782049},
{"VARIANCE":24057,"BUDDOLLARS":3926322,"CITY":"New York","REGION":"Northeast","DOLLARS":3902265},
{"VARIANCE":147480,"BUDDOLLARS":4247587,"CITY":"Atlanta","REGION":"Southeast","DOLLARS":4100107},
{"VARIANCE":2922,"BUDDOLLARS":3689979,"CITY":"Memphis","REGION":"Southeast","DOLLARS":3687057},
{"VARIANCE":-52810,"BUDDOLLARS":3870405,"CITY":"Orlando","REGION":"Southeast","DOLLARS":3923215},
{"VARIANCE":-102519,"BUDDOLLARS":3669484,"CITY":"Los Angeles","REGION":"West","DOLLARS":3772003},
{"VARIANCE":46605,"BUDDOLLARS":3916863,"CITY":"San Francisco","REGION":"West","DOLLARS":3870258},
{"VARIANCE":44481,"BUDDOLLARS":4055166,"CITY":"Seattle","REGION":"West","DOLLARS":4010685}
],
"columns":
{
"column":
[
{"content":"REGION","title":"Region","align":"left","type":"alpha"},
{"content":"CITY","title":"City","align":"left","type":"alpha"},
{"content":"DOLLARS","title":"Dollar Sales","align":"right","type":"numeric"},
{"content":"BUDDOLLARS","title":"Budget Dollars","align":"right","type":"numeric"},
{"content":"VARIANCE","title":"Variance","align":"right","type":"numeric"}
]
},
"footing":"THIS IS A FOOTING",
"heading":"THIS IS A HEADING as of 20091216"
}
}
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
December 18, 2009, 04:31 PM
Norb Eckert
Thanks for the code listing Darryl. Lots of stuff there and at this point I don't understand most of it. However, as I root around in the Flex world I'm sure it's gonna gel and THEN make lots of sense.
I'll be noodling through the Flex help and power Googling as you did to learn this stuff. Thanks - I didn't expect a magic bullet (like in Mario Kart) but just wanted to make sure I wasn't missing something.
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
December 18, 2009, 07:59 PM
dhagen
quote:
Originally posted by Norb Eckert: Thanks for the code listing Darryl. Lots of stuff there and at this point I don't understand most of it. However, as I root around in the Flex world I'm sure it's gonna gel and THEN make lots of sense.
Norb,
Just remember the stuff I didn't post is all the java code to make this work, and the instructions to add it to WebFOCUS. The posted stuff above will only get you so far. If you get comfortable with the xslt stuff then drop me a line to get the rest.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
April 30, 2010, 06:37 PM
Dan Pinault
Hey all,
I tried my first Flex application using WebFOCUS generated XML and ran in to the same issues discussed here. I will definitely try dhagen's XSLT method.
Just curious, I understand IBI is working on getting the v4 Flex SDK components certified. Does anybody know if there are plans to make changes to the XML output format so those of us who don't have Flex Enable can use the data without going through all these machinations?
Otherwise, any improvements or enhancements to the technique? The last post on this was over 4 months ago.
Thanks,
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.