IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    [CODE] Rotating Text in PDF's and other interesting things
Go
New
Search
Notify
Tools
Reply
  
4-star Rating (1 Vote) Rate It!  Login/Join 
Waz
Guru
Posted
If you have ever wanted to say rotate the titles on a PDF report, but everyone says its impossible, they're wrong.

I have created a utility (Written in FOCUS) that can do this.

There are limits to this, some are WF based, some not.


  • Currently only tested on WF 7.1.6 and WF 7.6.4
  • Can only process 12 items at a time, this process could be rewritten in a scripting language such as Perl.
  • With WF the file must be post processed to remove trailing spaces.
  • You cannot use PCHOLD OR ONLINE-FMT = PDF.


Can simulate a PCHOLD with the command

SET HTMLFORMTYPE = PDF
-HTMLFORM {name of pdf file without extenstion}


Here is a sample

The example PDF is here

A zip file of the code and samples is here

If you have any issues with the code, please add to this post, and I'll attempt to fix the problem.

If anyone is interested in how this is done, please add to this post and I'll explain what I know.

This message has been edited. Last edited by: Waz,


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Very nice Warren, manipulating the PDF file stream itself, amending control objects etc.

Also good to see that you've tried to incorporate full error vetting as well.

It would have been good to know what environment and platform from your signature, but I guess that you are running on a unix box due to the following code snippet?
! sed 's/[ ]*$//' tmp_pdf.ftm > &UTLPDFFX_File
This obviously restricts it, but should be able to be coded to for some other platforms by using &FOCMODE tests.

T


Old FOCUS coders never die, they just become functionally stable. (Tony A Wink)

Current Client: WebFOCUS 7.6.2 Win XP SP2/IIS 6/Tomcat 5.5 - MRE / BID MS SQL / Oracle - DevStudio 7.6.6 7.1.6
Local: WebFOCUS 7.6.6 7.1.6 on Win XP SP2/Apache/Tomcat 5.5 - Self Service
 
Posts: 2860 | Location: England U.K. (Freelance) | Registered: April 08, 2004Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
I've just made some changes to the PDF Effects routine.

Fixed some bugs

And

Added an outline functionality.

This will allow you to either have text as an outline or filled outline.

The obvious use for the outline would be a watermark in the report like DRAFT.


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
Very nice!


Francis



Env 1: WebFOCUS 5.3.2 Servlet - MRE/BID/Self Service/ReportCaster - MS Windows Server 2003 - IIS/New Atlanta ServletExec - MS SQL Server 2000 - DataMigrator 5.3.4
Env 2: WebFOCUS 7.6.5 Servlet - MRE/BID/Self Service - MS Windows XP SP2 - Apache Tomcat/5.5.25 - MS SQL Server 2000
Env 3: WebFOCUS 5.3.3 CGI - Self Service - AIX 5.2 - IBM DB2
Output formats: HTML, Excel 2000 and PDF
 
Posts: 3379 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
I've just replaced the SED command with Dialog Manager, so now the utility is pure FOCUS code.

This has been tested with WF 7.1.6 (Unix) and 7.6.4 (Windows and Unix)


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
Oops another typo, seems to get worse the older I get, or are the keyboards changing ? Music


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
-* Write out a master to read the BSB_ACC list
EX -LINES 5 EDAPUT MASTER,pdf_effects,CV,FILE

just this wee bit of syntax by itself is the most brilliant thing i've ever seen...
wow




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2624 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
so it seems that DEALER_COST is the key element in this whole thing..
One of the TITLE's has to be set
with a whole lot of room vertically, in the usual sense, in order to get the rotated titles to fit.

so the entry for [c] could be an explicit blank
-SET &UTLPDFFX_Fx3 = '[c];R0;;; ' ;
and the AS phrase for DEALER_COST
DEALER_COST AS '[c], , ,Dealer'
will make the whole title bar tall enough to handle flipped titles.

this is sooooooo sweet.
i hope you won a tv or a car or a house or something.
Last year T and I won iPods...very sweet,
but this one's worth a sailboat.




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2624 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
quote:
or are the keyboards changing
You must have had the same batch as mine - it's disl dyls can't spell either Wink

As for the top tip Summit 2008, a worthy winner Smiler

T


Old FOCUS coders never die, they just become functionally stable. (Tony A Wink)

Current Client: WebFOCUS 7.6.2 Win XP SP2/IIS 6/Tomcat 5.5 - MRE / BID MS SQL / Oracle - DevStudio 7.6.6 7.1.6
Local: WebFOCUS 7.6.6 7.1.6 on Win XP SP2/Apache/Tomcat 5.5 - Self Service
 
Posts: 2860 | Location: England U.K. (Freelance) | Registered: April 08, 2004Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
Susannah, if you need more info on EDAPUT, have a look here

As for how it works, yes, you have to consider the space that WebFOCUS will leave.

I won an iPod, its billiant.

Perhaps next time the prize will be an iPhone ??

This message has been edited. Last edited by: Waz,


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
And no matter what size font you use the print on the screen just keeps getting smaller!


Pat
WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes
 
Posts: 524 | Location: TX | Registered: September 25, 2007Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
quote:
And no matter what size font you use the print on the screen just keeps getting smaller!

Pat, I don't follow. Confused


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
quote:
Oops another typo, seems to get worse the older I get, or are the keyboards changing ?


Pat
WF 5.3.2 AIX, NT, AS/400, Focus AS/400, AIX, Oracle, JDE, DB2, Lotus Notes
 
Posts: 524 | Location: TX | Registered: September 25, 2007Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
i think its a comment about our eyes Wink




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2624 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
The eyes are going, and the keyboards are getting smaller. Sweating


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
The result is extremely cool! To be frank I barely understand how it works. OK, I'll admit right now I don't understand how it works at all Roll Eyes

However I must say that it appeals to my sense of irony that the winning entry is based on a feature that is both undocumented and unsupported, which of course makes the achievement even more impressive.

Do you think they'll 'code-tighten' then ask for the ipod back when it no longer works?





Live and Direct from the University of Virginia.

DevStudio 7.6.6 - WF-7.6.4 - Win2k3 - MRE - RC - MSSQL - XBOX-360 (dead) - Wii - PSP - iPod Touch - Suzuki B-King
 
Posts: 17 | Location: Virginia | Registered: May 10, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Oh now I get it!

Veeery nice.





Live and Direct from the University of Virginia.

DevStudio 7.6.6 - WF-7.6.4 - Win2k3 - MRE - RC - MSSQL - XBOX-360 (dead) - Wii - PSP - iPod Touch - Suzuki B-King
 
Posts: 17 | Location: Virginia | Registered: May 10, 2005Reply With QuoteEdit or Delete MessageReport This Post
Expert
Posted Hide Post
its not even a feature
its all 'Waz', hacking a result out of thin air and magic.
Waz is the real 'David Copperfield'




DevStu 767; wintell 767; Unix 765,Oracle: /// iplanet; Dev 765 tomcat 6;///MRE/BID/PMF
 
Posts: 2624 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
Stop it, my head is getting bigger, oopps it exploded. Red Face

But seriously, any of us can do this sort of thing, you just have to keep an open mind and think outside the box, well perhaps in another container in another port. Winky


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Waz.... great routine. Thanks. I needed to add parentheses around the code in line 202 of your zipped utlpdffx to get it to work for me, else it gave an:
 0 ERROR AT OR NEAR LINE    202  IN PROCEDURE UTLPDFFXFOCEXEC *
 (FOC279) NUMERIC ARGUMENTS IN PLACE WHERE ALPHA ARE CALLED FOR


works great as:

 S&Cntr..ALin2/I9    = IF ('&UTLPDFFX_Efct.&Cntr' CONTAINS 'R270')
                       (OR '&UTLPDFFX_Efct.&Cntr' CONTAINS 'R90')




Prod: WebFOCUS 7.1.6 Servlet - Self Service on Solaris 8 - Apache Tomcat 5.0.28
DevStudio 7.1.6 on MS Windows XP SP2
Output: HTML, Excel 2000 and PDF
 
Posts: 4 | Registered: May 24, 2004Reply With QuoteEdit or Delete MessageReport This Post
Waz
Guru
Posted Hide Post
Thanks zoogy55, i've fixed it in the zip in the link above.

The new version has some other general fixes as well.


Waz...
Prod:WebFOCUS 7.1.6Upgrade:WebFOCUS 7.6.6OS:UnixOutputs:PDF, CSV, Excel, TXT, XML, HTML

 
Posts: 377 | Location: Sydney, Australia | Registered: October 31, 2006Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    [CODE] Rotating Text in PDF's and other interesting things

Copyright © 1996-2008 Information Builders, leaders in enterprise business intelligence.