Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report on file with filtered index
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00540214
Message ID:
00540235
Views:
16
>>>Hi everybody,
>>>
>>>In one of my form I generate report on the fly because this form is used for any file. Here is my code:
>>>
>>>
>>>********************************************************************
>>>*  Description.......: TableMaint.PrintM
>>>*  Calling Samples...: 
>>>*  Parameter List....: 
>>>*  Created by........:  
>>>*  Modified by.......: Nadya Nosonovsky 06/06/2000 12:51:08 PM
>>>********************************************************************
>>>local lcReportName, lcSafety, lnRecno, lcOrder
>>>lcReportName='Reports\TableMaint'
>>>lcSafety=set('safety')
>>>set safety off
>>>select TableMstr
>>>lnRecno=recno()
>>>lcOrder=order()
>>>create report (m.lcReportName) from alias() column
>>>select TableMstr
>>>if !empty(m.lcOrder)
>>>   set order to tag (m.lcOrder) && Restore tag
>>>endif
>>>dodefault()
>>>goto m.lnRecno
>>>if m.lcSafety='ON'
>>>     set safety on
>>>endif
>>>
>>>dodefault() invokes Report application, which allows to select destination. There are only 5 records in this file, when the filtered index is used. However, the whole file is printed. Do you see the problem in the above code or it might be a problem in Report application itself (I already asked my colleague to check this)?
>>>
>>>Thanks in advance.
>>
>>If this a modified method why don't you pass params to dodefault?
>>Cetin
>
>There is no parameters in parent PrintM method. This method is simple:
>
>*=messagebox('Not implemented.')
>* Simple run of a predefined report
>DO REPORTER.APP WITH 'RUN',thisform.printid
>_screen.removeobject('reporter')  && Remove this object to clean up
>
>So, I just invoke these two lines of code by dodefault(). Reporter.app is the application written by my colleague. BTW, I decided to test its functionality on another form and found this problem (I'll start a new thread in a minute too):
>
>Here is the code from another form (EditLenders):
>
>********************************************************************
>*  Description.......: EditLenders.PrintM
>*  Calling Samples...:
>*  Parameter List....:
>*  Created by........: Nadya Nosonovsky 04/18/2000 11:28:42 AM
>*  Modified by.......:
>********************************************************************
>* Prepare cursor
>local lnRecno, lcWhere, lcFor, lcOrder
>select lender
>lnRecno=recno()
>lcWhere=filter()
>if !empty(m.lcWhere)
>   lcWhere='where '+ m.lcWhere
>endif
>lcOrder=order()
>if !empty(m.lcOrder)
>   lcFor=for(tagno(m.lcOrder))
>   if !empty(m.lcFor)
>      lcWhere=iif(empty(m.lcWhere),'where '+ m.lcFor, m.lcWhere + ' and '+ m.lcFor)
>   endif
>endif
>select a.code as lender, a.fullname as Full_Name, ;
>       a.ParentCode, c.short as ParentName, ;
>       a.status, a.category, b.fullname as CatName ;
>       from lender a inner join lendtype b ;
>       on a.category=b.code ;
>       inner join lender c on a.ParentCode=c.code ;
>       &lcWhere ;
>       order by 6 ;
>       into cursor curLenders
>dodefault()
>use in curLenders
>select Lender
>goto m.lnRecno
>
>I've tried to run it on the filtered index on Lender table and got a message: code is not unique and must be qualified.
>
>Here is lcWhere expression: where CODE#PARENTCODE.OR.PCOFLAG="P"
>Obviously, I want to insert a. before code, parentcode, pcoflag. How can I do this string manipulation?
>
>BTW, just thought, that I should use at least two letters to aliases, but it doesn't change my question how to perform this string modification?

Ok, I have an idea about last problem. Just do a loop on each field and perform strtran(str, fieldname, "a."+fieldname).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform