To write the VIP code for printing from your own made program is “worth” only if the users of that program would use that printing rather much. If it is worth the time you can make the code to print very sophisticated documents directly from the VIP program. But as said it is a considerable “investment”.
The easiest way to write fast the VIP code to produce a document with charts, different fonts, headers, lists etc, is to make the code to write the different pieces with the needed html codes in a file. Then the formed html-file is easy to be printed with numerous different programs and to be send as email or put on your internet site.
Here is an example how I made the code for the html page of EU countries import/export development with USA, China and Russia.
https://karirast.com/euros/GB/EU_geoPol_countries.html
Code: Select all
predicates
makeEUgeoPoliticalPage:(string LANG,string* Countries).
clauses
makeEUgeoPoliticalPage(Language,Countries):-
O= outputStream_file::createUtf8(string::format("%s%\\EU_geoPol_countries.html",uljasCore::euroTulosteet,Language)),
FLName="EU_geoPol_countries.html",
htmlStuff::htmlStart(O,Language),
O:write(@"<style>
table, th, td {
border: 1px solid black;
}
img.pictures {
width: 60%;
margin: auto;
display: block;}
</style>"),
if Language = "FIN" then
O : write("<title>EU maiden vienti ja tuonti suurvaltojen USA, Kiina ja Venäjä kanssa</title>\n")
else
O : write("<title>EU countries' exports and imports with the great powers, USA, China and Russia</title>\n")
end if,
htmlStuff::metaViewport(O),
htmlStuff::htmlContent(O,Language),
O : write("\n</head>"),
O : write("\n<body>"),
htmlStuff::topRowEU(O,"Trade",Language),
htmlStuff::languageEurostatLink(O,Language,FLName),
if Language = "FIN" then
O : write("\n<H1>EU maiden vienti ja tuonti suurvaltojen USA, Kiina ja Venäjä kanssa</H1>\n")
else
O : write("<H1>EU countries' exports and imports with the great powers, USA, China and Russia</H1>\n")
end if,
foreach G in Countries do
O:writef("\n<li><a href=\"#%\">%s (%)</a>",G,getCountryName(G,Language),G)
end foreach,
foreach C in Countries do
O:writef("\n<br><hr><a name=\"%\"><H1>% (%)</H1>",C,getCountryName(C,Language),C),
O:writef("\n<BR><img class=pictures src=\"gpol_%.png\" alt=\"%s\" class=\"center\"/>\n<p>\n<p>",getCountryName(C,Language),Language)
end foreach,
O:write("\n</BODY>\n</HTML>"),
O:close().