Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 252
  • Last Modified:

for madheeswar.

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
amd1979
Asked:
amd1979
  • 11
  • 8
  • 3
  • +1
1 Solution
 
madheeswarCommented:
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
 
madheeswarCommented:
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
 
madheeswarCommented:
And I will stay another 45 minutes and if you can respond quickly I can provide answer , else wait for tomorrow.

Thanks
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
RanjeetRainCommented:
Mady, I will not feel bad at all if i get some points too ;-)
0
 
madheeswarCommented:
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
 
RanjeetRainCommented:
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
 
amd1979Author Commented:
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
 
madheeswarCommented:
"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
 
amd1979Author Commented:
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
 
RanjeetRainCommented:
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
 
amd1979Author Commented:
mady,

iam waiting for your answer..

thanks..

amd
0
 
madheeswarCommented:
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
 
amd1979Author Commented:
i still need your answer..
0
 
madheeswarCommented:
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
 
amd1979Author Commented:
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
 
madheeswarCommented:
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
 
madheeswarCommented:
Yesterday i have sent one template to u. Did u received it or not?
0
 
amd1979Author Commented:
no i didnt know that you sent me an email, ill check it first, ill back to later. thanks..
0
 
amd1979Author Commented:
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
 
madheeswarCommented:
notes.net

codestore.net

searchdomino.com

etc.,...
0
 
ArunkumarCommented:
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
 
amd1979Author Commented:
thanks for the support mady...
0
 
madheeswarCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 11
  • 8
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now