I have a Search input box and an agent which exports the view. If I click export (not typing anything in the Search input box) it will all documents in the view. But for example I input "ABC" in the input box and click Search, it will list in the view all the documents which is under "ABC" but when I clicked export, it doesn't export the view.
I want to know how to access the filtered view which corresponds to the value in the Search input box so I can export the filtered documents in the view.
Thanks.
Here is part of the whole agent code:
Redim colnumbers (0 To 100) As Integer
Set db=session.currentdatabase
Set doc=session.DocumentContext
expview=Strright(doc.query_string_decoded(0),"expview=")
Dim query As String
query = Strleft(Strright(doc.query_string_decoded(0),"query="),"&expview=")
'Print query + expview
filename="Excel "+db.Title+" "+Format(Now, "yyyy-mmm-d hh-mm")+".xls" 'file name which will be suggested to user to save the resulting Excel file
tmp=""
If Instr(doc.query_string_decoded(0),"expview=")=0 Then ' find out if view is supplied as URL parameter to this agent
Set view = db.GetView("RPG") ' no view supplied as parameter, use your default export view
Else
'expview=StrRight(doc.query_string_decoded(0),"expview=")
If Instr(expview,"&")>0 Then expview=StrLeft(expview,"&")
Set view = db.GetView(expview) ' get the view passed as parameter to the agent
End If
If view Is Nothing Then
Print "Export Error - Export view does not exist"
Exit Sub
End If