Solved

"Select All" problem in embedded view

Posted on 2006-06-14
11
652 Views
Last Modified: 2013-12-18
I am having problem using Ctrl + A / Edit -> Select All/ Using formulas to select all documents in an embedded view on a form. Because the number of records in the view is big having the select all function is crucial. Have any expert here faced this problem before?
0
Comment
Question by:Leepingtang
  • 6
  • 5
11 Comments
 
LVL 18

Accepted Solution

by:
marilyng earned 125 total points
ID: 16908445
What are you trying to achieve? The embedded view is going to be less functional in this respect, and you may have to resort to an agent/button.
0
 

Author Comment

by:Leepingtang
ID: 16908507
Hi marilyn,

The purpose of the select all is to reduce the work load required to select the thousands of records to be exported to excel. Thanks. I have tried creating a button with formulas but it wouldn't work. You suggest scripts will work?

Lp
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16908597
Well, the embedded view is going to be hard to get a handle on.  If you're just searching for a way to export the entire view to excel, then it can be done with some caution.

Thousands of documents take a bit of time, in a network environment where the users are in the same building as the server, or on a GIGe line, then the thousands of documents process quickly.  Over a WAN, ugh.

I had such an application running  a large, accounting report of several thousand lines, formatted, etc.  Over LAN, quick. Over WAN.. start Friday night and maybe it will be done the next day.  The solution was to replicate a copy of the database to the other city, or export to csv or xml.

At any rate.  Back to your problem.   The problem that you will have with the embedded view is that the form takes the focus, so you can't identify selected documents in the view.

If you just want to export all the documents in the view, and you already know the view name, then that's not a problem.  YOu can adjust any script to do this.  

Exporting selected will be a problem, and one way to do this is to embed the actions on the view action bar:  select these, move to folder, and then export all the documents in that folder.  This will take some creative @Formulas and calling some Notes Agents.  (run agent to clear documents in the folder, get selected and move to folder, run agent to export all documents in that folder to excel)

http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/e2a31b9d2a77f41685256b260050b64d?OpenDocument&Highlight=0,excel

Good examples of excel exports.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Leepingtang
ID: 16932661
Well, its another "no" i suppose. Everyday i am finding a new "impossible" for Lotus Note. Great FUN!
Will allocate the points to you as you are the only one who replied. Thanks Marilyn!
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16933277
Not really impossible, just needing a creative work around, that's all.  Did you need help with the view action button?
0
 

Author Comment

by:Leepingtang
ID: 16966387
Actually yes i do Marilyn. I have tried using formulas and keyboard shortcuts. No luck still.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16968255
Ok, tell me what you want to do, you want to select all documents to do what?  
0
 

Author Comment

by:Leepingtang
ID: 16989575
I have already created an exoprtr function that worked fine, marilyn. The thing is the documents are incrementing horribly to nearly 10,000+ already, selecting individually wouldn't be efficient. The view has to be embedded as it is categorised to a single category. It would be nice if there can be a button that will select all the documents.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16989899
Ok, on the embedded view, you have a handle on the "Category" right?  You also know the view name, right?

So, you don't need to select all the documents, you need a button that will export the "category" from the "view" and then export those documents.

Since you have to use script to do the export, just make sure that your form has a category field, and the "viewname" field.

your "Export all button" can be on the form, and doesn't need to be on the view, since you have a handle on the FORM.

Dim session as New NotesSession
Dim db as NotesDatabase
Dim ws as New NotesUIWorkspace
Dim uidoc as notesUIDocument
Dim doc as NotesDocument
set db = session.currentdatabase
set uidoc = uidoc.currentdocument
set doc = uidoc.document
'Now you have a handle on the OPEN form
Dim viewname as string
Dim categoryname as string
dim collection as NotesDocumentCollection
Dim view as NotesView
viewname = doc.getItemValue("YourViewNameField")(0)
if viewname ="" then
    msgbox "Sorry, the lookup view is not defined..",,"Unable to Continue"
    exit sub
end if
set view = db.getView(viewname)
if view is nothing then
   msgbox "Sorry, unable to locate: " + viewname,,"Unable to Continue"
   exit sub
end if
categoryname = doc.getItemValue("YourCategoryField")(0)
if categoryname = "" then
   msgbox "Sorry, unable to locate the category",,"Unable to continue"
   exit sub
end if
'Now see if you have any documents matching the category
set collection = view.getalldocumentsbykey(categoryname, true)
if collection.count <1 then
   msgbox "Sorry, there were no documents in " + viewname + " view matching this key: " + categoryname,,"No Matching documents"
   exit sub
end if

'Now you have a collection of documents identified - same thing as select all.  :)

Dim exportdoc as NotesDocument
set exportdoc = collection.getfirstdocument
while not exportdoc is nothing]
   'do you export here based on each document
   
    'Get the next document in the collection
    set exportdoc = collection.getnextdocument(exportdoc)
wend

if not collection is nothing then set collection = nothing


'Do the rest of your cleanup stuff... remember to release the memory and close excel.
-------------

Simple.  You gave up too soon. ;)
0
 

Author Comment

by:Leepingtang
ID: 16989959
Yes marilyn, i gave up too soon indeed. I have just started playing with domino a month ago so i think i will need your help a LOT in the future!
I am going to try the code right now. fingers crossed, you are my life saviour! ( if it works ) haha!
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16997436
Not tested, wrote it on the fly.. so, fingers crossed, too!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question