How to hide a view column while printing?

Hi there,

is there a way to prevent a view column to be printed ?

And is there a way to only print a certain view column ?

Sincerly

Jochen "Joe" Herrmann

Hide when printed is available for form items but there doesnt seem to be any such option for a view column.
For a view column, the option to hide the column always or from mobile or on a condition is available but there isnt any @command or function like @isdocbeing printed or @isbeingprinted or @isviewbeingprinted or any such option that recognizes a print action…

Hi Joe,

Currently there is no method in LotusScript/Formula to hide specific column when printing a view. But you can hide a specific column in a view before printing by creating a custom code using LotusScript.

You can use the following code in the View Action or Agent that is set to be visible in the Actions Menu.

Sub Initialize
Dim workspace As New NotesUIWorkspace
Dim uiview As NotesUIView
Set uiview = workspace.Currentview
Dim viewName As String
Dim columnName As String
viewName = uiView.Viewname
columnName = "YourColumnName"
Call HideColumnBeforePrint(viewName, columnName)
Call uiview.Print(1, , , , , , True, , )
End Sub
Sub HideColumnBeforePrint(viewName As String, columnName As String)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim column As NotesViewColumn
Dim i As Integer
Set db = session.CurrentDatabase
Set view = db.GetView(viewName)
If view Is Nothing Then
MessageBox "View not found", , "Error"
Exit Sub
End If
For i = 0 To view.Columncount
Set column = view.Columns(i)
If column.Title = columnName Then
column.IsHidden = True
view.Refresh
Exit For
End If
Next
End Sub

This would require designer access to the database. Also column.ishidden will actually change the design of the view column, right? So next time the column will be hidden . So the code needs a show/ hide action. I guess this appch will be problematic any way..

But of course, this is the only workaround approach that can address the issue..