FastReports HTML Export - cpstevenc - 04-09-2019
Using latest IW14 and Tokyo 10.2.3
I can run a simple FastReport via IntraWeb to export to HTML.
Here is an idea of what gets created in the code during the FR3 to HTML export.
The HTML side of things show up. But the IMG links in the HTML source code are broken.
Code: C:.
└───user
└───Leo9A5ucHukqH2SDZ7a9iq
└───Leo9A5ucHukqH2SDZ7a9iquntitled.files
Code: Directory of C:\Users\CPStevenC\AppData\Local\Temp\01c15az1at
04/09/19 01:17 PM <DIR> .
04/09/19 01:17 PM <DIR> ..
04/09/19 01:17 PM 7,018 ATZ0J0DExMhIustYzUTqbsDtW.tmp
04/09/19 01:17 PM <DIR> user
Code: Directory of C:\Users\CPStevenC\AppData\Local\Temp\01c15az1at\user\Leo9A5ucHukqH2SDZ7a9iq
04/09/19 01:17 PM <DIR> .
04/09/19 01:17 PM <DIR> ..
04/09/19 01:17 PM 6,953 Leo9A5ucHukqH2SDZ7a9iquntitled
04/09/19 01:17 PM <DIR> Leo9A5ucHukqH2SDZ7a9iquntitled.files
Code: Directory of C:\Users\CPStevenC\AppData\Local\Temp\01c15az1at\user\Leo9A5ucHukqH2SDZ7a9iq\Leo9A5ucHukqH2SDZ7a9iquntitled.files
04/09/19 01:17 PM <DIR> .
04/09/19 01:17 PM <DIR> ..
04/09/19 01:17 PM 466 img0.png
04/09/19 01:17 PM 568 img1.png
04/09/19 01:17 PM 1,060 img2.png
04/09/19 01:17 PM 885 img3.png
04/09/19 01:17 PM 3,833 img4.png
The report to HTML looks like this.
It "Looks" like the path in the IMG Src for each image looks ok?
Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name=Generator content="FastReport 5.0 http://www.fast-report.com">
<title>untitled</title>
<style type="text/css">
<!--
.page_break {page-break-before: always;}
.s0 {
font-family: Arial;
font-size: 13px;
color: #000000; font-style: normal;
background-color: transparent;
text-align: Left; vertical-align: Top;
}
.s1 {
font-family: Arial;
font-size: 13px;
color: #000000; font-style: normal;
background-color: #C0C0C0;
text-align: Left; vertical-align: Top;
}
.s2 {
font-family: Arial;
font-size: 1px;
color: #000000; font-style: normal;
background-color: #C0C0C0;
border-left-color:#000000; border-left-style: solid; border-left-width: 1px;
border-right-color:#000000; border-right-style: solid; border-right-width: 1px;
border-top-color:#000000; border-top-style: solid; border-top-width: 1px;
border-bottom-color:#000000; border-bottom-style: solid; border-bottom-width: 1px;
text-align: Left; vertical-align: Top;
padding-top: 1px;
padding-left: 2px;
}
.s3 {
font-family: Arial;
font-size: 12px;
color: #000000; font-style: normal;
background-color: transparent;
text-align: Left; vertical-align: Top;
}
.s4 {
font-family: Arial;
font-size: 13px;
color: #000000; font-style: normal;
background-color: transparent;
border-left-color:#000000; border-left-style: solid; border-left-width: 1px;
border-right-color:#000000; border-right-style: solid; border-right-width: 1px;
border-top-color:#000000; border-top-style: solid; border-top-width: 1px;
border-bottom-color:#000000; border-bottom-style: solid; border-bottom-width: 1px;
text-align: Left; vertical-align: Top;
padding-top: 1px;
padding-left: 2px;
}
.s5 {
font-family: Arial;
font-size: 13px;
color: #000000; font-style: normal;
background-color: transparent;
border-left-width: 0px;
border-right-color:#000000; border-right-style: solid; border-right-width: 1px;
border-top-color:#000000; border-top-style: solid; border-top-width: 1px;
border-bottom-color:#000000; border-bottom-style: solid; border-bottom-width: 1px;
text-align: Left; vertical-align: Top;
padding-top: 1px;
padding-left: 2px;
}
.s6 {
font-family: Arial;
font-size: 13px;
color: #000000; font-style: normal;
background-color: transparent;
border-left-color:#000000; border-left-style: solid; border-left-width: 1px;
border-right-color:#000000; border-right-style: solid; border-right-width: 1px;
border-top-width: 0px;
border-bottom-color:#000000; border-bottom-style: solid; border-bottom-width: 1px;
text-align: Left; vertical-align: Top;
padding-top: 1px;
padding-left: 2px;
}
.s7 {
font-family: Arial;
font-size: 13px;
color: #000000; font-style: normal;
background-color: transparent;
border-left-width: 0px;
border-right-color:#000000; border-right-style: solid; border-right-width: 1px;
border-top-width: 0px;
border-bottom-color:#000000; border-bottom-style: solid; border-bottom-width: 1px;
text-align: Left; vertical-align: Top;
padding-top: 1px;
padding-left: 2px;
}
P {margin: 0;}
-->
</style>
</head>
<body
bgcolor="#FFFFFF" text="#000000">
<a name="PageN1"></a>
<table width="695" border="0" cellspacing="0" cellpadding="0">
<tr style="height: 1px">
<td width="11"/>
<td width="53"/>
<td width="178"/>
<td width="30"/>
<td width="42"/>
<td width="4"/>
<td width="76"/>
<td width="23"/>
<td width="53"/>
<td width="76"/>
<td width="75"/>
<td width="38"/>
<td width="8"/>
<td width="30"/>
</tr>
<tr style="height:55px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td colspan="2" rowspan="2" class="s3" style="font-size:1px"><img src="Leo9A5ucHukqH2SDZ7a9iquntitled.files/img0.png" width="130" height="92" alt=""></td>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:33px">
<td colspan="4" rowspan="2" class="s0" style="font-size:1px"><img src="Leo9A5ucHukqH2SDZ7a9iquntitled.files/img1.png" width="273" height="46" alt=""></td>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:11px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:40px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:33px">
<td/>
<td/>
<td colspan="2" rowspan="2" class="s0" style="font-size:1px"><img src="Leo9A5ucHukqH2SDZ7a9iquntitled.files/img2.png" width="209" height="126" alt=""></td>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:88px">
<td/>
<td/>
<td/>
<td/>
<td colspan="6" rowspan="3" class="s0" style="font-size:1px"><img src="Leo9A5ucHukqH2SDZ7a9iquntitled.files/img3.png" width="341" height="235" alt=""></td>
<td/>
<td/>
</tr>
<tr style="height:15px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:125px">
<td/>
<td colspan="2" rowspan="9" class="s2" style="font-size:1px"> </td>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:40px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:18px">
<td/>
<td/>
<td/>
<td/>
<td class="s4">1</td>
<td colspan="2" class="s5" style="font-size:1px"> </td>
<td class="s5" style="font-size:1px"> </td>
<td class="s5" style="font-size:1px"> </td>
<td colspan="3" class="s5" style="font-size:1px"> </td>
</tr>
<tr style="height:18px">
<td/>
<td/>
<td/>
<td/>
<td class="s6" style="font-size:1px"> </td>
<td colspan="2" class="s7">2</td>
<td class="s7" style="font-size:1px"> </td>
<td class="s7" style="font-size:1px"> </td>
<td colspan="3" class="s7" style="font-size:1px"> </td>
</tr>
<tr style="height:18px">
<td/>
<td/>
<td/>
<td/>
<td class="s6" style="font-size:1px"> </td>
<td colspan="2" class="s7" style="font-size:1px"> </td>
<td class="s7">3</td>
<td class="s7" style="font-size:1px"> </td>
<td colspan="3" class="s7" style="font-size:1px"> </td>
</tr>
<tr style="height:18px">
<td/>
<td/>
<td/>
<td/>
<td class="s6" style="font-size:1px"> </td>
<td colspan="2" class="s7" style="font-size:1px"> </td>
<td class="s7" style="font-size:1px"> </td>
<td class="s7">4</td>
<td colspan="3" class="s7" style="font-size:1px"> </td>
</tr>
<tr style="height:18px">
<td/>
<td/>
<td/>
<td/>
<td class="s6" style="font-size:1px"> </td>
<td colspan="2" class="s7" style="font-size:1px"> </td>
<td class="s7" style="font-size:1px"> </td>
<td class="s7" style="font-size:1px"> </td>
<td colspan="3" class="s7">5</td>
</tr>
<tr style="height:33px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr style="height:283px">
<td/>
<td/>
<td/>
<td colspan="8" rowspan="2" class="s0" style="font-size:1px"><img src="Leo9A5ucHukqH2SDZ7a9iquntitled.files/img4.png" width="352" height="315" alt=""></td>
<td/>
</tr>
<tr style="height:22px">
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
</table>
</body>
</html>
I assume while the files are there, Intraweb won't let them be accessed... so the code here ( stripped down ) takes care of HTML file that was generated side of things..
but the images don't tag along in this kind of action. Did some searching for docs on this.. but didnt seem to find exactly what I am looking for.
Code: fstream := TMemoryStream.Create;
fstream.LoadFromFile(fname); // fname = filename of the HTML file
furl := TIWAppCache.StreamToCacheFile(Self, fstream, 'html', ctSession);
WebApplication.NewWindow(furl); // take the above fURL that gets generated and spit the user to that address in a new tab
I have submitted a ticket with FastReports about an option to base64 encode images into the HTML source, so be only 1 single file.. but could be years to never on that
ever getting addressed by them.
RE: FastReports HTML Export - kudzu - 04-10-2019
There are a few ways to do this. I suggest you look in our demos for the CGI runner tool.
Basically you can call out to FR either directly or as a exe if you need. Then as it emits its files, you grab them and move them to the user session area of IW and patch up the URLs to match.
RE: FastReports HTML Export - DanBarclay - 04-11-2019
Here is a thread regarding reports on the old forum.
https://forums.embarcadero.com/thread.jspa?threadID=260951&tstart=0
The thread is still there, but the old forum is "read only" so you can't reply or ask questions there. Feel free to post back some of those messages here if you have questions on them. For info, I haven't done this so can't help but others can.
Dan
|