Solved

Printing a view on the web

Posted on 2002-06-26
11
232 Views
Last Modified: 2013-12-18
Hi,
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 :
window.print()
but it prints only the current page.

Have you found a way to do this?

Thanks by advance,
Koray.
0
Comment
Question by:koray_uygun
  • 5
  • 3
  • 3
11 Comments
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7111306
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([NavigateNext])
&
@Command(NavigatePrev])  respectively.

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

Good Luck!
Arun.
0
 

Author Comment

by:koray_uygun
ID: 7111344
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).
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7112327
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:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=lotusnotes&qid=20266041

Good luck,
zvonko

0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 50 total points
ID: 7112447
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,
nOLO
 -  
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 "<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0>"
 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>"
     Else
       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)
 Wend
 
 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.

Cheers,
zvonko  
Comment
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.  
Comment
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

~Hemanth  
Comment
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,
zvonko

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.  
Comment
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 -
nOLOco
 -
p.s. I've upped the points in the meantime as this seems more tricky than I'd thought.  
Comment
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.

http://codestore.net/A55692/store.nsf/cmnts/896DC837C32DEEFE80256B1D006C128E?OpenDocument

PS: Follow the discussion too

~Hemanth  
Comment
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

http://codestore.net/A55692/store.nsf/all/BF15AD2001943E4C86256B200031A1D4?OpenDocument

I haven't tested this, let me have the feedback from you  
Comment
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....

noloco,
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)

 
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 :-)
 
Comment
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!  
Comment
From: zvonko  Date: 02/21/2002 11:25AM PST  
Hello nOLOco,

do you need more support with this?  
Comment
From: CRAK  Date: 02/21/2002 12:47PM PST  
zvonko,
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!
 
Comment
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 ;-)  
Comment
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!
nOLOco
 -  
Comment
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 :-)  
Comment
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 !!  
0
 

Author Comment

by:koray_uygun
ID: 7112955
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.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:koray_uygun
ID: 7113051
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.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7113074
Oh bro ! How was that ???

;-)
Arun.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7113083
It is not a problem for me :)

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7113161
Still you beleive that you will hit 100k before me ?

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

LOL!

;-)
Arun.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7114244
That's the game my friend :)

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7115469
So you are still on it ??? I will have to talk to jerrith about it then...
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now