Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Printable responses from BizForm View modes: 
User avatar
Member
Member
matthew.newby-crl - 6/17/2013 2:28:46 PM
   
Printable responses from BizForm
I'm trying to create a printable version of a BizForm containing the data supplied by the user when they fill the form out. One of our business requirements is that when submitting a physical sample to us, the customer can fill out the form online to let us know what's coming, but they have to print out a copy of the filled-out form and include it in the shipping container with the sample.

I saw the article How to display data of BizForm for print in the KnowledgeBase, but using the URL-based RecordID query string parameter opens up a vulnerability to URL-hacking wherein a customer could alter the URL of the resulting printable page to view other customers' forms. The alternatives to this that I can see include: build an account provisioning mechanism such that the customer has to create an account and log in to fill out the form, and also configure the security for the bizform data so that they are the only ones who can view their own submitted records (I'm new to Kentico, so I don't know how to do that yet). Or, to build a security-by-obscurity model by creating some kind of GUID as the record ID, embed that on the bizform, and send them to the result page using the GUID as the URL parameter.

I've also been considering having something in the Autoresponder email, but the problem there is that we have some criteria for how the printed form will appear, and I'm personally aware of organizations that prohibit HTML-formatted emails entirely.

I'd much rather simply display the form data on a page during the submit process, so the customer can print it out. Is this even possible? If so, how do I do it?

User avatar
Member
Member
Swainy - 6/18/2013 11:15:15 AM
   
RE:Printable responses from BizForm
Hi Matthew,

You could do the GUID method that would work and just map a GUID to a biz form ID in a custom table.

If you only need it to be available at that point (and you don't need the user to be able to print it again), you could override the BizForm_OnAfterSave method in the web part and put your own logic for how you want to display the data out onto the page.

Thanks,

Matt

User avatar
Member
Member
matthew.newby-crl - 6/18/2013 12:24:18 PM
   
RE:Printable responses from BizForm
Thanks for the lead, Matt. My inexperience with Kentico is about to show up... How would I do either of these -- do I need to do something in Visual Studio? Or is there some way to get a GUID on the form through the CMS Desk interface? Where would I override the BizForm_OnAfterSave method?

If this is documented somewhere, I'm more than happy to read docs, but I don't know where to start...

-matt

User avatar
Member
Member
Swainy - 6/19/2013 3:33:01 AM
   
RE:Printable responses from BizForm
Hi Matt,

No worries.

If you look here http://devnet.kentico.com/FAQs/BizForms.aspx#FAQ480 and open the top accordion FAQ item it gives you a link on how to modify the standard web parts (you might want to duplicate it and create your own rather than alter the satndard one as you occasionally run into issues when upgrading).

You can then override the method as describe there (except onAfterSave rather than onBeforeSave).

For the GUID (assuming you need this) my suggested approach would be to create a custom table which stores the FormID and the GUID in two fields, you can then give the link with the GUID, check the custom table to find out the FormID and then load the correct form data.

Info on custom tables can be found here:

http://devnet.kentico.com/docs/7_0rc/devguide/index.html?custom_tables_api_examples_managing_custom_table_data.htm

But generally use (if v7).

CustomTableItem cti = CustomTableItem.New('TableClassName');
cti.SetValue("FormID",formID);
cti.SetValue("GUID",Guid);
cti.Insert();

to insert the custom table item.

Then use CustomTableItemProvider ctip = new CustomTableItemProvider();
ctip.GetItems("TableClassName","GUID = '{0}'","");

to get the item.

Any questions just shout :)

Thanks,

Matt

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 6/27/2013 5:19:56 AM
   
RE:Printable responses from BizForm
Thank you, Matt,
for all the comprehensive answers!

Regards,
Zdenek