Solved

for madheeswar.

Posted on 2004-03-23
23
241 Views
Last Modified: 2013-12-18
on the last reports that we have created the selection key there is only one that  is  based on the
 date that a certain document was received not cosidering  any field.

now we have to consider other 2 fields such as "The report name" field  and the "Category Type" field

For example i want to select

Report Name  : Nature of Documents Report
Category Type: General Document
Date              : fromDate to ToDate

how can i make a report using this 3 search key?


thanks for your help..







0
Comment
Question by:amd1979
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 11
  • 8
  • 3
  • +1
23 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 10656738
next time you should not point my name as other experts will feel bad.

what is report name? is it a field or a view name?
what is category? is it based on a field where u will select the category and we need to display the report?

Pls be in detail what is Report name and what is Category Type?

If I am not wrong, it can be done.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10656773
Now I understood ur requirement.
u have view called general Documents\By nature of Documents.
In that view, if the category is XXXX, then in that category, based on from date and to date, need to generate report.

Am I correct?

if the above is correct, then it can be done with small workaround.

the same code which I have given will be reused for this also.

0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10656778
And I will stay another 45 minutes and if you can respond quickly I can provide answer , else wait for tomorrow.

Thanks
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10656826
Mady, I will not feel bad at all if i get some points too ;-)
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10656854
U have qwaletee Question which is opened till now. And I am not going to share points in this question.
Even amd will be giving more points if I solve this question.

what u will say AMD?

Anyway, Ranjeet how are you. Here I am busy with lots of projects and I am alone now also.
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10656912
Well, I'm ok too. Doing a bit of study. Trying to get some hands on Domino Workflow. Does IBM provide developers' evaluation download?

Good to be busy. How do you handle more than one projects alone? Ask your company to rectruit more people. I may just try my luck too ;-)
0
 

Author Comment

by:amd1979
ID: 10663842
sorry for my late reply, i got disconnected last night.. dont know what happenned to my provider.. any way.. yes you got what iam want to happenned on my search..

"U have qwaletee Question which is opened till now. And I am not going to share points in this question.
Even amd will be giving more points if I solve this question.

what u will say AMD?

I cant understand this..."


tnx



0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10664204
"U have qwaletee Question which is opened till now. And I am not going to share points in this question."
the above is for Ranjeet.

And the below is for u:
Even amd will be giving more points if I solve this question.

what u will say AMD?




0
 

Author Comment

by:amd1979
ID: 10664432
this question is for you and the poist obcourse..

the point is opened until now because i dont how to refund tha point because as far as i know i solve the problem on my own..

0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 10664539
AMD, you can relax. Conversation progressed like this:

>>  Mady, I will not feel bad at all if i get some points too ;-)
>>>>  U have qwaletee Question which is opened till now. And I am not going to share points in this question.
Even amd will be giving more points if I solve this question. (http://www.experts-exchange.com/Applications/Email/Lotus_Notes/Q_20841369.html)

That comment was meant for me. Sorry if that had you confused. Once in a while some "off the track" comments are a common place sight here. Pls ignore them.
0
 

Author Comment

by:amd1979
ID: 10664822
mady,

iam waiting for your answer..

thanks..

amd
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10665222
If u found the answer for yourself, then close this question.
Just post a thread in commmunity support and retain the points.

if ur still looking for an answer I have to do it.
Best of luck.

0
 

Author Comment

by:amd1979
ID: 10665468
i still need your answer..
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10665556
create a new field on the form called category_k and make it a dialog list field.
And the formula for that is:
res:=@DbColumn("":"";"";"GNofDoc";1);
@If(@IsError(res);"";res)

And for a new search button the code is:
Sub Click(Source1 As Button)
      
      Dim ws As New notesuiworkspace
      Dim Source As notesuidocument
      Dim curdoc As notesdocument
      
      Set Source=ws.currentdocument
      Set curdoc=Source.document
      
      Dim ss As New notessession
      Dim db As notesdatabase
      Dim view As notesview
      Dim dc As notesdocumentcollection
      Dim doc As notesdocument
      
      Set db=ss.currentdatabase
      
     'tmpkey=curdoc.urDateFieldIntheCurrentdocument(0)
      
      Set view=db.getview("GNofDoc")  'First column should be text and sorted.
      Dim fromdate As NotesDatetime
      Dim todate As notesdatetime
      
      Set fromdate=New notesdatetime(curdoc.Fromdate(0))
      Set todate=New notesdatetime(curdoc.Todate(0))
      
      
     '================================
      Dim xlapp As Variant
      Dim xlsheet As Variant
      
      Set xlapp=createobject("Excel.Application")
      xlapp.statusbar="Creating Worksheet. Please be patient ..."
      xlapp.visible=True
     'xlapp.visible=False
      xlapp.workbooks.add
      xlapp.referencestyle=2
      Set xlsheet=xlapp.workbooks(1).worksheets(1)
      
      
      xlsheet.name="Result"
      
      Dim rows As Integer
      Dim cols As Integer
      Dim maxcols As Integer
      
     'Header Formation;
      xlapp.Rows("1:1").select
      xlapp.selection.font.name="Arial"
      xlapp.selection.font.size=11
      xlapp.selection.font.bold=True
      xlapp.selection.font.italic=True
      
     'Header Information(Titles):
      xlapp.statusbar="Creating Cells and Creating Cell Headings. Please be patient ..."
      xlsheet.application.activesheet.cells(1,1).value="Reference Code"
      xlsheet.application.activesheet.cells(1,2).value="Subject"
      xlsheet.application.activesheet.cells(1,3).value="Sender"
      xlsheet.application.activesheet.cells(1,4).value="Action Requested"
      xlsheet.application.activesheet.cells(1,5).value="COS Remarks"
      xlsheet.application.activesheet.cells(1,6).value="Secretary’s Remarks"
      
      i=2
      
      Set dc=view.getalldocumentsbykey(curdoc.category_k(0),True)
      Set doc=dc.getfirstdocument
      
      While Not doc Is Nothing
            
          'xlapp.visible=True
            Do While fromdate.dateonly<=todate.dateonly
                  tmpkey=Cstr(fromdate.dateonly)
                  
                  Dim checkdate As notesdatetime
                  Set checkdate=New notesdatetime(doc.DTreceive(0))
                  
                  If fromdate.dateonly=checkdate.dateonly Then
                        
                        xlsheet.range("A"&Trim(Str(i))).value=doc.Dtreceive(0)
                        xlsheet.range("B"&Trim(Str(i))).value=doc.Sender(0)
                        xlsheet.range("C"&Trim(Str(i))).value=doc.Subject(0)
                        xlsheet.range("D"&Trim(Str(i))).value=doc.Arequested(0)
                        xlsheet.range("E"&Trim(Str(i))).value=doc.CosRem(0)
                        xlsheet.range("F"&Trim(Str(i))).value=doc.SecRem(0)
                        
                        
                        i=i+1
                        
                        Call xlsheet.Range("A1:F500").Columns.AutoFit
                        Call xlsheet.Range("A1:F500").Rows.AutoFit
                        
                        
                        xlapp.statusbar="Processing ..."
                  End If
                  Call fromdate.Adjustday(1)
            Loop
            Set doc=dc.getnextdocument(doc)
      Wend
      xlapp.statusbar="Completed ..."
      
      
End Sub
0
 

Author Comment

by:amd1979
ID: 10673835
hello mady,

good day..

the code that you provide encountered a little problem..
i think array does not work well..

the data that im on get from the view is only the last document..

example:

Nature of document:              Date:
Document1                           03/25/2004
Document2                           03/25/2004
Document3                           03/25/2004


i only got document 3 on the reports
doc1 and doc2 are not included..

thanks
amd











0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10674433
use the below code for exporting:
Sub Click(Source1 As Button)
      
      Dim ws As New notesuiworkspace
      Dim Source As notesuidocument
      Dim curdoc As notesdocument
      
      Set Source=ws.currentdocument
      Set curdoc=Source.document
      
      Dim ss As New notessession
      Dim db As notesdatabase
      Dim view As notesview
      Dim dc As notesdocumentcollection
      Dim doc As notesdocument
      
      Set db=ss.currentdatabase
      
     'tmpkey=curdoc.urDateFieldIntheCurrentdocument(0)
      
      Set view=db.getview("GNofDoc")  'First column should be text and sorted.
      
      
     '================================
      Dim xlapp As Variant
      Dim xlsheet As Variant
      
      Set xlapp=createobject("Excel.Application")
      xlapp.statusbar="Creating Worksheet. Please be patient ..."
      xlapp.visible=True
     'xlapp.visible=False
      xlapp.workbooks.add
      xlapp.referencestyle=2
      Set xlsheet=xlapp.workbooks(1).worksheets(1)
      
      
      xlsheet.name="Result"
      
      Dim rows As Integer
      Dim cols As Integer
      Dim maxcols As Integer
      
     'Header Formation;
      xlapp.Rows("1:1").select
      xlapp.selection.font.name="Arial"
      xlapp.selection.font.size=11
      xlapp.selection.font.bold=True
      xlapp.selection.font.italic=True
      
     'Header Information(Titles):
      xlapp.statusbar="Creating Cells and Creating Cell Headings. Please be patient ..."
      xlsheet.application.activesheet.cells(1,1).value="Reference Code"
      xlsheet.application.activesheet.cells(1,2).value="Subject"
      xlsheet.application.activesheet.cells(1,3).value="Sender"
      xlsheet.application.activesheet.cells(1,4).value="Action Requested"
      xlsheet.application.activesheet.cells(1,5).value="COS Remarks"
      xlsheet.application.activesheet.cells(1,6).value="Secretary&#8217;s Remarks"
      
      i=2
      
      Set dc=view.getalldocumentsbykey(curdoc.category_k(0),True)
      Set doc=dc.getfirstdocument
      
      While Not doc Is Nothing
            
            Dim fromdate As NotesDatetime
            Dim todate As notesdatetime
            
            Set fromdate=New notesdatetime(curdoc.Fromdate(0))
            Set todate=New notesdatetime(curdoc.Todate(0))
            
            Dim checkdate As notesdatetime
            Set checkdate=New notesdatetime(doc.DTreceive(0))
            
          'xlapp.visible=True
            Do While fromdate.dateonly<=todate.dateonly
                  tmpkey=Cstr(fromdate.dateonly)
                  
                  If fromdate.dateonly=checkdate.dateonly Then
                        
                        xlsheet.range("A"&Trim(Str(i))).value=doc.Dtreceive(0)
                        xlsheet.range("B"&Trim(Str(i))).value=doc.Sender(0)
                        xlsheet.range("C"&Trim(Str(i))).value=doc.Subject(0)
                        xlsheet.range("D"&Trim(Str(i))).value=doc.Arequested(0)
                        xlsheet.range("E"&Trim(Str(i))).value=doc.CosRem(0)
                        xlsheet.range("F"&Trim(Str(i))).value=doc.SecRem(0)
                        
                        
                        i=i+1
                        
                        Call xlsheet.Range("A1:F500").Columns.AutoFit
                        Call xlsheet.Range("A1:F500").Rows.AutoFit
                        
                        
                        xlapp.statusbar="Processing ..."
                  End If
                  Call fromdate.Adjustday(1)
            Loop
            Set doc=dc.getnextdocument(doc)
      Wend
      xlapp.statusbar="Completed ..."
      
      
End Sub
0
 
LVL 19

Accepted Solution

by:
madheeswar earned 250 total points
ID: 10674435
Yesterday i have sent one template to u. Did u received it or not?
0
 

Author Comment

by:amd1979
ID: 10674666
no i didnt know that you sent me an email, ill check it first, ill back to later. thanks..
0
 

Author Comment

by:amd1979
ID: 10684708
is there any website that i can visit where i can get some code on how to format the excel cell using lotus script

thanks
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10685611
notes.net

codestore.net

searchdomino.com

etc.,...
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 10691673
Well, you guys are rocking here without me Huh ?  Give me some points and i will be participating too !

:-)
Long since i am here @EE...
0
 

Author Comment

by:amd1979
ID: 10702158
thanks for the support mady...
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10702476
You are welcome.

Arun,
Don't get disappointed. You have to spend a little bit of time in EE and you will achieve your position back.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question