This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jul 27, 2012, 9:37 AM
6 Posts
topic has been resolvedResolved

Exporting Search results from the view panel

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role:
  • Tags: Export to excel and search
  • Replies: 3
Hi,
 
I am tring to export the search results from the view panel. After performing the search, i am clicking on the button which executes SSJS to get hold of entries in the view panel and it moves to one folder. 
 
After that i am opening one xpage with after render response code to export all entries in the folder. 
 
The issue is, it basically getting hold of all entries in the view instead of getting the search results in the view panel. I am clearing the folder contents in the export xpage.
 
 
Using below code to get the list of entries in the view panel:
 
Thanks in advance   

var viewPanel = getComponent("viewPanel1");

var data = viewPanel.getData();

var dataObject:lotus.domino.local.View = data.getDataObject();

var viewEntryCollection:lotus.domino.local.ViewEntryCollection = dataObject.getAllEntries();

var firstEntry = viewEntryCollection.getFirstEntry();

 

if (viewEntryCollection.getCount() > 0) {

while (firstEntry != null) {

var doc = firstEntry.getDocument();

doc.putInFolder("WebExport", true);

doc.recycle();

var tmpEntry = viewEntryCollection.getNextEntry(firstEntry);

firstEntry.recycle();

firstEntry = tmpEntry;

}

}

Jul 27, 2012, 1:51 PM
366 Posts
Re: Exporting Search results from the view panel
 The getData() method returns the underlying data source and not the contents of the view panel being displayed
 
 getData

public DataSource getData()

    returns the DataSource for this control.  
 
 that's why all of the documents are being exported.   if all of the search results are in a single page you can select them all and the process the selectedids property to do your export.  
 
 
Jul 28, 2012, 8:28 AM
6 Posts
Re: Exporting Search results from the view panel
Thank you for the response Paul.
 
My return search result some times more than 100 also.Currently i am displaying 30 pages per page. In such case, i cannot go for selection as i need to export all the search result documents.
 
I actually tried to assign the search query to session scope and tried to do the FT search again through java script. But the option for fuzzy search is not working in javascript. 
 
I tried this to perform FT fuzzy search, coll=db.FTSearch(strQuery,0,16384) , the collection as zero.
If i am giving, coll=db.FTSearch(strQuery,0), i am getting the collection 
 
Could you please suggest if any other alternative is there.
    
Jul 29, 2012, 5:44 PM
586 Posts
Re: Exporting Search results from the view panel
 I did an example on NotesIn9.com about using a repeat control to select multiple rows like you can in a view control.  I store my selected id's in a scoped variable so you shouldn't have a problem if you're dealing with multiple pages.
 
The example is here: 
 
 
The video for that example is: 
 
It looks like I didn't actually add a pager to the repeat control on the xpagescheatsheet site...  but I would expect it to work fine and allow you to select documents across multiple pages. 
 
Hope that helps! 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal