Атцы, вопрос из области "подскажите куда смотреть"... может что посоветуете
Задача: создать HTML файл, наполнить его данными и открыть в Excel(через браузер).
Наполнение данными происходит при помощи JSP. Все работает замечательно пока нет необходимости сохранять данные на нескольких листах Excel.
Простите за то, что листинги большие, но это готовые файлы.
Итак, файл с одним листом:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 11">
<link rel=File-List href="Book1_files/filelist.xml">
<link rel=Edit-Time-Data href="Book1_files/editdata.mso">
<link rel=OLE-Object-Data href="Book1_files/oledata.mso">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Dgabadulin</o:Author>
<o:LastAuthor>Dgabadulin</o:LastAuthor>
<o:Created> 2010 - 03 -10T15: 59 :24Z</o:Created>
<o:LastSaved> 2010 - 03 -10T15: 59 :58Z</o:LastSaved>
<o:Company>xxx</o:Company>
<o:Version> 11 . 9999 </o:Version>
</o:DocumentProperties>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\,";
mso-displayed-thousand-separator:" ";}
@page
{margin: 1 .0in .75in 1 .0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate: 0 ;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size: 10 .0pt;
font-weight: 400 ;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset: 204 ;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id: 0 ;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size: 10 .0pt;
font-weight: 400 ;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset: 204 ;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate: 0 ;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number> 3 </x:Number>
<x:ActiveRow> 3 </x:ActiveRow>
<x:ActiveCol> 1 </x:ActiveCol>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight> 11730 </x:WindowHeight>
<x:WindowWidth> 19050 </x:WindowWidth>
<x:WindowTopX> 0 </x:WindowTopX>
<x:WindowTopY> 60 </x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple>
<table x:str border= 0 cellpadding= 0 cellspacing= 0 width= 128 style='border-collapse:
collapse;table-layout:fixed;width:96pt'>
<col width= 64 span= 2 style='width:48pt'>
<tr height= 17 style='height:12.75pt'>
<td height= 17 width= 64 style='height:12.75pt;width:48pt'></td>
<td width= 64 style='width:48pt'></td>
</tr>
<tr height= 34 style='height:25.5pt;mso-xlrowspan:2'>
<td height= 34 colspan= 2 style='height:25.5pt;mso-ignore:colspan'></td>
</tr>
<tr height= 17 style='height:12.75pt'>
<td height= 17 style='height:12.75pt'></td>
<td>qwerty</td>
</tr>
<![if supportMisalignedColumns]>
<tr height= 0 style='display:none'>
<td width= 64 style='width:48pt'></td>
<td width= 64 style='width:48pt'></td>
</tr>
<![endif]>
</table>
</body>
</html>
Файл с двумя листами:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1251">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 11">
<link rel=File-List href="Book1_files/filelist.xml">
<link rel=Edit-Time-Data href="Book1_files/editdata.mso">
<link rel=OLE-Object-Data href="Book1_files/oledata.mso">
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Author>Dgabadulin</o:Author>
<o:LastAuthor>Dgabadulin</o:LastAuthor>
<o:Created> 2010 - 03 -10T15: 59 :24Z</o:Created>
<o:LastSaved> 2010 - 03 -10T15: 59 :58Z</o:LastSaved>
<o:Company>xxx</o:Company>
<o:Version> 11 . 9999 </o:Version>
</o:DocumentProperties>
</xml><![endif]-->
<style>
<!--table
{mso-displayed-decimal-separator:"\,";
mso-displayed-thousand-separator:" ";}
@page
{margin: 1 .0in .75in 1 .0in .75in;
mso-header-margin:.5in;
mso-footer-margin:.5in;}
tr
{mso-height-source:auto;}
col
{mso-width-source:auto;}
br
{mso-data-placement:same-cell;}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate: 0 ;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size: 10 .0pt;
font-weight: 400 ;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset: 204 ;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id: 0 ;}
td
{mso-style-parent:style0;
padding-top:1px;
padding-right:1px;
padding-left:1px;
mso-ignore:padding;
color:windowtext;
font-size: 10 .0pt;
font-weight: 400 ;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset: 204 ;
mso-number-format:General;
text-align:general;
vertical-align:bottom;
border:none;
mso-background-source:auto;
mso-pattern:auto;
mso-protection:locked visible;
white-space:nowrap;
mso-rotate: 0 ;}
-->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number> 3 </x:Number>
<x:ActiveRow> 3 </x:ActiveRow>
<x:ActiveCol> 1 </x:ActiveCol>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>Sheet2</x:Name>
<x:WorksheetOptions>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number> 3 </x:Number>
<x:ActiveRow> 3 </x:ActiveRow>
<x:ActiveCol> 1 </x:ActiveCol>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight> 11730 </x:WindowHeight>
<x:WindowWidth> 19050 </x:WindowWidth>
<x:WindowTopX> 0 </x:WindowTopX>
<x:WindowTopY> 60 </x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple>
<table x:str border= 0 cellpadding= 0 cellspacing= 0 width= 128 style='border-collapse:
collapse;table-layout:fixed;width:96pt'>
<col width= 64 span= 2 style='width:48pt'>
<tr height= 17 style='height:12.75pt'>
<td height= 17 width= 64 style='height:12.75pt;width:48pt'></td>
<td width= 64 style='width:48pt'></td>
</tr>
<tr height= 34 style='height:25.5pt;mso-xlrowspan:2'>
<td height= 34 colspan= 2 style='height:25.5pt;mso-ignore:colspan'></td>
</tr>
<tr height= 17 style='height:12.75pt'>
<td height= 17 style='height:12.75pt'></td>
<td>qwerty</td>
</tr>
<![if supportMisalignedColumns]>
<tr height= 0 style='display:none'>
<td width= 64 style='width:48pt'></td>
<td width= 64 style='width:48pt'></td>
</tr>
<![endif]>
</table>
</body>
</html>
И собственно, вопрос: Что нужно добавить во второй файл, чтобы средствами HTML вывести фразу "hello world from second sheet:)" на втором листе?
ЗЫ FAQ для любопытных:
1. "а нафига тебе это?" - механизм выгрузки данных для крупной ERP-системы
2. "почему не посмотришь как Excel сохраняет книгу с несколькими листами в HTML?" - смотрел, такой вариант не подходит, т.к. средство которое будет наполнять данными этот файл не умеет(ну или я не умею:-)) заполнять сразу несколько HTML-документов
3. "что это за средство?" - Oracle Reports 10g
4. "почему не спросил на форуме Oracle" - спросил
5."сделай лучше так..." - В силу ряда факторов было бы лучше если бы нашелся ответ на мой вопрос :)
Спасибо!