| View previous topic :: View next topic |
| Author |
Message |
Freddy Junior Guest
|
Posted: Sun Mar 25, 2007 7:39 pm Post subject: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
Hi,
I need to show in a region a specific HTML file; this special file is
created saving a MS Excel worksheet as HTML.
To do it, I add a TIWLayoutMgrHTML to the form and set is as LayoutMgr
for the region to show; at runtime, I do
IWLayoutMgrHTML1.HTML.LoadFromFile('c:\temp\excel_file.htm').
Unfortunately the output is not the same of opening the htm file
directly with web browser.
Why ?
As a simple testcase, do the following:
- create a new Excel file
- populate the first three cells with random values
- format the first in bold, the second with red color and the third with
yellow background
- save the file as HTML (c:\temp\test_html_excel.htm)
- create a new IntraWeb project and drop a TIWLayoutMgrHTML
- create a region and set it aligned as alBottom; then set its LayoutMgr
with IWLayoutMgrHTML1
- in IWAppForm1 OnCreate event, simply do:
IWLayoutMgrHTML1.HTML.LoadFromFile('c:\temp\test_html_excel.htm')
Running the application the region will show the three values but with
no format (bold, red, yellow).
Is it my mistake ?
TIA. |
|
| Back to top |
|
 |
Jason Southwell Guest
|
Posted: Mon Mar 26, 2007 9:05 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | I need to show in a region a specific HTML file; this special file is
created saving a MS Excel worksheet as HTML.
To do it, I add a TIWLayoutMgrHTML to the form and set is as LayoutMgr
|
Wow... that's doing things the hard way.
You can store the html file in your files folder and use the
TIWURLWindow component and point to it via a url. Alternatively, you
can use the TIWText component and put the html directly in the Lines
property with RawText set to True. |
|
| Back to top |
|
 |
Freddy Junior Guest
|
Posted: Tue Mar 27, 2007 7:59 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | TIWURLWindow component and point to it via a url. Alternatively, you
can use the TIWText component and put the html directly in the Lines
property with RawText set to True.
|
The TIWText works only for "simple" file...
I need to show "complex" worksheet with charts.
Anyway, thanks for the suggestion ! |
|
| Back to top |
|
 |
Jason Southwell Guest
|
Posted: Tue Mar 27, 2007 8:02 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | The TIWText works only for "simple" file...
I need to show "complex" worksheet with charts.
Anyway, thanks for the suggestion !
|
Then TIWURLWindow is the way to go. |
|
| Back to top |
|
 |
Freddy Junior Guest
|
Posted: Tue Mar 27, 2007 8:19 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | Then TIWURLWindow is the way to go.
|
But my Intraweb application is stand alone, so I don't know how to
compose the URL...
Can I use the format "file:///C:/Temp/xxx.htm" ? |
|
| Back to top |
|
 |
Jason Southwell Guest
|
Posted: Fri Mar 30, 2007 1:06 am Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
Freddy Junior wrote:
| Quote: | Then TIWURLWindow is the way to go.
But my Intraweb application is stand alone, so I don't know how to
compose the URL...
Can I use the format "file:///C:/Temp/xxx.htm" ?
|
Place the file in the ExeDir/Files subdirectory. Then refer to it via:
/files/xxx.htm |
|
| Back to top |
|
 |
Freddy Junior Guest
|
Posted: Fri Mar 30, 2007 1:44 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | Place the file in the ExeDir/Files subdirectory. Then refer to it via:
/files/xxx.htm
|
Ok, I've tried this way.
It does function if the file is "simple"; but it raises "404 File not
found" if the file refers to a subdir.
For example xxx.htm contains objects (xml, gif, css, htm, etc.) stored
in xxx_file subdir. |
|
| Back to top |
|
 |
Jason Southwell Guest
|
Posted: Fri Mar 30, 2007 7:58 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | It does function if the file is "simple"; but it raises "404 File not
found" if the file refers to a subdir.
For example xxx.htm contains objects (xml, gif, css, htm, etc.) stored
in xxx_file subdir.
|
Make sure that your document uses relative pathing and that the links
are in URL format and not File format.
Also, make sure you have AllowSubdirectories set to true in the
servercontroller. |
|
| Back to top |
|
 |
Freddy Junior Guest
|
Posted: Fri Mar 30, 2007 9:05 pm Post subject: Re: TIWLayoutMgrHTML and Excel workbook saved as HTML |
|
|
| Quote: | Also, make sure you have AllowSubdirectories set to true in the
servercontroller.
|
Wow !
I've set AllowSubFolders tu true on the IWServerController form and it
now works as a charm !
Thank you Jason very much. |
|
| Back to top |
|
 |
|