Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext

Export within 2 databases
Nadeem Shaikh 2.Apr.03 11:03 AM a Web browser
Domino Designer -- LotusScript 4.6.4a Windows NT

Hi,
I have a problem with notes 4.6 and dont know what to do or where to start;

The problem:

I have a database with a form and view
i have another database with exactly the same form as above and exactly the same view as above.
the only difference between the views is the data (ie. one may have 4 documents and the other may have 3 documents etc)

what am i trying to do is do an txt export
from the 1st database so that it exports whatever is in the specified view and then export the view in the 2nd database and to then combine the documents exported into one file.

My process is:
first click on the action button in the view
this runs an agent that brings up a prompt box so that you can export documents based on a year;
TView:= "ExportSPSS2V";
ENVIRONMENT tViewTitle2 := TView;

TViewList :=
@If(TView = "ExportSPSS2V";
@DbColumn(Notes:"NoCache";"";"ExportSPSSMYV";2);
"");

TDOC:= @Prompt([OKCANCELLIST]:[NoSort];"Date of Commencement";"Select the documents based on the year of the date of commencement you want to export. Click on [OK] to continue, or click [Cancel] to abandon.";"";TViewList);

@If(TDOC = 1;
@Return(@Prompt([OK];"Error!";"You did not make a selection from the list"));
"");
ENVIRONMENT tDOCMonthYear2 := TDOC;
@Command([ToolsRunMacro];"(Export to Txt Promis v1.2)")

this runs the agent that creates the file, does all the manipulating and exports the file:

Sub Initialize
Dim s As NotesSession
etc..........

msg1 = Msgbox ("Starting Export Process. Please click on [OK] to confirm or [CANCEL] to abandon.",1+64,"Export Start" )
If (msg1= 2) Then
End
End If

Set s = New NotesSession
Set db = s.CurrentDatabase

viewname = s.GetEnvironmentString("$tViewTitle2",True)
Set view = db.GetView(viewname)
Dim TDate As String
TDate = s.GetEnvironmentString("$tDOCMonthYear2",True)

Dim dt As NotesDocumentCollection
Set dt = view.GetAllDocumentsByKey(TDate, False)

Set doc = dt.GetfirstDocument

filename = Inputbox$("Please enter filename where data will be stored (for e.g. C:\filename.txt)", "Filename", "q:\nad786123.txt")
' InputBox[$] ( prompt [ , [ title ] [ , [ default ] [ , xpos , ypos ] ] ] )

If (filename = "") Then
End
End If

Print "Date/Time Export Process Started:" & Str$(Now())

'filename = "C:\exp\testexp.txt"
filenum% = Freefile()

Open filename For Output As filenum%

While Not (doc Is Nothing)
'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'these are the fields on each document that I want exported to the spreadsheet

Dim subString1 As String
Dim subString2 As String

'DOB
var1 = Evaluate({@If(CliDoB = "";" ";@Left(@ReplaceSubstring(@Text(CliDoB);"/";"");4) + @Right(@Text(@Date(CliDoB));2))}, doc)
subString1 = var1(0)

'Surname
var2 = Evaluate({CliSurname + @Repeat(" "; 12 - @Length(CliSurname))}, doc)
subString2 = var2(0)

'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 'write to file
Print #filenum%, subString1 & subString2

' Set doc = view.GetNextDocument(doc)
Set doc = dt.GetNextDocument(doc)
Wend

Close filenum%
Print "Date/Time Export Process Completed:" & Str$(Now())
Msgbox "Export Process completed successfully.",0+64,"Export Complete"
End Sub


Is it possible to do an export within 2 databases and if so what do i need to add in my code above to make it work.

Your help would be greatly appreciated.

Thanks




Export within 2 databases (Nadeem Shaikh 2.Apr.03)
. . RE: Export within 2 databases (Stephen Tzintzi... 2.Apr.03)






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow