我有一个导出到Excel代理,在我的旧8.5服务器上运行良好。当我将数据库移动到9.0.1服务器时,代理程序一次只导出一行。如果视图中有30行,则必须运行代理30次。在Domino 9上有什么不同可以阻止代理在视图中的每一行中运行?`Sub WriteViewasExcel(view as NotesView)
%REM
Agent ExporttoExcel
Created Mar 11, 2010 by Brian Moore/usr/nbt
Description: Comments for Agent
%END REM
Option Public
Option Declare
Sub Initialize()
Dim s As New NotesSession
Dim db As NotesDatabase
Dim qs As NotesView
Dim nv As NotesViewNavigator
Dim ne As NotesViewEntry
Dim Doc As NotesDocument
Set db = s.Currentdatabase
Set qs = db.GetView("Export")
Set nv = qs.CreateViewNav
Set ne = nv.GetFirst
Dim filename As String
Print |Content-Type:application/vnd.ms-excel|
filename="Excel "+db.Title+" "+Format(Now, "yyyy-mmm-d hhmm")+".xls" 'file name which will be suggested to user to save the resulting Excel file
Print |Content-Disposition: Attachment; filename="|+filename+|"| 'Triggers the save/open browser prompt instead of embedding the spreadsheet in the browser
Print ""
Print |<table border="1"><tr>
<td width="135"> <Center><b>Store Name</td></b>
<td width="80"> <Center><b>Date</td></b>
<td width="80"> <Center><b>Nontax clothing sales</td></b>
<td width="80"> <Center><b><font color="blue">Tax textile sales</td></b></font>
<td width="80"> <Center><b><font color="red">Furniture Sales</td></b></font>
<td width="80"> <Center><b><font color="green">Elec/Mech Appl/Fixture Sales</td></font> </b>
<td width="80"> <Center><b> Shoe Sales</td></b>
<td width="80"> <Center><b><font color="blue">Wares Sales</td></b></font>
<td width="80"> <Center><b><font color="red">Total Discounts</td></b></font>
<td width="80"> <Center><b><font color="green">Taxable Income</td></font> </b>
<td width="80"> <Center><b>Tax Amount</td></b>
<td width="80"> <Center><b><font color="blue">Credit Total</td></b></font>
<td width="80"> <Center><b><font color="red">Payout Total</td></b></font>
<td width="80"> <Center><b><font color="green">Actual Deposit</td></font> </b>
<td width="80"> <Center><b>MC/VISA Sales</td></b>
<td width="80"> <Center><b><font color="blue">AMEX Sales</td></b>
<td width="80"> <Center><b><font color="red">Gift Certificates</td></b>
<td width="80"> <Center><b>Customer Count</td></b>
<td width="80"> <Center><b>Total Donations</td></b></font></Center>
</tr>|
While Not(ne Is Nothing)
Set doc = ne.Document
Call doc.ReplaceItemValue("exported" , "yes")
Call doc.Save(True, False)
Print|<tr> <td>| + ne.ColumnValues(0) + |</td> | 'Store Name
Print|<td> | + ne.ColumnValues(1) + | </td> | 'Date
Print|<td> | + ne.ColumnValues(2) + | </td> | 'Non Tax Clothing Sales
Print|<td> <font color="blue">| + ne.ColumnValues(3) + | </font> </td> | 'Taxable Textile Sales
Print|<td> <font color="red">| + ne.ColumnValues(4) + | </font> </td> | 'Furniture Sales
Print|<td> <font color="green">| + ne.ColumnValues(5) + | </font> </td> | 'Elec/Mech Appliance/Fixture Sales
Print|<td> | + ne.ColumnValues(6) + | </td> | 'Shoe Sales
Print|<td> <font color="blue">| + ne.ColumnValues(7) + | </font> </td> | 'Wares Sales
Print|<td> <font color="red">| + ne.ColumnValues(8) + | </font> </td> | 'Total Discounts
Print|<td> <font color="green">| + ne.ColumnValues(9) + | </font> </td> | 'Taxable Income
Print|<td> | + ne.ColumnValues(10) + | </td> | 'Tax Amount
Print|<td> <font color="blue">| + ne.ColumnValues(11) + | </font> </td> | 'Credit Total
Print|<td> <font color="red">| + ne.ColumnValues(12) + | </font> </td> | 'Payout Total
Print|<td> <font color="green">| + ne.ColumnValues(13) + | </font> </td> | 'Actural Deposits
Print|<td> | + ne.ColumnValues(14) + | </td> | 'MC/VISA Sales
Print|<td> <font color="blue">| + ne.ColumnValues(15) + | </font> </td> | 'AMEX Sales
Print|<td> <font color="red">| + ne.ColumnValues(16) + | </font> </td> | 'Gift Certificates
Print|<td> <font color="red">| + ne.ColumnValues(17) + | </font> </td> | 'Customer Count
Print|<td> <font color="red">| + ne.ColumnValues(18) + | </font> </td> | 'Total Donations
Set ne = nv.GetNext(ne)
Wend
End Sub
答案 0 :(得分:2)
在代码行之后添加
qs.AutoUpdate = False
行
qs.AutoUpdate = False
当导航器尝试从入口到入口时文档从视图中丢弃时,您的视图导航器会感到困惑。 {{1}}会在代理运行期间阻止视图中的所有条目。