Highlighted

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

Avatar

11-02-2009

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!!!******************

Replies

Highlighted

Avatar

Avatar

mcapsi

Avatar

mcapsi

mcapsi

14-12-2012

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

Highlighted

Avatar

Avatar

dang_randy

Avatar

dang_randy

dang_randy

26-12-2012

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();

Highlighted

Avatar

Avatar

mcapsi

Avatar

mcapsi

mcapsi

27-12-2012

Thanks a lot randy, this is awesome!