📄 example07.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Pb2xls developer's reference</title>
<link rel="STYLESHEET" href="style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<!-- Reference header -->
<table width="100%" cellpadding=0 cellspacing=0>
<tr>
<td class=footer_text width=20%>Release 1.6<br>15 September 2004</td>
<td class=doc_header align="center">Developer's reference</td>
<td width=20% align="right">
<a class=hidden_link href="http://desta.com.ua/pb2xls/"><img src=pb2xls_logo.gif alt="PB2XLS for PowerBuilder" border=0></a></td>
</tr>
</table>
<hr>
<table cellspacing=0 cellpadding=0 class=path_table> <tr><td><a class=hidden_link href=reference.htm>Reference</a> > <a class=hidden_link href=examples.htm>Examples</a> > <a class=hidden_link href=example07.htm>example07</a></td></tr> </table>
<table width=100%><tr><td class=light_line></td></tr></table><p class=head2>
Example07
</p>
<pre>
yn_xls_workbook book
<a class=hidden_link href=n_xls_worksheet.htm>n_xls_worksheet</a> sheet1
<a class=hidden_link href=n_xls_format.htm>n_xls_format</a> format1
<a class=hidden_link href=n_xls_format.htm>n_xls_format</a> format2
<a class=hidden_link href=n_xls_format.htm>n_xls_format</a> format3
//for Excel97:
book = create <a class=hidden_link href=n_xls_workbook_v97.htm>n_xls_workbook_v97</a>
//for Excel5:
//book = create <a class=hidden_link href=n_xls_workbook_v5.htm>n_xls_workbook_v5</a>
book.<a class=hidden_link href=of_create.htm>of_create</a>("<a class=hidden_link href=example07.htm>example07</a>.xls")
sheet1 = book.<a class=hidden_link href=of_add_worksheet.htm>of_add_worksheet</a>('sheet 1')
format1 = book.<a class=hidden_link href=of_add_format.htm>of_add_format()</a>
format1.<a class=hidden_link href=of_set_color.htm>of_set_color</a> ( 'red' )
format1.<a class=hidden_link href=of_set_bold.htm>of_set_bold</a> ( true )
sheet1.<a class=hidden_link href=of_write.htm>of_write</a>(0, 0, 'HELLO', format1)
format2 = book.<a class=hidden_link href=of_add_format.htm>of_add_format()</a>
format2.<a class=hidden_link href=of_set_color.htm>of_set_color</a> ( 'blue' )
format2.<a class=hidden_link href=of_set_italic.htm>of_set_italic</a> ( true )
format2.<a class=hidden_link href=of_set_num_format.htm>of_set_num_format</a> ( '#,##0.00' )
sheet1.<a class=hidden_link href=of_write.htm>of_write</a>(1, 0, 25456.4567, format2)
format3 = book.<a class=hidden_link href=of_add_format.htm>of_add_format()</a>
format3.<a class=hidden_link href=of_set_num_format.htm>of_set_num_format</a> ( 'dd.mm.yyyy hh:mm:ss' )
sheet1.<a class=hidden_link href=of_write.htm>of_write</a>(2, 0, datetime(today(),now()), format3)
book.<a class=hidden_link href=of_close.htm>of_close()</a></pre>
<p class=head2>
Screenshot
</p>
<img src="example07.gif" alt="" border="0">
<table border=0 width="100%" cellpadding=0 cellspacing=0>
<tr><td colspan=2 class=empty_line></td></tr>
<tr><td colspan=2 class=line></td></tr>
<tr>
<td class=footer_text align="left">© 2003, 2004 <a class=hidden_link href="http://desta.com.ua">Desta, Ltd.</a> All rights reserved.</td>
<td class=footer_text align="right">
<a class=hidden_link href="mailto:pb2xls_support@Desta.com.ua">SupportDesk</a></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -