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



Sep 8, 2011, 5:32 AM
35 Posts
topic has been resolvedResolved

Exporting Docs in Different Db

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 5
Hi,
I am trying to export selected documents into Excel.My documents are in a different database than the one with my xpage  (my viewpanel is calling a different db) .  So when I trying to set the database variable and call it via the .getdocumentbyid I get nothing.  Here's some of my code:

var exCon = facesContext.getExternalContext();

var writer = facesContext.getResponseWriter();

var response = exCon.getResponse();

var mydb:NotesDatabase = sessionAsSigner.getDatabase('Myserver,'DatabasePath');

docIDArray=sessionScope.selectedDocs;

var output:string = "";

for(i=0;i < docIDArray.length;i++){

var docId=docIDArray[i];

var doc=database.getDocumentByID(docId);  ******This works

var doc=mydb.getDocumentByID(docId);  ******This doesn't work

if(doc != null) {..........

 

 
What am I missing in my database variable?
    

Sep 8, 2011, 7:03 AM
170 Posts
Re: Exporting Docs in Different Db
 Perhaps you are missing a quote after Myserver?
 
var mydb:NotesDatabase = sessionAsSigner.getDatabase('Myserver,'DatabasePath');
 
also check if you opened the database mydb then you would know if something is wrong. 
 
/Fredrik 
 
Sep 8, 2011, 1:43 PM
35 Posts
Re: Exporting Docs in Different Db
Hi, I actually have the ending single quote in my code, my mistake.  How do I check to see if database opened?  I am not getting any errors, just blank.
Sep 8, 2011, 3:27 PM
170 Posts
Re: Exporting Docs in Different Db
 var mydb:NotesDatabase = sessionAsSigner.getDatabase('Myserver,'DatabasePath');
if(mydb.isOpen()==true){ 
 //do stuff if database is opened
} else {
 //Database is not opened 
 
 
 
/Fredrik 
 
Sep 8, 2011, 9:27 PM
35 Posts
Re: Exporting Docs in Different Db
Ok, I was forgetting the double backslash in the database path.  Ok, on to the next problem. I am getting this error message when Excel loads:
 
"Problem During Load
C:\domjava\xsp\theme\webstandard\xsp.css 
C:\domjava\xsp\theme\webstandard\xspLTR.css 
C:\domjava\xsp\theme\webstandard\xspIE78.css"
 
I will do a search for these css files. 
 
 
 
 
 

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