Focal Point
[CASE-OPENED] PDF - Bold partial text in HEADING

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/141105651

June 19, 2009, 02:24 PM
JL
[CASE-OPENED] PDF - Bold partial text in HEADING
Hi,

I have a variable, say:
PARAG1/A2000 = 'Information: This information ...';

This variable is used in the HEADING:
HEADING
"
The line is formatted to wrap:
TYPE=TABHEADING,
LINE=1,
WRAP=6.5,
And the paragraph forms 5 lines in the output.

I would like to bold the word "Information:". I tried breaking up the text into two variables; however; this resulted in the paragraph appearing as two columns. Is there a way to bold part of a line?

The output format is PDF.

Thanks!

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


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
June 19, 2009, 02:35 PM
GinnyJakes
Here is a post that might help you:
http://forums.informationbuild...131002892#8131002892


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
June 19, 2009, 03:09 PM
JL
Thanks for the fast reply.

I did try splitting the line into two variables and using a spot marker between them. The result appears in two columns.

Regarding CSS, I could not figure out how to apply it to a partial line.

I could not use the HTML formatting technique as the output is in PDF format.

The output that I'm trying to produce is a letter which needs part of various lines in bold. Can what I'm trying to do be done? If yes, how can it be done?

Once again, thanks!


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
June 19, 2009, 03:46 PM
Mighty Max
Reproduce the problem using the CAR table.
Easier to help if we have a visual example.


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
June 19, 2009, 05:49 PM
JL
As requested, here's the code using CAR as an example:

DEFINE FILE CAR
PARAG1/A3000='ICARUS: Icarus is a character in Greek mythology. He is the son of Daedalus and is commonly known for his attempt to escape Crete by flight, which ended in a fall to his death.  Daedalus, father of Icarus, attempted to escape from his exile in the place of Crete, where he and his son were imprisoned at the hands of King Minos, the king for whom he had built the Labyrinth to imprison the Minotaur (half man, half bull). Daedalus, the superior craftsman, was exiled because he gave Ariadne, daughter of Minos, a clew of string in order to help Theseus, the enemy of Minos, survive the Labyrinth and defeat the Minotaur.  Daedalus fashioned two pairs of wings out of wax and feathers for himself and his son. Before they took off from the island, Daedalus warned his son not to fly too close to the sun, nor too close to the sea. Overcome by the giddiness that flying lent him, Icarus soared through the sky curiously, but in the process he came too close to the sun, which melted the wax. Icarus kept flapping his wings but soon realized that he had no feathers left and that he was only flapping his bare arms. And so, Icarus fell into the sea in the area which bears his name, the Icarian Sea near Icaria, an island southwest of Samos.';
END
TABLE FILE CAR
PRINT
     COUNTRY
HEADING
"<PARAG1"
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     WRAP=6.500000,
$
ENDSTYLE
END


I would like to bold "ICARUS:"


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
June 19, 2009, 06:00 PM
JL
Here's the code which lets me bold "ICARUS:" but it will not maintain my paragraph ... as demonstrated by the 3rd line in the HEADING but the paragraph is broken up in two columns. I would like to keep my paragraph as demonstrated by the 1st line in the HEADING. To be even more specific, I would also like to bold a phrase in the middle of the whole paragraph, say "Daedalus, the superior craftsman".

DEFINE FILE CAR
PARAG1/A3000='ICARUS: Icarus is a character in Greek mythology. He is the son of Daedalus and is commonly known for his attempt to escape Crete by flight, which ended in a fall to his death.  Daedalus, father of Icarus, attempted to escape from his exile in the place of Crete, where he and his son were imprisoned at the hands of King Minos, the king for whom he had built the Labyrinth to imprison the Minotaur (half man, half bull). Daedalus, the superior craftsman, was exiled because he gave Ariadne, daughter of Minos, a clew of string in order to help Theseus, the enemy of Minos, survive the Labyrinth and defeat the Minotaur.  Daedalus fashioned two pairs of wings out of wax and feathers for himself and his son. Before they took off from the island, Daedalus warned his son not to fly too close to the sun, nor too close to the sea. Overcome by the giddiness that flying lent him, Icarus soared through the sky curiously, but in the process he came too close to the sun, which melted the wax. Icarus kept flapping his wings but soon realized that he had no feathers left and that he was only flapping his bare arms. And so, Icarus fell into the sea in the area which bears his name, the Icarian Sea near Icaria, an island southwest of Samos.';

PARAG2A/A3000='ICARUS: ';
PARAG2B/A3000='Icarus is a character in Greek mythology. He is the son of Daedalus and is commonly known for his attempt to escape Crete by flight, which ended in a fall to his death.  Daedalus, father of Icarus, attempted to escape from his exile in the place of Crete, where he and his son were imprisoned at the hands of King Minos, the king for whom he had built the Labyrinth to imprison the Minotaur (half man, half bull). Daedalus, the superior craftsman, was exiled because he gave Ariadne, daughter of Minos, a clew of string in order to help Theseus, the enemy of Minos, survive the Labyrinth and defeat the Minotaur.  Daedalus fashioned two pairs of wings out of wax and feathers for himself and his son. Before they took off from the island, Daedalus warned his son not to fly too close to the sun, nor too close to the sea. Overcome by the giddiness that flying lent him, Icarus soared through the sky curiously, but in the process he came too close to the sun, which melted the wax. Icarus kept flapping his wings but soon realized that he had no feathers left and that he was only flapping his bare arms. And so, Icarus fell into the sea in the area which bears his name, the Icarian Sea near Icaria, an island southwest of Samos.';

END
TABLE FILE CAR
PRINT
     COUNTRY
HEADING
"<PARAG1"
" "
"<PARAG2A <+0> <PARAG2B"
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     WRAP=6.500000,
$
TYPE=HEADING,
     LINE=3,
     ITEM=1,
	 STYLE=BOLD,
$
TYPE=HEADING,
     LINE=3,
     ITEM=4,
	 WRAP=5,
$
ENDSTYLE
END



Thanks for your help!


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
June 20, 2009, 12:09 AM
susannah
read these articles on PDF formatting, written by Mickey Grackin
http://www.informationbuilders...elopers/htmlpdf.html
and
http://www.informationbuilders...s/htmlpdf_part2.html




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
June 22, 2009, 11:51 AM
Darin Lee
The short answer is no, there is not a way in PDF to bold part of the line. (Unless you re-read the PDF raw file and add additional styling in the PDf code.)

However, breaking the line into separate components will solve you're problem, you just need to break the lines a little differently.
Maybe create field1=Icarus, fields2=the rest of the first line, field3=the rest of the paragraph.


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
June 22, 2009, 01:40 PM
Mighty Max
HTML format seems to be the only solution to your problem.
Try opening up a case with IBI.
Webfocus can be used to run windows commands.
You could save the report in HTML format.
Then run a 3rd party tool to convert the HTML file to PDF.
Not sure if this helps or not.
  
DEFINE FILE CAR
PARAG1/A3000='<B>ICARUS:</B> Icarus is a character in Greek mythology. He is the son of <B>Daedalus</B> and is commonly known for his attempt to escape Crete by flight, which ended Samos.';
END
-*********
TABLE FILE CAR
PRINT
     COUNTRY
HEADING
" "
"<PARAG1"
" "
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,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     JUSTIFY=LEFT,
$
ENDSTYLE
END



WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
June 23, 2009, 05:37 AM
GamP
Taking Darin's idea just one step further:
DEFINE FILE CAR
PARAG1/A3000='ICARUS: Icarus is a character in Greek mythology. He is the son of Daedalus and is commonly' |
' known for his attempt to escape Crete by flight, which ended in a fall to his death.  Daedalus, father of' |
' Icarus, attempted to escape from his exile in the place of Crete, where he and his son were imprisoned at' |
' the hands of King Minos, the king for whom he had built the Labyrinth to imprison the Minotaur (half man,' |
' half bull). Daedalus, the superior craftsman, was exiled because he gave Ariadne, daughter of Minos, a clew' |
' of string in order to help Theseus, the enemy of Minos, survive the Labyrinth and defeat the Minotaur.' |
'  Daedalus fashioned two pairs of wings out of wax and feathers for himself and his son. Before they took' |
' off from the island, Daedalus warned his son not to fly too close to the sun, nor too close to the sea.' |
' Overcome by the giddiness that flying lent him, Icarus soared through the sky curiously, but in the process' | 
' he came too close to the sun, which melted the wax. Icarus kept flapping his wings but soon realized that he' |
' had no feathers left and that he was only flapping his bare arms. And so, Icarus fell into the sea in the' |
' area which bears his name, the Icarian Sea near Icaria, an island southwest of Samos.';
CAPTION/A21 = GETTOK(PARAG1,3000,1,':',20,'A20') | ':';
STORY/A3000 = LJUST(3000,GETTOK(PARAG1,3000,2,':',3000,'A3000'),STORY); 
END
TABLE FILE CAR
PRINT
     COUNTRY
HEADING
"<CAPTION"
"<STORY"
" "
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT PDF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     GRID=OFF,
     FONT='ARIAL',
     SIZE=10,
     JUSTIFY=LEFT,
$
TYPE=HEADING,
     LINE=1,
     STYLE=BOLD,
$
TYPE=HEADING,
     LINE=2,
     WRAP=6.500000,
$
ENDSTYLE
END

This might be a compromise to what you really want, but it does give you a possible solution.

Hope this helps ...

Edited because the code had not been copied correctly)

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


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
June 23, 2009, 09:45 AM
JL
Thanks for the suggestions! We just opened a case with IBI. I'll update this link as to its outcome.

I do love the breaking up the variable suggestion as it keeps the code in the one focexec. But what a pain, since there are various differing lengths variables which make up the paragraph in real life and possibly I should check if a fixed-width or non-proportional font type will have any effect.

Thanks!!


Year(s) of experience in WebFOCUS: 5+. Using WebFOCUS 7.7.03 on Windows platform with Oracle/SQL Server.
April 11, 2014, 01:49 AM
Rakesh Boddu
Hi JL,

I saw this post in focal point.

I need exactly same what you are trying.

I need half of heading in BOLD and remaining in NORMAL style.

You raised case with IBI .Did you get any solution.

Help me.I am searching from week..Its very important.


Thanks in advance.


WebFOCUS 8.0.03
Windows, All Outputs