I have created an ASP page to pull information from a recordset into the FDF toolkit to display a pre-filled pdf form to the end user. I have created the pdf and have lots of form fields that need to be filled in. I have successfully filled in the objFdf.FDFSetValue information for information coming from a recordset. My problem is that I have lots of FDF form fields that are named "P1Name", "P2Name", "P3Name", "P1Age", "P2Age", "P3Age", etc. etc. I need to pull the information from the recordset and to fill in these values from each record. Thus from record 1, I would pull the age and Name and place the age into P1Age and the Name into P1Name. My problem is that I cannot use a variable for the 1st component of the objFdf.FDFSetValue fields. I have shown a small sample of the code that I hope explains my problem better. I could really use some help.
<%
'*** Create the FDF object.
Set FdfAcX = Server.CreateObject("FdfAp
p.FdfApp")
Dim objFdf
Set objFdf = FdfAcX.FDFCreate
objFdf.FDFSetFile "
http://192.168.1.1:8000/media/forms/registrationform.pdf"
objFdf.FDFSetValue "Date", Date(), Off
objFdf.FDFSetValue "TCode", TeamRS.Fields.Item("TCode"
), Off
objFdf.FDFSetValue "Division", TeamRS.Fields.Item("Divisi
on"), Off
objFdf.FDFSetValue "BoysCheck", "Yes", Off
objFdf.FDFSetValue "Age", Left(Right(TeamRS.Fields.I
tem("Divis
ion"),3),2
), Off
objFdf.FDFSetValue "CName", TeamRS.Fields.Item("CName"
), Off
'*************************
**********
**********
*********
'This is the section I need help with *
'*************************
**********
**********
*********
'loop through records
if (TeamRegRs.BOF = true AND TeamRegRS.EOF = true) then
objFdf.FDFSetValue "P1Name", "NO ACTIVE REGISTRATIONS ARE ON FILE", Off
else
DIM n
n=1
p.text = cStr("""P" & n & "Name""")
' do while ((TeamRegRS.EOF <> true) AND (n < 23))
' objFdf.FDFSetValue "P1Name", TeamRegRS.Fields.Item("Las
tName") & ", " & TeamRegRS.Fields.Item("Fir
stName"), Off
objFdf.FDFSetValue p, TeamRegRS.Fields.Item("Las
tName") & ", " & TeamRegRS.Fields.Item("Fir
stName"), Off
' n=n+1
' TeamRegRS.MoveNext()
' loop
end if
'*** Use the FDFSetStatus method to display an alert status box.
objFdf.FDFSetStatus "Your Team Registration Form has been created."
'*** Write the data back to the buffer stream.
Response.ContentType = "application/vnd.fdf"
Response.BinaryWrite objFdf.FDFSaveToBuf
'*** Close the object and clean-up.
objFdf.FDFClose
Set objFdf = Nothing
Set FdfAcX = Nothing
Response.end