Skip to main content

hello

i have a form that i want to export all the data that is in the form to Excel or Pdf

how do i do it ?

i try to use this guide  http://help.k2.com/kb001398

but the email that send to me Contains all  the fields of the form blank

You need to use the Save as PDF Smartforms Control - http://help.k2.com/onlinehelp/K2smartforms/UserGuide/4.6.11/Default.htm#PDF_Control.html?Highlight=Smartform%20PDF%20control

the guide It is not clear

Is it possible write down the necessary steps  ?


You put the PDF control on the form ( it's a hidden control ( not visible) at runtime. You point the control properties at the smart object you want to use ( K2 provides a system smart object to capture and store PDFs so suggest you start there) . You configure a rule to execute a method on a control ( in this case Create PDF on the PDF control) . You should be good to go. There is other documentation to explain how to access and use the saved PDF from the system smartibject

If you are using the workflow to get the form and all the forms fields are blank then what you need to do is make sure your URL calls the form in a way to load the data.


For instance assume your URL is http://whatever/runtime/form.aspx this will always bring up a blank form. If you create a paramter called ItemID and you pass this in the url so it becomes http://whatwever/runtime/formaspx?ItemID=X where X is the record ID of the data you want in the form.

 

You then need a form rule that says if paramer specified go get the data for the form. either a method call on the field or a smartobject call that maps the data.

 

Make sure your form works with the URL outside of the workflow. You would use a field to store the ItemID for the URL now when you produce the PDF it will have data. the inout propery for the control is where you use the URL you built. Also a reminder that the workflow runs as the K2 service account so it needs to have access to wherever the data is stored.

 

I hope this helps.


Another way to accumplish this requirement is to create an SSRS report. By calling the SSRS SMO you can export without even opening up the report. This allows export to a variety of formats.

 

This will also give you greater flexibility to format the excel export into a more meaningfull format.


Reply