Expand my Community achievements bar.

Using passed values in SQL statements

Avatar

Former Community Member
Using Adobe Livecycle Designer 7, we wish to populate a pdf document with values from a MS SQL database. The values will change depending on the ID of the record called for.



We can already populate the form using SQL (SELECT firstname FROM names WHERE id = 1), but we need to populate it based on a 'passed' value in a url (http://www.mysite.com/mypdf.pdf?id=1).



When we try to include this into the SQL (SELECT firstname FROM names WHERE id = request.id) we get an error. Could anyone provide us with the correct syntax that will allow us to populate the form based on the ID passed in a URL?



Many Thanks



Craig
12 Replies

Avatar

Former Community Member
But Adobe Reader doesn't support that.So you need Acrobat or Designer open PDF documents that call web service.

Avatar

Former Community Member
Thanks for the link. I was hoping it would be much simpler. Have asked Adobe Support for help. Will let you know how I get on.



Craig

Avatar

Former Community Member
Hi Craig:

(I'm going to guess that you're a web developer, because I am and you're doing what I would try to do as well.)



I've asked around here and what you are doing can't be done the way you are going about it. I'm told that the PDF document can't access many variables outside of its domain, for security reasons.



The functionality that you are trying to emulate is what Adobe provides in a product called LiveCycle Forms. However, the way that LiveCycle Forms does it is different than how you are going about it. You would do this by performing the SQL statement first, transforming the data into XML, then merging the XML with an XDP template and presenting the form.



Mike Potter

Adobe Enterprise Developer Relations

Avatar

Former Community Member
Thanks for your clear & helpful answer Mike. Apologies in advance but I'm going to have a moan about the situation anyway!



We've used Adobe Forms software for years, including Form Server 5 (Livecycle Forms' predecessor). I've not bought into LiveCycle Forms because we simply don't have enough forms where it would be needed (And it's pricey!).



I know it's always been this way, but it's disappointing to see achievable functionality limited by the need to purchase other products. The classic case is needing Reader Extensions to save data in your forms, which a lot of people on these forums seem to find an unpleasant surprise! I gave in on that one and bought licences.



It's hard to defend to my colleagues when I'm unable to achieve such a simple forms requirement, when I've spent tens of thousands of pounds on specialist forms software. Will I spend more? No.



I'm sorry to have my rant on the basis of your helpful post Mike. My frustration lies with the product strategy, not someone such as yourself helping others on these forums. (Just to be clear!).



Have a good weekend!



An electronic forms project manager - UK

Avatar

Former Community Member
Craig:

No problem on your ranting, I understand your frustration.



"We can already populate the form using SQL (SELECT firstname FROM names WHERE id = 1), but we need to populate it based on a 'passed' value in a url (http://www.mysite.com/mypdf.pdf?id=1)." Can you give me a few more details on how you're doing that currently?



Thanks,



Mike

Avatar

Former Community Member
"The functionality that you are trying to emulate is what Adobe provides in a product called LiveCycle Forms. However, the way that LiveCycle Forms does it is different than how you are going about it. You would do this by performing the SQL statement first, transforming the data into XML, then merging the XML with an XDP template and presenting the form."



do you have the this code with you. If you do, can you please post it or mail it to me at siqbal@cfic.com

Avatar

Former Community Member
Hi Mike,



i really appreciated that you have offered so mang help.I met problem that you were talking about.

Could you so kind to mail me the doucuments or codes about the way passing data to form by XML and XDP.

Thanks.



longxiaoshi

Avatar

Former Community Member
Hi Mike,



i really appreciated that you have offered so mang help.I met problem that you were talking about.

Could you so kind to mail me the doucuments or codes about the way passing data to form by XML and XDP.

longxiaoshi@sohu.com

Thanks.

Avatar

Former Community Member
If you are needing support for solutions that you are building, I suggest that you join the Adobe Enterprise Developer Program, where we can give you support by email for solutions that you are building.



Check out the details at http://partners.adobe.com/public/asn/developer/detail_edp.html



Mike

Avatar

Former Community Member
Hi all of you,



I do have a problem with coding correctly a form I am designing sing the Adobe Livecycle . In one of the field, there is an underlying field that when you exit the first name field or the Middle Initial field or the last name, it should all pass the respective values to the underlying field which becomes visible on printout. I do have this code I wrote on the exit event, but do not understand why it it not working. Please, can anyone tell me why it is not working or help me out on a better way of making it work.



xfa.host.messageBox("Check this");

if (EMPFNAME.rawValue <> " " ){

xfa.host.messageBox("EMPFNAME");

EMPNAME.rawValue = String(EMPFNAME.rawValue) + " ";

if (EMPFNAME.rawValue <> " " )&&(EMPMI.rawValue <> " "){

EMPNAME.rawValue = String(EMPFNAME.rawValue) + " " + String(EMPMI.rawValue) + ".";

var s = EMPMI.rawValue;

EMPMI.rawValue = s.toUpperCase();

}

if (EMPFNAME.rawValue <> " " )&&(EMPMI.rawValue <> " ")&&(EMPLNAME.rawValue <> " "){

EMPNAME.rawValue = String(EMPFNAME.rawValue) + " " + String(EMPMI.rawValue) + "." + " " + String(EMPLNAME.rawValue);

var s = EMPMI.rawValue;

EMPMI.rawValue = s.toUpperCase();

}



}



Thanks



Lucky P