Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Table --> Fox Pro code ?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00740670
Message ID:
00743104
Views:
30
>Hi, I would like be be able to modify a form such as the one at
>
>http://tram.east.asu.edu/forms/downloads/epa/pc/epa-424.doc
>
>using VFP commands that control Word. Is there a way to start with an existing form such as the one above and have it converted into a series of commands -- that will then create the same form from FoxPro?
>
>Steve

Steve,
Providing you've defined your table (my PELS to inches was 71.94), you then loop through your rows and put your data in the table cells. The following sample illustrates populating the table. If you need some code samples on how to format the table, let us know. the variable oTableRow is really a number and should be lnTableRow. Endkey(6) forces exit from last cell of table and to of next page. HTH
* Table format already defined, now Fill in the page
for oTableRow=7 to 63
if eof() or lcMasterKey#ferc_numb+section+sort_prod+line_prod
   DisablePageBreak=.t.
   exit
endif
FERCListings.MSG.Caption=alltrim(lcMasterKey)+[ ];
                        +trim(origin)+[ ]+trim(destinatio)
if Origin#CheckOrigin OR AfterFirstPage AND oTableRow=7
   oTable.Cell(oTableRow,1).Select
   .Selection.SelectRow
   .Selection.Cells.Shading.Texture=45
   .Selection.Cells.Shading.BackgroundPatternColorIndex=8
   outOrigin=trim(left(trim(Origin)+iif(seek(orig_code,[orignew],[origno]),;
            [  (]+alltrim(orignew.county_st)+[) ],[ERR ]),36))
            * iif(AfterFirstPage AND oTableRow=8 AND 
            * CheckOrigin=Origin,[ (cont)],[]
   CheckOrigin=Origin
   oTable.Cell(oTableRow, 1).Select
   .Selection.ParagraphFormat.SpaceBefore = iif(oTableRow=7,0,1)
   .Selection.TypeText(iif(val(item_numb)>0,str(val(item_numb),4),[]))
   oTable.Cell(oTableRow,2).Select
   .Selection.ParagraphFormat.SpaceBefore = iif(oTableRow=7,0,1)
   .Selection.TypeText(outOrigin+[ ])
   if val(Orig_Note)>0
      .Selection.Font.Name="Monotype Sorts"
      .Selection.Font.Size=10
      .Selection.TypeText(chr(191+val(Orig_note)))
   Endif
   if AfterFirstPage AND oTableRow=7 AND CheckOrigin=Origin
      .Selection.TypeText([ (cont) ])
   Endif
   OriginROW=oTableRow
   AfterFirstPage=.t.
Endif
oTable.Cell(oTableRow,3).Select
.Selection.TypeText(trim(Destinatio)+iif(seek(dest_code,[destnew],[destno]),;
           [  (]+alltrim(destnew.county_st)+[) ],[ERR ]))
if val(Dest_Note)>0
   .Selection.Font.Name="Monotype Sorts"
   .Selection.ParagraphFormat.SpaceBefore = iif(oTableRow=7,0,1)
   .Selection.Font.Size=10
   .Selection.TypeText(chr(191+val(dest_note)))
Endif
oTable.Cell(oTableRow,4).Select
.Selection.ParagraphFormat.SpaceBefore = iif(oTableRow=7,0,1)
.Selection.TypeText(transform((cur_rate_s+cur_rat3_s),'9999.9'))

*.... other conditionl format code

* this code shades every other row
if OriginROW#oTableRow AND MOD(oTableRow-OriginROW,2)=0 && Even number distance
   oTable.Cell(oTableRow,3).Select
  .Selection.MoveRight(1,6,1)
  .Selection.Cells.Shading.Texture=30
  .Selection.Cells.Shading.BackgroundPatternColorIndex=8
Endif &&Origin_ROW#oTableRow AND MOD(oTableRow-OriginROW,2)=0
FERCListings.PB.Value=FERCListings.PB.Value+1
skip
endfor
.Selection.EndKey(6)
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform