I Want to print View as it appears in our lotus notes with columns

Hi all, I want to print view with same formant it appears in our notes…including columns and rows boarders …when i tried to print it is printing the view with out boarders for rows and columns…only plain data is printing…

plz help me out in this task…its very urgent …i have been working on this from last 2 days…

Subject: I Want to print View as it appears in our lotus notes with columns…

Here is some code to export the view to Excel. I created a hidden agent and called it from a button on the view. This way you will have the columns:

Dim db As NotesDatabase

Dim s As New NotesSession

Dim view As notesview

Dim objApp As Variant

Dim worksheet As Variant

Dim row As Integer

Dim col As Integer

Dim entrycoll As notesViewEntryCollection

Dim entry As NotesViewEntry



Dim exportpath As String

Dim exportfilename As String



Dim doc As NotesDocument



Set db = s.CurrentDatabase

Set view = db.GetView ("yourviewname") 



Set entryColl=view.allentries



exportpath$ = "c:"

exportfilename$ = "exportyourviewname.xls"



exportfilename$ = Inputbox$("Please specify file name for Export to Excel.:", "Export to c:\", exportfilename$)



exportpath$ = exportpath$ & "\" & exportfilename$ 

If exportpath$ = "" Then

	Exit Sub

End If

'doc.xlsFileName = exportfilename$

col=1

Set objApp=createObject("Excel.Application")

Set worksheet=objApp.workbooks.add

'create headings

Forall c In view.columns

	objApp.cells(1, col).value=c.title

	col=col+1

End Forall



Print "Please wait while records are being exported (this can takes a few minutes) . . ."

'begin adding data from entries

For row=1 To entryColl.count

	Set entry=entryColl.getnthEntry(row)

	Print "Creating Excel File Row " & Cstr(row) & " of " & Cstr(entryColl.count)

	For col=0 To Ubound(entry.columnvalues)

		objApp.cells(row+1, col+1).value=entry.columnvalues(col)

		

		objApp.cells(row+1, col+1).select

		

	Next

Next

'Print "exporting document number " & Cstr(row) & " of " & Cstr(entryColl.count)

objApp.Columns("A:Z").AutoFit



objApp.DisplayAlerts = False 'Avoid Save AS dialog from appearing

worksheet.SaveAs(exportpath$)



Print "Export complete! File Exported to: " & "c:\" & exportfilename$



Call worksheet.close

Call objApp.Quit

Subject: I Want to print View as it appears in our lotus notes with columns…

The code supplied works best with a flat view–if you have catagories, I’m not sure how it will look.

You might have to modify it for that.

Subject: RE: I Want to print View as it appears in our lotus notes with columns…

hi frd, This code might help me…have to try …and i am great if it work for my view…because it is multicolumn view…anyway i will try it out… Thank you verymuch…c u