Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Share my bitter experience...
Message
 
 
To
14/03/2001 09:21:03
Gary Ward
Rms Management, Inc.
Galena, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00456312
Message ID:
00484852
Views:
18
>Hi Nadya,
>
>I think I have found the same problem with the 'REPORT FORM ASCII' option you experienced earlier. I found this thread while searching for a solution to my problem and I found your program. Can you elaborate on what I must add to the program created from your program? Specifically, how do I create the text file from the program created? I see where I need to modify the program to scan the my input file but I don't understand how to redirect the value of lcStr to a text file.

Hi Gary,

This is the program, which I produced after the first draft program was produced. BTW, I was thinking, that my method of producing 'draft' could be improved a little bit, because currently I insert CRLF after each field, that's not exactly right.

Anyway, take a look at this example. I produce a file by using strtofile function.
********************************************************************
*  Description.......: GalleyCreditRpt - Special program to produce Galley Credit Report
*  Calling Samples...: GalleyCreditRpt(oJC.outTable)
*  Parameter List....: tcTableName
*  Created by........: Nadya Nosonovsky 12/26/2000 04:38:15 PM
*  Modified by.......: Nadya Nosonovsky 12/28/2000 03:51:12 PM
********************************************************************
lparameters tcTableName
wait window nowait "Wait while Output file is generating..."
#define CRLF chr(13)+chr(10)
if empty(tcTableName)
     tcTableName="\Redp\Output\Galley\GalleyMA0008Tstr" && For tests only
endif
local lcStr, lcDBFName, lcFileName, lnOldSelect, lcRegistry, ;
     lcCity, llFirstTime, lcMiscType, lcOldCentury
lnOldSelect=select()
lcDBFName=forceext(tcTableName,"dbf")
if vartype(oJC)="O"
   ojc.extension='.crd' && NSL 030601 added new property to allow special to set the file extension to the output module
endif   
lcFileName=forceext(tcTableName,"crd") && Credit output file type
if file(lcFileName)
     erase (lcFileName)
endif
=OpenTble(lcDBFName,"WorkTable","shared noupdate","Misc") && Assume it opens just fine
select WorkTable
if reccount("WorkTable")=0
     use in WorkTable
     select (lnOldSelect)
     wait window nowait "No records to produce an output..."
     return .f.
endif
lcOldCentury=set('century')
set century off && Display data in short format
go top
lcRegistry=Registry
lcCity=City
llFirstTime=.t.
lcMiscType=MiscType
lcStr=''
local prComma, prTaxLbl, prTaxType2, prAmtLbl, BkPgLC
scan
****** Header section ******************
     if lcMiscType<>MiscType or llFirstTime && MiscType group Header
          lcStr=lcStr+trim(descrip)+CRLF && MiscType.FullName
          lcMiscType=lcMiscType
     endif
     if lcRegistry<>Registry or llFirstTime && Registry group Header
          lcStr=lcStr+'@Credit Registry:'+trim(Registry)+CRLF
          lcRegistry=Registry
     endif
     if lcCity<>City or llFirstTime && City group Header
          lcStr=lcStr+"@Credit Town:"+trim(City)+CRLF
          lcCity=City
     endif
     llFirstTime=.f. && Now it's not a first time (all Headers are already printed)
***** Proceed with detail band
     prComma=iif(upper(left(Street,3))="ZZZ","",", ")
     prTaxLbl=iif(!empty(TaxType1)," Tax:","")
     prTaxType2=iif(!empty(TaxType2)," , "+trim(TaxType2),"")
     prAmtLbl=iif(price>0," Amt:","")
     if empty(DocketRef)
          BkPgLC=""
     else
          if "/" $ DocketRef
               BkPgLC=" Bk/pg: "
          else
               BkPgLC=" Doc#: "
          endif
     endif

     do case
     case MiscType="VB"
          lcStr=lcStr+'@Voluntary:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+" "+trim(prntZip)+ ;
               " D: "+dtoc(InitDate)+" "+"Case#: "+DocketRef+CRLF

     case MiscType="11"
          lcStr=lcStr+'@Chapter11:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+" "+trim(prntZip)+ ;
               " D: "+dtoc(InitDate)+" "+"Case#: "+DocketRef+CRLF

     case MiscType="13"
          lcStr=lcStr+'@Chapter13:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+" "+trim(prntZip)+ ;
               " D: "+dtoc(InitDate)+" "+"Case#: "+DocketRef+CRLF

     case MiscType="DH"
          lcStr=lcStr+'@Declarations:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+ ;
               prComma+trim(Address)+", "+trim(City)+ ;
               " D: "+dtoc(InitDate)+CRLF

     case MiscType="FT"
          lcStr=lcStr+'@Fed Tax Liens:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+" "+trim(prntZip)+ ;
               " D: "+dtoc(InitDate)+ ;
               prTaxLbl+trim(TaxType1)+prTaxType2+ ;
               prAmtLbl+transform(price,'@Z$ 999,999,999')+CRLF

     case MiscType="ST"
          lcStr=lcStr+'@Stt Tax Liens:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+" "+trim(prntZip)+ ;
               " D: "+ dtoc(InitDate)+ ;
               prTaxLbl+trim(TaxType1)+prTaxType2+ ;
               prAmtLbl+transform(price,'@Z$ 999,999,999')+CRLF

     case MiscType="LA"
          lcStr=lcStr+'@Attachments:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+trim(prPlaint1)+ ;
               prPlaint2+" D: "+dtoc(InitDate)+ ;
               prAmtLbl+transform(price,'@Z$ 999,999,999')+CRLF

     case MiscType="EX"
          lcStr=lcStr+'@Executions:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+trim(prPlaint1)+ ;
               prPlaint2+" D: "+dtoc(InitDate)+ ;
               prAmtLbl+transform(price,'@Z$ 999,999,999')+CRLF

******** Lis Pendens ***************
     case MiscType="LP"
          lcStr=lcStr+'@Lis Pendens:'+ ;
               trim(PropDef1Nm)+ trim(Def2)+" "+trim(Alias1Type)+" "+trim(Alias1)+ ;
               prComma+trim(Address)+", "+trim(City)+trim(prPlaint1)+ ;
               prPlaint2+" D: "+dtoc(InitDate)+ ;
               prAmtLbl+transform(price,'@Z$ 999,999,999')+CRLF

****** Petitions ***************
     case MiscType="PF"
          lcStr=lcStr+'@Pet 1st Line:'+ trim(Address)+CRLF

          if empty(Def2)
               lcStr=lcStr+'@Petitions:Owner:'+ ;
                    trim(Def1Name)+ " L: "+trim(Plaintiff1)+CRLF
          endif
          if !empty(Def2)
               lcStr=lcStr+'@Petitions:Owner:'+ ;
                    trim(Def1Name)+ trim(Def2)+CRLF
               lcStr=lcStr+'@Petitions:Lender:'+ ;
                    trim(Plaintiff1)+ trim(prPlaint2)+CRLF
          endif

          lcStr=lcStr+'@Petitions:'+ BkPgLC+ trim(DocketRef)+"-"+ ;
               iif(RespDate>date(1980,1,1),"Respond by: ","")+dtoc(RespDate)+CRLF
          lcStr=lcStr+'@Petitions:Source:'+ trim(NewsPName)+" ("+dtoc(PubDate)+")"+CRLF

****** Foreclosures ***********
     case MiscType="FS"
          lcStr=lcStr+'@Fore 1st Line:'+ ttoc(SaleDateTm)+"-"+trim(Address)+CRLF
          lcStr=lcStr+'@Foreclosures:Owner:'+ trim(Def1Name)+trim(Def2)+ ;
               " "+trim(Alias1Type)+" "+trim(Alias1)+ CRLF
          lcStr=lcStr+'@Foreclosures:Lender:'+ trim(Plaintiff1)+trim(prPlaint2)+ ;
               iif(Deposit>0," Deposit: ","")+transform(Deposit,'@Z$ 999,999,999')+ CRLF
          lcStr=lcStr+'@Foreclosures:'+ ltrim(BkPgLC)+trim(DocketRef)+ ;
               " D: "+dtoc(OrigMortg)+ CRLF
          lcStr=lcStr+'@Foreclosures:Source:'+ trim(NewsPName)+" ("+dtoc(PubDate)+")"+CRLF
          lcStr=lcStr+'@Foreclosures:'+ iif(!empty(Sheratty),"Atty: ","")+trim(Sheratty)+"-"+ ;
               Phone+CRLF

****** Sheriff ***********
     case MiscType="SS"
          lcStr=lcStr+'@Sher 1st Line:'+ trim(Address)+CRLF
          lcStr=lcStr+'@Sheriff:Sale at:'+ trim(SaleLoc)+", "+trim(City)+"-"+ ;
               ttoc(SaleDateTm)+CRLF
          lcStr=lcStr+'@Sheriff:Owner:'+ trim(Def1Name)+trim(Def2)+ ;
               " "+trim(Alias1Type)+" "+trim(Alias1)+ " "+BkPgLC+trim(DocketRef)+ ;
               " "+dtoc(OrigMortg)+CRLF
          lcStr=lcStr+'@Sheriff:Source:'+ trim(NewsPName)+" ("+dtoc(PubDate)+")"+CRLF
     endcase
     if len(lcStr)>16770000 && Large file
          =strtofile(lcStr,lcFileName,.t.)
          lcStr='' && Start again
     endif
endscan
=strtofile(lcStr,lcFileName,.t.)
use in WorkTable
select (lnOldSelect) && Return back
if lcOldCentury='ON'
     set century on
endif
wait clear
return .t.
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