- 浏览: 83648 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
burningman:
没看明白什么意思。
WebService身份验证解决方案 -
minglelui:
调用的是webservice。服务器端调用webservice ...
Java使用httprequest来访问WebService3 -
containsoft:
楼主,你这是调用的webservice还是servlet啊?一 ...
Java使用httprequest来访问WebService3
This code is designed to create a non-tabbed table of two rows and five columns in a rich text field to display information. I've added in static text but it could be used to display information from a document as well.
I've implemented this as an agent, as the code this came from was used in this way, but it could be a button, query open etc. You can use the same classes to create a tabbed table, but this tip doesn't do that. This code works with R6 and above only.
Code: Sub Initialize Dim sess As New NotesSession Dim ws As New NotesUIWorkspace Dim dbCurr As NotesDatabase Dim docProcess As NotesDocument Dim dcProcess As NotesDocumentCollection Dim rtiItem As NotesRichTextItem Dim rtnav As NotesRichTextNavigator Dim rtt As NotesRichTextTable Dim rtsTableHeader As NotesRichTextStyle Dim rtsTableRow As NotesRichTextStyle Dim sData(4) As String Dim sHeaders(4) As String Dim sPrefix As String Dim iCtr As Integer Dim iRow As Integer Dim iCol As Integer 'We declare an array of paragraph styles to pass in when creating the table Dim rtpsCols(4) As NotesRichTextParagraphStyle Set dbCurr = sess.CurrentDatabase Set dcProcess = dbCurr.UnprocessedDocuments If dcProcess.Count > 0 Then 'These are display headers for the table sHeaders(0) = "Header 1" sHeaders(1) = "Header 2" sHeaders(2) = "Header 3" sHeaders(3) = "Header 4" sHeaders(4) = "Header 5" 'An array of data for the Columns sData(0) = "Col 1" sData(1) = "Col 2" sData(2) = "Col 3" sData(3) = "Col 4" sData(4) = "Col 5" 'Set up the text styles we want to use for displaying the text Set rtsTableHeader = sess.CreateRichTextStyle rtsTableHeader.FontSize = 10 rtsTableHeader.Bold = True Set rtsTableRow= sess.CreateRichTextStyle rtsTableRow.FontSize = 8 rtsTableRow.Bold = False 'Set up the paragraph styles for the table 'The column widths are set by setting the left margin to 0 then the right margin to 'what the column width should be Set rtpsCols(0) = sess.CreateRichTextParagraphStyle 'This column in left aligned rtpsCols(0).Alignment = 0 rtpsCols(0).Firstlineleftmargin = 0 rtpsCols(0).Leftmargin = 0 rtpsCols(0).RightMargin = RULER_ONE_CENTIMETER * 7.51 'This column is centre aligned Set rtpsCols(1) = sess.CreateRichTextParagraphStyle rtpsCols(1).Alignment =3 rtpsCols(1).Firstlineleftmargin = 0 rtpsCols(1).Leftmargin = 0 rtpsCols(1).RightMargin = RULER_ONE_CENTIMETER * 1.43 Set rtpsCols(2) = sess.CreateRichTextParagraphStyle rtpsCols(2).Alignment =3 rtpsCols(2).Firstlineleftmargin = 0 rtpsCols(2).Leftmargin = 0 rtpsCols(2).RightMargin = RULER_ONE_CENTIMETER * 2.18 Set rtpsCols(3) = sess.CreateRichTextParagraphStyle rtpsCols(3).Alignment =3 rtpsCols(3).Firstlineleftmargin = 0 rtpsCols(3).Leftmargin = 0 rtpsCols(3).RightMargin = RULER_ONE_CENTIMETER * 1.68 Set rtpsCols(4) = sess.CreateRichTextParagraphStyle rtpsCols(4).Alignment =0 rtpsCols(4).Firstlineleftmargin = 0 rtpsCols(4).Leftmargin = 0 rtpsCols(4).RightMargin = RULER_ONE_CENTIMETER * 10.73 Set docProcess = dcProcess.GetFirstDocument While Not docProcess Is Nothing 'I've used good old Body as my rich text field Set rtiItem = docProcess.GetFirstItem("Body") 'The styles only have about three fonts that can be used by default 'Arial isn't one of them so we have to 'Get' it from the rich text item 'I don't really understand this but that's how it works... rtsTableHeader.NotesFont = rtiItem.GetNotesFont ("Arial", True) rtsTableRow.NotesFont = rtiItem.GetNotesFont("Arial", True) 'We create the table, with 1 row, 5 columns, "" for the title, so it's not a tabbed table '1440 is the margin in twips, which is an inch, or 2.54*567(which is a cm in twips) 'rtpsCols is the array of rich text paragraph styles we set up earlier Call rtiItem.AppendTable(1,5,"",1440, rtpsCols) Call docProcess.Save(True,False) 'In order to get the table elements we have to use a couple of methods 'One is to get the table as a rich text table element 'The other is just to get navigate to the columns so we can insert text 'This element enables us to navigate through the rich text field Set rtnav = rtiItem.CreateNavigator 'Get the table as a rich text table element so we can add rows Set rtt = rtnav.GetFirstElement(RTELEM_TYPE_TABLE) 'Once you set a style the rich text field has that style until we say otherwise Call rtiItem.AppendStyle(rtsTableHeader) 'This navigates us to the first table cell Call rtnav.FindFirstElement (RTELEM_TYPE_TABLECELL) For iCol = 1 To 5 Step 1 'Add in our text then get the next cell Call rtiItem.BeginInsert(rtnav) Call rtiItem.AppendText(sHeaders(iCol-1)) Call rtiItem.EndInsert Call rtnav.FindNextElement (RTELEM_TYPE_TABLECELL) Next 'Now we change the style to our row style Call rtiItem.AppendStyle(rtsTableRow) 'Add a row, then go to the first cell in that row, which will be the next cell Call rtt.AddRow Call rtnav.FindNextElement (RTELEM_TYPE_TABLECELL) For iCtr=0 To 4 'Add in our text then get the next cell Call rtiItem.BeginInsert(rtnav) Call rtiItem.AppendText(sData(iCtr)) Call rtiItem.EndInsert Call rtnav.FindNextElement (RTELEM_TYPE_TABLECELL) Next Call rtt.AddRow Call rtnav.FindNextElement (RTELEM_TYPE_TABLECELL) For iCtr=0 To 4 Call rtiItem.BeginInsert(rtnav) Call rtiItem.AppendText(sData(iCtr)) Call rtiItem.EndInsert Call rtnav.FindNextElement (RTELEM_TYPE_TABLECELL) Next Call docProcess.Save(True,False) Set docProcess = dcProcess.GetNextDocument(docProcess) Wend End If End Sub
发表评论
-
代码复用的小例子
2010-09-10 14:46 822Sub CodeShare(Source As Button) ... -
扩展Implode方法
2010-09-09 18:01 1036问题描述:Lotuscript中提供的Implode对整数数组 ... -
把导入的图片还原为图片文件
2010-09-08 22:56 1587Sub Initialize() Dim s As New ... -
Excel编程
2010-09-07 15:46 922xlWorkSheet.Cells(1,iYear).Valu ... -
如何获取视图中列的多值域的值?
2010-09-07 14:45 1117http://www-10.lotus.com/ldd/nd6 ... -
创建时间域
2010-09-03 15:23 743Dim dt As NotesDateTime Dim dtI ... -
如何察看隐藏视图
2010-08-30 14:12 714goto可以间接查看视图 按着ctrl+shift,通过got ... -
About response doc
2010-08-26 10:13 771http://www.dominopower.com/issu ... -
NotesUIDocument和NotesDocument的差别
2010-08-10 11:52 1396测试目的:某域值更新后,隐藏条件设置与次域有关的相关域的隐藏立 ... -
Is Not a form
2010-08-06 11:15 775http://www-10.lotus.com/ldd/nd8 ... -
删除Profile文档的几种方法
2010-07-16 16:17 1047http://www-01.ibm.com/support/d ... -
Java agent
2010-07-15 11:09 787http://space.itpub.net/10114847 ... -
lotus 8.5
2010-07-09 13:44 649http://space.itpub.net/14751907 ... -
外发邮件挂起的处理
2010-06-25 11:10 936Question: You have outgoing ma ... -
邮件链接
2010-06-14 14:56 662拷贝数据库链接然后另存为ndl文件 http://we ... -
在Notes视图中游弋
2010-06-11 00:47 737Sub Initialize() Dim session As ... -
运行代理权限问题
2010-06-10 16:43 888Just to head off any technical ... -
在Lotus开发中引入jar包
2010-06-06 21:31 720http://www.docin.com/p-41744081 ... -
实时更新RTF域的内容
2010-06-05 23:54 705call uidoc.close call ws.editd ... -
在RTF域中添加Table
2010-06-05 23:48 1459Developers sometimes need to re ...
相关推荐
该方案允许将含有域的RTF内容存储在SQL Server数据库中。这不仅可以简化数据管理,还方便了多用户的协作编辑。数据库中包含两个表:`Table1`用于存储域对应的值,如姓名、性别等;`Table2`则用来保存RTF编码,以及...
规格中提到的RTF读取器约定主要包括: - **兼容性**:确保读取器能够正确地解析来自不同版本的RTF文档。 - **错误处理**:定义了当遇到未知控制词或其他格式错误时,读取器应如何响应。 #### 正式语法 正式语法部分...
$table = $section->addTable(array('cellMargin' => 50)); for ($i = 0; $i ; $i++) { for ($j = 0; $j ; $j++) { $table->addRow(500); $table->addCell(1000)->addText("单元格($i,$j)"); } } ``` 5. **...
1. **解析RTF文件**:首先,程序需要读取RTF文件并理解其内部结构。RTF文件以特定的控制字符和组开始,这些控制字符指示了文本的格式信息。解析器会识别这些控制字符并将其映射到HTML相应的标签。 2. **转换格式...
而iText-rtf-2.1.7.jar则增加了对Rich Text Format (RTF)的支持,允许用户生成或读取RTF格式的文档,RTF是一种跨平台的文本格式,可以兼容多种文字处理软件,如Microsoft Word。 在压缩包的文件名称列表中,我们...
为了轻松地创建多字体格式的单元,单元可以以RTF格式读写 VBA宏 可以读写文件中的宏,使用XLSReadWriteII可以为控件比如:按钮、组合框等添加宏 导入及导出 从下列导入数据… Open Office Calc文档 CSV文件...
通过iText rtf,Java开发者可以生成或读取RTF文档,这在需要与使用Microsoft Word的用户进行数据交换时非常有用。例如,你可以将程序生成的数据转换为具有格式化的RTF文件,然后让用户在他们熟悉的Word环境中查看或...
富文本格式(Rich Text Format,简称RTF)是一种通用的文档格式,...它可以帮助创建出在多种环境中都能保持一致显示效果的文档,并且通过API接口,开发者可以方便地读取、写入和操作RTF数据,以实现更复杂的应用需求。
RTF是一种跨平台的文本格式,可以被大多数文字处理软件(包括Microsoft Word)读取和写入。通过这个组件,Itext能够将内容转换为RTF格式,从而生成可由Word打开的文档。 使用Itext生成Word文档的基本步骤如下: 1....
在MySQL中,可以通过`COMMENT ON TABLE`或`ALTER TABLE ... COMMENT`语句添加表注释;在Oracle中,可以使用`COMMENT ON TABLE`命令来实现相同功能。 生成Word文档的过程可能涉及到编程和数据库查询。可以使用Java...
`itext-rtf-2.1.7.jar`是Itext的RTF(Rich Text Format)模块,它允许我们生成RTF格式的文档,RTF是一种通用的格式,可以被多种文字处理软件,包括Microsoft Word,所读取和写入。通过使用这个库,我们可以间接地将...
首先,你需要在Word中创建一个模板文件(如Template.doc),并使用“插入→文档部件→域”插入MergeField来绑定数据。例如,你可以插入字段如“UserName”,“Gender”,“BirthDay”,“Address”等。 接下来,...
在`AxRichTextBox`中插入表格,我们可以使用`Range`对象的`InsertTable`方法。例如,以下代码会插入一个3行4列的表格: ```csharp AxRichTextBox1.Rtf = "{\\rtf1\\ansi\\deflang1033{\\fonttbl{\\f0\\fnil\\...
为了轻松地创建多字体格式的单元,单元可以以RTF格式读写 VBA宏 可以读写文件中的宏,使用XLSReadWriteII可以为控件比如:按钮、组合框等添加宏 导入及导出 从下列导入数据… Open Office Calc文档 CSV文件以及...
首先,`itextpdf-5.4.3.jar`是iText库的一个特定版本,它提供了Java程序员用来创建、编辑和读取PDF文档的API。这个库包含了丰富的功能,例如添加文本、图像、表格、链接,甚至复杂的表单和数字签名。 要开始使用...
TX Text Control ActiveX是一个字处理控件,能够读取,编写和创建行业标准的文档格式,如MS Word DOCX,DOC,RTF,HTML和XML,它还能够导出所有文档到打印就绪的Adobe PDF文档,而且不用第三方软件。TX Text Control...
为了轻松地创建多字体格式的单元,单元可以以RTF格式读写 VBA宏 可以读写文件中的宏,使用XLSReadWriteII可以为控件比如:按钮、组合框等添加宏 导入及导出 从下列导入数据… •Open Office Calc文档 •CSV...
在提取资源方面,ResourceBuilder能够从已编译的EXE或DLL文件中读取并导出资源,这对于调试、分析或复用已有资源具有极大价值。开发者可以快速查找并导出特定的资源,无需深入了解二进制文件格式,极大地节省了时间...