Skip to content

Instantly share code, notes, and snippets.

@jsrn
Last active December 21, 2015 10:38
Show Gist options
  • Save jsrn/6292867 to your computer and use it in GitHub Desktop.
Save jsrn/6292867 to your computer and use it in GitHub Desktop.
Because nobody likes getting RSI
# offset to start row number from - probably set it absurdly high to avoid conflicts
count = 200
baseheight = 552 # y coord of the first row
height_inc = 283 # default field height
num_rows = 30 # duh
row = 1 # row var
# Given the important details, returns a properly formatted Control element
def format_text_field( name, width, x ):
global count, row
ret = '<Control \n'
ret += 'Type="AR.Field"\n'
ret += 'Name="Field{0}"\n'.format( count )
ret += 'DataField="Body:L{0}{1}"\n'.format( row, name )
ret += 'Left="{0}"\n'.format( x )
ret += 'Top="{0}"\n'.format( baseheight + ( ( i - 1) * height_inc ) )
ret += 'Width="{0}"\n'.format( width )
ret += 'Height="283"\n'
ret += 'Text="Body:L{0}{1}"\n'.format( row, name )
ret += 'ClassName="Normal"\n'
ret += '>\n'
ret += '</Control>'
count += 1
return ret
for i in xrange( 1, num_rows + 1 ):
row = i
print format_text_field( 'Location', 2693, 283 )
print format_text_field( 'Fuel', 1134, 2976 )
print format_text_field( 'Test Pressure', 1418, 4110 )
print format_text_field( 'Test Duration', 1559, 5528 )
print format_text_field( 'Let By', 1140, 7080 )
print format_text_field( 'Test', 1134, 8220 )
print format_text_field( 'ECV Accessible and Identified', 1701, 9354 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment