Printing documents from a view (web)

I almost have my summer-break so in order not to forget what I have been doing lately here a summary of my activities on development: 

Recently I have been working on some projects which all had one thing in common: ‘printing documents from a web browser’.  In this article I describe you my solution how provide a funtion to print (multiple) documents from a web view, with maintaining the often used previous-next navigation in Domino views.

The function is based upon the idea of a cookie. In the cookie you write the document unique ID of the document you want to add to your print selection, and at the end, the point that the user want to actually print the selection, all documents will be collected via an AJAX request and added on a new window.

I have no idea what the performance impact are and have not tested the application well in IE, I assume there might be some considerations using different browser types and versions.

print expl 01

In the view for each document the user has the option to ‘add’ this document to his ‘selection’. The selected document will be presented in a DIV below the view. Also the icon will change from blue to a more inactive ‘purple’:

print expl 02

In the example above the user has selected 2 documents, which can be deleted in 2 ways from the selection:

– document one by one

– all documents at once

print expl 3

Att the bottom the print icon uses a JavaScript function that makes an AJAX request for each document UNID in the cookie and writes the result (HTML) to a new window:

print expl 4

Since the whole idea is based upon a normal default Domino view and it support the option to use the previous-next navigation I think this approach should be easy to implement in most applications.

A sample of the application can be found here. Since this was only one of my approaches to enable printing Notes documents from a webbrowser there is more to come soon.

Now I can really start backpacking at ease 🙂


Deleting documents in a view via icons

When I was reading The View article ‘Using AJAX techniques in Domino Applications, Part 2’ I noticed a functionality in the sample application I was not aware of before, but could be very usefull in my applications.

In the sample DB you can move up, downwards and delete documents in a view by icons for each document.

I only needed the delete function so that is what this item is about.

delete doc picture 1

First in the view you define a column, set the property of ‘Display values as icons’, define a column value (a reference to an image resource)  and in the last / programmatic use tab you enter a ‘Name’, in this case ‘Delete’:

delete doc picture 2

In the Globals of that same view you make a reference to a Script Library called ‘Controls’:

delete doc picture 3

The Script Library itself is not so spectaculair. In the Declarations you add:

%INCLUDE “LSConst.lss” 

You also add a Sub function, in this case it is called DeleteItem. The main statement in this Sub is the line:

Call Qdoc.Remove ( True )Which is the document the user will click on in the view. In order to make the changes noticeable for the user the following statement is also added:

Set view = db.GetView(“v-projects”)

Call view.refresh

If you are interested in the function, I advice you to download the application if possible and see for yourself if it is usable for you…