|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating dynamic reports for the Notes client that go beyond embedded views (continued)
Next you need to grab a handle to your Folder and clear out the previous search information before beginning new report filtering.
Set uidoc = ws.CurrentDocument
Set fview = db.GetView ("BR") 'BR is the alias of the folder
Set doc = fview.GetFirstDocument
Do Until doc Is Nothing
Call doc.RemoveFromFolder("BR")
Set doc = fview.GetFirstDocument
Loop
|
Next you can set up variables for the criteria fields and determine if required fields have been filled in.
status = uidoc.FieldGetText ("Status")
If status = "" Then
Msgbox "You must enter the status", 16, "Input Error"
End
End If
dept = uidoc.FieldGetText ("Dept")
vwBy = uidoc.FieldGetText ("Vwby")
|
Now set up your query for the search.
'We are allowing the dept field to be left blank, in case the user wants to see all departments.
If dept = "" Then
qry = "FIELD Form = Transaction AND FIELD Status = " & status
Else
qry = "FIELD Form = Transaction AND FIELD Status = " & status & " AND FIELD Dept = " & dept
End If
|
Now you want to set up a minimum search date and a maximum search date based upon Monthly, Quarterly or the specified date range. In my date range example, if the user leaves the starting date empty, then the search will grab anything before the supplied ending date, and vice versa if he or she leaves the ending date empty. The search will grab anything after the supplied beginning date. If both fields are empty, the search grabs all dates. You won't need to worry about the empty fields at this point. You'll be taking care of that in the next step.
'Determine the dates to search on based on Monthly, Quarterly, or date range
Select Case vwBy
Case "Date Range"
Set minDate = New NotesDateTime ( uidoc.FieldGetText ("DateMin"))
Set maxDate = New NotesDateTime (uidoc.FieldGetText ("DateMax"))
Case "Monthly"
value = uidoc.FieldGetText ("MthYr")
If value = "" Then
Msgbox "You must enter the month and year you wish to view", 16, "Input Error"
End
End If
mth = Left (value, 2)
yr = Right (value, 4)
'In real life you would want to take into consideration leap years, but here we are just ignoring that.
Select Case mth
Case "01" : dy = "31"
Case "02" : dy = "28"
Case "03" : dy = "31"
Case "04" : dy = "30"
Case "05" : dy = "31"
Case "06" : dy = "30"
Case "07" : dy = "31"
Case "08" : dy = "31"
Case "09" : dy = "30"
Case "10" : dy = "31"
Case "11" : dy = "30"
Case "12" : dy = "31"
Case Else
Msgbox "The format of the month and year is incorrect. Please enter as mm/yyyy", 16, "Input Error"
End
End Select
Set minDate = New NotesDateTime (mth & "/1/" & yr)
Set maxDate = New NotesDateTime (mth & "/" & dy & "/" & yr)
Case "Quarterly"
'Code here would be similar to Monthly, only you will want to plug in the beginning and ending dates for each quarter
End Select
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Sophisticated Meets Simple For Document Management
Share. Control. Manage.
Documents, emails, and content in the context of how work is done.
Native to Lotus Domino. The User Experience unseen for Lotus Domino.
Do more with less. Really.
See the possibilities Docova unleashes for Lotus Domino. |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|