Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

HELP: Can't Pass Parameters w/Stored Procedure as Data Connection

Not applicable
I'm working on using an existing employment application in PDF format, and I want the form fields to be prepopulated with the user's specific data.



I'd like is so that when a user clicks a link (like www.mysite.com/empapp/empapp.pdf?UserID=5), a dynamic PDF document will open up and that user's data will be populated inside of the form fields by using that user's "UserID" variable/parameter that was passed in the querystring.



I've tried a stored procedure that contains the following select statement:



SELECT * FROM tblEmpApp WHERE UserID = @UserID



I've also tried entering this select statement manually into the box instead of using a stored procedure without success. When I try to use the stored procedure, I receive this error:



Stored procedure "spEmpApp" has non-optional parameters.



How can I set the PDF doc up to populate the form fields based on that passed parameter in the querystring???



******************PLEASE HELP!!!******************
3 Replies
mcapsi
Level 1
Level 1

Did you get any help with this Katherine?  I have the same problem.

dang_randy
Level 2
Level 2

had this same issue.  following works for me.

-create a dataconnection to the db with a random query to the table.

-just clone the dataconnection

     oDConn = xfa.sourceSet.DataConnection.clone(1);

-change the query attribute to the stored procedure

     oDConn.resolveNode("#command").query.select.value = "exec spEmpApp 'parameter'"

-open the cloned data connection

     oDconn.open();