|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#46
|
||||
|
||||
|
Off the top of my head, I think you set a value for the checkbox in the PDF. Export value I think it's called and then in your code, if you want the checkbox checked, you set the value of it to this Export value.
Code:
output.FDFSetValue "checkbox1", "value_of_the_pdf_checkbox", false
__________________
Policy Check I'd rather have a full bottle in front of me, than a full frontal lobotomy...
|
|
#47
|
|||
|
|||
|
so maybe something like
Code:
<%
if recordset("CheckField1") = "1" then
output.FDFSetValue "checkbox1", "Yes", false
else
output.FDFSetValue "checkbox1", "No", false
End If
|
|
#48
|
||||
|
||||
|
Try this:-
Code:
if recordset("CheckField1") = "1" then output.FDFSetValue "checkbox1", "Yes", false
Assuming the value of the checkbox in the PDF is "Yes" and the default is it's unchecked. There's no need to set it to unchecked as it's defaulted to do this anyway. May as well save yourself some code. Also assumes your CheckField1 is a character field. If it's an integer, you may need to remove the quotes ie = 1 then I would consider whether it's more likely to be checked than unchecked. Then set it to the most likely value in the PDF. You can then use code to either check it or uncheck it. To uncheck I believe you need to set it to "Off":- Code:
if not recordset("CheckField1") = "1" then output.FDFSetValue "checkbox1", "Off", false
Last edited by richyrich : May 13th, 2008 at 05:12 AM. |
|
#49
|
||||
|
||||
|
syntax looks fine, bit better coding would be:
Code:
Dim strCheckBoxValue
If recordset("CheckField1") = "1" Then
strCheckBoxValue = "Yes"
Else
strCheckBoxValue = "No"
End If
output.FDFSetValue "checkbox1", strCheckBoxValue, False
|
|
#50
|
|||
|
|||
|
thanks got that going, but this is wierd now, infact its ridiculous
my code Code:
<!--#include virtual='/includes/dbconnection.inc'-->
<%
ID = request.querystring("ID")
SQL = "SELECT * FROM tblRegistrations WHERE UserID="& ID
set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQL, adoCon
If rs.EOF Then
response.Write "That ID Does not exist"
Else
set fdf = Server.CreateObject("FdfApp.FdfApp")
set output = fdf.FDFCreate
'from a recordset
output.FDFSetValue "Name",rs("UName"), false
output.FDFSetValue "Address1",rs("add1"), false
output.FDFSetValue "Address2",rs("add2"), false
output.FDFSetValue "Address3",rs("add3"), false
output.FDFSetValue "Address4",rs("add4"), false
output.FDFSetValue "Postcode",rs("Postcode"), false
output.FDFSetValue "Tel",rs("Tel"), false
output.FDFSetValue "Mobile",rs("Mobile"), false
output.FDFSetValue "Email",rs("Email"), false
output.FDFSetValue "NINO",rs("NINO"), false
output.FDFSetValue "DOB", rs("DOB"), false
error message: Quote:
line 27 is in red, how can i have a type mismatch if ive it works on the lines before it? its exactly the same in everyway but it wont let me add DOB or NINO no matter where i put them i get that message but i dont understand how it can give me that message if it works on 200+ other lines of code :S |
|
#51
|
||||
|
||||
|
What type of fields are rs("NINO") and rs("DOB")?
|
|
#52
|
|||
|
|||
|
text fields, just like the rest
:S |
|
#53
|
||||
|
||||
|
Are they NULL on the record you're getting the details for?
|
|
#54
|
|||
|
|||
|
yes, this matter?
|
|
#55
|
||||
|
||||
|
Yes. You cannot pass NULL values to the FDF.
Try this:- Code:
if not isnull(rs("NINO")) then output.FDFSetValue "NINO",rs("NINO"), false
if not isnull(rs("DOB")) then output.FDFSetValue "DOB", rs("DOB"), false
|
|
#56
|
|||
|
|||
|
thats the trick, that does it!
![]() much appreciated ill add to the rest of the fields to check now i dont think ill have any more problems with this now, thank god lol but i just want to thank you for all your help and assistance youve been really patient and helpful and youve helped me alot for this a thank you alot! ![]() thanks again |
|
#57
|
||||
|