Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Printing a view on the web

i have a view that contains 20 documents but on the web i want it to display the documents 10 by page for exemple. I go to the first page of 10 documents and what i want is to have a button that prints the view, not only the 10 i see but all of them (20). For the moment i have a button with the code :
but it prints only the current page.

Have you found a way to do this?

Thanks by advance,
  • 5
  • 3
  • 3
1 Solution
Hi Koray !

Use an embedded view on form. And the Embedded views property set the number of lines to display as 10.

Above this embedded view have two hotspot buttons Previous and Next with the following @Commands

@Command(NavigatePrev])  respectively.

Now, you can use the same print statement to acheive whatever you wanted.

Good Luck!
koray_uygunAuthor Commented:
Hi Arun,
i think i have not well explained my problem. What i want is from the first page (that displays the fist 10 docs) i want a button that prints ALL the documents in the view(20).
Hello Koray,

simply printing will not work. You will have to resend the content to be printed. I would recomand that your Print button do call an agent which produces an Excel sheet formated in the view maner and user do further actions on this Excel sheet like printing or saving to his disk.

Look here for details:

Good luck,

Technology Partners: 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!

You know what ??? here is a transcript of the link....

You dont need to spend points to read that...instead give that to me....hee hee hee !!!!

Question: On the web - Can I write a file in the background from a hotspot that runs a LotusScript agent? Date: 02/12/2002 09:04AM PST  
From: noloco
Answer Grade: A  Points: 30
 Email A Friend  
 Hi all-
I want to be able to click a button on the web, open a file, run thru a Notesview and write data from records in that Notesview into the opened file and then save that file.
However the code I'm using at the moment stops when it tries to execute the following line:

    Open fileName$ For Output As fileNum%

I don't do much output to files so I'd hope there is some other way that the system can do this.
Any help anyone please?
Many thanks to y'all in advance as always,
Accepted Answer
From: zvonko Date: 02/13/2002 05:32AM PST
Text Below
Question History
Accepted Answer
From: zvonko  Date: 02/13/2002 05:32AM PST  
again to slow :-)

Heman got the link I would like to give you :-)

The only point that this guys on codestore.net missed is, that betwean content-type and start of data is to be an empty line (as defined in html conventions). But as usual in browser is this small mistake not so dramatic.

So my proposal is this: you do not put out a html page but only a html table. I mean, you start like this:
 Print "Content-Type:application/vnd.ms-excel"
 Print ""
 Print "<FONT FACE='Arial'  SIZE=2>"
 Print "<TR VALIGN=top>"
 Print "<TH NOWRAP ALIGN=left><B>AP#</B></TH><TH>DueDate</TH><TH>Status</TH><TH>Responsible</TH><TH>Subject</TH><TH>Text</TH>"
 Print "</TR>"
 Set view = db.GetView( "All Documents" )
 Set doc = view.GetFirstDocument
 While Not ( doc Is Nothing )
   If (doc.Form(0) <> "New Action Point") Then
     Print "<TR VALIGN=top>"
     Print "<FONT FACE='Arial'  SIZE=1>"
     Print "<TD>" & doc. APNumber(0) & "</TD> "
     Print "<TD>" & doc.DueTo(0) & "</TD> "
     Print "<TD>" & doc.Status(0) & "</TD> "
     Print "<TD>" & doc.Responsible(0) & "</TD> "
     Print "<TD>" & doc.Subject(0) & "</TD> "
     Set item = doc.GetFirstItem("Body")
     Print "</FONT>"
     If (doc.ParentDocumentUNID <> "") Then
       Print "<TD><FONT FACE='Arial'  SIZE=2 COLOR=BLUE><B>"
       Print "<TD><FONT FACE='Arial'  SIZE=2>"  
     End If
     Print  item.Text & "</B></FONT></TD>"
     Print "</TR>"
   End If
   'If (doc.Responses.Count = 0) Then Print "<TR></TR>"
   Set doc = view.GetNextDocument(doc)
 Print "</TABLE>"
 Print "</FONT>"

Instead of the view "All Documents" you have to insert your DocumentCollection.

This trick alone (or the link to codestore.net) is of corse not a big deal. But together with selected documents from a java applet view, it becomes not so usual to find on web <|;-)

I have not a problem when you give the points to Heman, cose he give you the first hint.

From: CRAK  Date: 02/12/2002 11:15AM PST  
You've executed an agent running on the server accessing it on system level (i.e. not controlled by notes): you (or the signer of the agent) will need authorisation to run unrestricted LS agents.
Please check: Admin help and server document in public NAB>restrictions.  
From: HemanthaKumar  Date: 02/12/2002 12:36PM PST  
FYI, Whenever you are dealing with Domino over web, you are on Domino Server. i.e. your context is Server not local machine.

Tell me what you are trying to accomplish. So that we can think of some other alternatives

From: zvonko  Date: 02/12/2002 11:01PM PST  
Hello nOLO,

if you are interested in dumping selected (or all) documents from a web view into an Excel sheet (without Excel instaled on Domino server), then increase the points to 300.
The advantage of Excel sheet is that user can save it (after seeing the data) where he likes to have it. Also wrapping of data lines is less a problem in Excel cels.

So long,

PS. For dumping selected documents is neccessary to know wether with view JavaApplet or with html view display. I recomand to dump always all documents from a view: this works always and user can remove unneaded rows from Excel sheet easylly.  
From: noloco  Date: 02/13/2002 01:56AM PST  
Ok - thanks for the input so far... seems I need to define this a little more.
I've got a database full of records where only certain users are allowed see certain records. I have created my own type of Web-based SEARCH where a user enters the various search parameters on the web and then they can  click a button called "LIST" which, via a LotusScript agent, throws a heap of HTML into another record, with information pertaining only to the records that matched the search criteria. Then I launch/display that record to show the results on the web(this is the easiest way I found I could generate a completely dynamic "view" of documents based on a special search method that normal Notes searches won't accomodate. This "view" is only a HTML table in a record though).
SOOOO - what I want to do NOW is offer the user the ability to export the same data that I presently write as HTML to a record and display on screen, but instead write it out to an Excel file so they can "play with it" in Excel.
All of this takes place on the web.

zvonko - I would only be too happy to increase the points to 300 if you are 100% sure that your solution will be exactly what I need. Can you confirm this after reading all my comments here? - Thank you in advance.

CRAK - are you saying that if the agent signer is given the appropriate access to run unrestricted LS agents that then - once any web-user clicks this button I mention, that there should be no problem opening a file for output - assuming it's going to be a new file on the web-user's own machine?
I understand what everyone else is saying - that it is the server that is trying to open a file on a completely different machine. Even if I could write the data to a file which could be attached to a document in the database itself and then downloaded by a web-user - that would be just as useful.

Many thanks for your efforts in advance -
p.s. I've upped the points in the meantime as this seems more tricky than I'd thought.  
From: HemanthaKumar  Date: 02/13/2002 05:14AM PST  
If that is what you are looking for here is an example from codestore, check it out.


PS: Follow the discussion too

From: HemanthaKumar  Date: 02/13/2002 05:17AM PST  
This one is a thread of previous link, though you might overlook, so here it is


I haven't tested this, let me have the feedback from you  
From: CRAK  Date: 02/13/2002 12:34PM PST  
You've done it again zvonko! I wonder what's keeping Arun from complaining so long....

When a web user one way or another triggers an agent (WebQuerySave or through an URL), it is the signer of the agent that actually performs that operation. See what happend when you print the username e.g. to the documentcontext.
The problem is that the process is still running on the server. Opening a file on "C:\" would mean: "C:\" on the notes server. Such actions require unrestricted access for the signer of the agent!

Your next challenge will be how to get that file from "C:\" on the server to the webuser.
I have basically come across six ways and alternatives for you to choose from:

- Write the file to a mapped network drive (that all users can access)
- Share one the notes server's directories (not THE most common thing to do; users would still need access to the file system)
- Attach the file to a document and return the attachments URL
- Don't write to a file, but dump your search result into a document instead (doclinks included if you like; queries can -for some time- perhaps even be reused!)
- Generate HTML yourself (print the full HTML document to documentcontext); pretty much like zvonko demonstrated exept the content type (and <HTML> etc. instead)
- Write to different applications (literally zvonko's comment)

From: zvonko  Date: 02/13/2002 01:01PM PST  
thank you CRAK, but only to clarify your last line from last comment: generaly do the web server and web client declare which data stream is comming. It can be html, imagages, zip, text or applications.
One of my first tests in this direction was a good article from the view where was decalared and easy to redo localy, how to send pdf data without pdf files, simply with LotusScript print commands. It worked well. But now are there some comercial solutions doing much better the same. pdf is a file format with tags simelar to html. only dificulty is that most pdf nowdays are internaly zipped. but basicaly does every pdf version localy as browser addon understand this version 1.0 pdf ascii format.
The genial thing is that Excel does easy read and write html code. The best joke is to see some web sites opened in Excel simply by entering the URL into FileOpen dialog. Look for this :-)
From: noloco  Date: 02/14/2002 04:07AM PST  
Hey lads - thank you all for your help! - I am currently testing this and it seems to be working fine however I may have 1 snag.... please hang on until tomorrow when I will have had time to get back to this work and test it all.

It's going to be tough to decide on where the points go - zvonko pretty much handed it to me on a plate - after having checked the code that Hemanth found and even correcting an issue. Many thanks and I will be in touch tomorrow (or this evening if I get time).

All the best lads!  
From: zvonko  Date: 02/21/2002 11:25AM PST  
Hello nOLOco,

do you need more support with this?  
From: CRAK  Date: 02/21/2002 12:47PM PST  
Haven't had time (or a request on the job) to stick my nose in, but you appear to be right about PDF: http://partners.adobe.com/asn/developer/technotes/acrobatpdf.html holds more details!
From: jerrith  Date: 02/21/2002 11:01PM PST  
Just a little extra info. You can run a web agent using the id of the user logged on in the browser. All you need to do is in the agent properties check "Run Agent as Web user" on the design tab.

Just a small FYI, but I guess you guys allready knew this ;-)  
From: noloco  Date: 02/22/2002 04:09AM PST  
Thanks for the help lads - all worked fine. I'm going to have to make a decision as to where the points will go and if I could split or share them I would but - what with having to get this project live on Wednesday and my leaving 2 days later to get married the week after - it's all just too much!!! - I'll just shut my eyes, pick a name, and wish the other person all the best - and guarantee that other person they will get more points from me in the near future.

All the best!
From: zvonko  Date: 02/22/2002 04:21AM PST  
Hey boy, do not loose even a thought about the points!
JM and Heman are my buddies and we all together are pleased to be able help you out.
Especialy in your situation ;-)

All the best for your wedding from all of us :-)

And do not stress you to much :-)  
From: jerrith  Date: 02/25/2002 12:20AM PST  
Since, I didn't contribute that much to the solution, don't worry about it. Hope you have (had) a nice wedding and are enjoying the honeymoon with your wife !!  
koray_uygunAuthor Commented:
Zvonko's code to create an excel file is nice but, it shows all the docs of the view even the ones that the user is not supposed to see (not in the readers field)(the agent is saved with an admin id) And i can't see a way to print only a document collection because the readers field and the authors field are filled with groups and not nominativ users.
koray_uygunAuthor Commented:
I have found that i have to check "Execute agent with wev user" to see only the users docs, so that works. Sorry Zvonko, the points goes to Arun even if the code was yours.
Oh bro ! How was that ???

It is not a problem for me :)

Still you beleive that you will hit 100k before me ?

I am on fire....i will steal all the points from you...


That's the game my friend :)

So you are still on it ??? I will have to talk to jerrith about it then...

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 5
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now