Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Open in PDF and print

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Open in PDF and print
 Login/Join
 
Platinum Member
posted
I have a report in HTML that I would like to open in PDF for the user to print by clicking a print/pdf button. What am I missing in this cars database example to make that happen.


 -HTMLFORM BEGIN
<html>
<head>
<script>

function changeOutpdf(){
document.form1.WFFMT.value = 'PDF' ;
}
</script>
</head>
<body>
<form name="form1" target="_blank">

<input type=submit name="print" id="print" value="Print/Export PDF" style="background-color:aqua" onclick="javascript:changeOutpdf();">
</form>
</body>
</html>
-HTMLFORM END


TABLE FILE CAR
PRINT
     COUNTRY
     CAR
     MODEL

ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     LEFTMARGIN=0.250000,
     RIGHTMARGIN=0.250000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     RIGHTGAP=0.125000,
$
TYPE=DATA,
     SIZE=8,
     BACKCOLOR=( RGB(234 234 255) 'WHITE' ),
$
TYPE=TITLE,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     SIZE=9,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=HEADING,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     SIZE=12,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     SIZE=14,
$
TYPE=FOOTING,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     SIZE=9,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=ACROSSVALUE,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=ACROSSTITLE,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     SIZE=9,
     STYLE=BOLD,
$
ENDSTYLE
END
 

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


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Expert
posted Hide Post
Basically, you'd need to use PDF as your output format and do your print there (PDF) once the PDF is created. You could do this via a drilldown on the word "export", which could reside in the HEADING which would, in turn, would pass a value of 'PDF' to your format variable. I did this while at USDA.

PS: Thanks a meg for providing a sample using the CAR file.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Virtuoso
posted Hide Post
You don't use the WFFMT variable you're modifying anywhere in your fex. You should probably have -DEFAULT &WFFMT='HTML' and then replace ON TABLE PCHOLD FORMAT HTML with ON TABLE PCHOLD FORMAT &WFFMT

Doug's approach of providing a drill link is how I usually provide the option for them to get the report in PDF format.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
I was hoping that I could use javascript behind the scenes of my pdf button to run the fex and display in pdf format.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Virtuoso
posted Hide Post
Your PDF button can run your fex and generate in PDF format, but you need to dynamically change the output format using a variable. Your fex says ON TABLE PCHOLD FORMAT HTML so unless you change that to a variable you're never going to get PDF regardless of what your javascript does.

Additionally there are a bunch of other variables that need to be populated in your HTMLFORM that will be passed when your submit action is executed.

Your best solution lies in following what has already been suggested. Another option is to create a launch page that has a drop-down for the user to select the type of output they would like. This still requires the use of a variable in you fex and population of that variable via an HTML form.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Platinum Member
posted Hide Post
Thanks Darin, I will use the suggestions from Doug..Just as I told you at Summit.."your a life saver"


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Platinum Member
posted Hide Post
If anyone would like to give an example using the cars database it would be highly appreciated.


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Platinum Member
posted Hide Post
When I click on export, my drill down output is still HTML

 -DEFAULT &WFFMT = HTML
TABLE FILE CAR
PRINT
     COUNTRY
     CAR
     MODEL
     BODYTYPE
HEADING
"EXPORT"
FOOTING
""
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &WFFMT
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     PAGESIZE='Letter',
     LEFTMARGIN=0.250000,
     RIGHTMARGIN=0.250000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     RIGHTGAP=0.125000,
$
TYPE=DATA,
     SIZE=8,
     BACKCOLOR=( RGB(234 234 255) 'WHITE' ),
$
TYPE=TITLE,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     SIZE=9,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=HEADING,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     SIZE=12,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     SIZE=14,
$
TYPE=HEADING,
     LINE=1,
     OBJECT=TEXT,
     ITEM=1,
     TARGET='_blank',
     FOCEXEC=newfex(WFFMT='PDF'),
$
TYPE=FOOTING,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BORDER-TOP=LIGHT,
     BORDER-BOTTOM=LIGHT,
     BORDER-LEFT=LIGHT,
     BORDER-RIGHT=LIGHT,
     BORDER-TOP-STYLE=RIDGE,
     BORDER-BOTTOM-STYLE=RIDGE,
     BORDER-LEFT-STYLE=RIDGE,
     BORDER-RIGHT-STYLE=RIDGE,
     BORDER-TOP-COLOR=RGB(51 51 153),
     BORDER-BOTTOM-COLOR=RGB(51 51 153),
     BORDER-LEFT-COLOR=RGB(51 51 153),
     BORDER-RIGHT-COLOR=RGB(51 51 153),
     SIZE=9,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=ACROSSVALUE,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=ACROSSTITLE,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     SIZE=9,
     STYLE=BOLD,
$
ENDSTYLE
END
 


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Expert
posted Hide Post
ON TABLE PCHOLD FORMAT &WFFMT.(<HTML,HTML>,<PDF,PDF).Select type of display output.


Try this instead.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<JG>
posted
quote:
FOCEXEC=newfex(WFFMT='PDF'),

Is newfex the name of the focexec that contains your code?

Works perfectly for me.
 
Report This Post
Platinum Member
posted Hide Post
you are right JG,it works for me also now.

Thanks


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Platinum Member
posted Hide Post
OK,now I am concerned because the drill down to PDF seems to work when it wants to. If I run the cars database (displayed above) and click export it will open in PDF format. An hour or so later, if I run the same report and click export it will open itself in HTML format.Why the inconsistency?


Prod: WebFocus 7.7.3 Win 2003
Dev: WebFocus 7.7.3 Win 2003
 
Posts: 116 | Registered: April 23, 2007Report This Post
Guru
posted Hide Post
I tried it and it worked just like JG said.

Are you making the fex drill onto itself?
If so try having a seperate fex to drilldown on.

Here the syntax for for a drilldown you might want to play with type and subtype.
TYPE=type, [subtype], FOCEXEC=fex[(parameters ...)], [TARGET=frame,] $


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Open in PDF and print

Copyright © 1996-2020 Information Builders