Recently Viewed...
    |   Register   |   Sunday, September 07, 2008   
You are here:Products  DNN Modules  Dynamic Forms  Dynamic Forms Demonstration 13  


Demonstration on retreiving data from Dynamic Forms







CAPTCHA code image
Speak the codeChange the code
 

Reports (DotNetNuke Reports Module)
First NameLast NameEmail AddressCityHow did you hear about us?
JEbob@bob.comLONDONSnowcovered
AlexKumoklkrfan@gmail.comCordovaFriend
RobertButeau MashpeeFriend
65756  Friend
RayZrayz@mymail.comYorkGoogle
tt  Friend
je  Snowcovered
65756  Friend
asdsfdfdsfdsfsdDotNetNuke®
BobDolebobdole@testing.comBlue SpringsFriend
BobJones  DotNetNuke®
BobJones  Friend
JackJohnsontest@testjoacksonGoogle
JohnJayjcrichton@firsthealth.org Snowcovered
threepounds  Google
je  Snowcovered
mukeshkumar mukesh_santi@sify.comdelhiFriend
je  Snowcovered
STeveBerksberkowitz@tsgmeded.comjkpojDotNetNuke®
gfjghgfudfgutdf  Friend
123456
Dynamic Forms Demonstration 13- Retreiving data from Dynamic Forms

This demonstration illustrates how to retrieve Dynamic Forms results from a specific module instance into a DNN Reports module. This demonstration also includes a few optional features such as displaying a thank you message to the user after submission, and also a clear results link button which a confirmation before the results have been cleared from the form. There are a few things to keep in mind before implementing this type of form / form results.

Things to Consider

 



1) You do not have to pull results from a 3rd party module. There is a 'View Results' feature within Dynamic Forms where you can delete results, view a specific set of results, or export the results to Excel.

 

2) All data is stored within relational database tables, however if you would like to store the data in your own tables you can easily do this with Dynamic SQL Events. 

3) The validation within this form is custom and uses client side events to show/hide required field icons on the page. You do not need to setup validation this complicated if you do not wish too, we are just outlining how you can have more custom notifications that fields need to be required. If you choose to turn on client side validation it will automatically add a red * next to required fields for you.

 

Form Configuration / Setup



1) The form above was created with very standard field types for some common fields and setup

  • Within  the module configuration, general settings,  an option was turned on hide the help icons
  • Within module configuration, clear link/button, the option to enable the clear button is enabled and set to be a text link (other options include image link) and the text was set to 'Clear results'. This feature was also enabled to ask the user if they would like to clear the results first.
  • Example text was initially setup to include HTML for a SPAN tag. This allows us to use client side events to change the content of that area dynamically (from javascript).
  • Client side events were setup to either clear span tag, or to populate it with a required field image. This javascript is listed below for the 'First Name' field, and similar javascript was added for the other two remaining required fields. 

if ($(FirstNameonkeyup) =='')
{
document.getElementById('spanFirstName').innerHTML='< src="/images/required.gif" />';
}
else
{
document.getElementById('spanFirstName').innerHTML='';
}

Note: The short field name for the textbox field also included 'onkeyup' - adding this text to the short field name adds the client side event whenever you press a key, otherwise its only added when you tab off of the textbox (onblur javascript event).

  • The client side event functions were also added to the 'Initial Javascript' setting under Module Configuration, Custom Javascript File, Initial Javascript property. This will force the same javascript functions / code to be rendered after postback. This is necessary if your form posts back and you need to execute the javascript (such as question events, or server side validation).
  • Under Module Configuration, Validation Configuration, the following settings were setup:
    • Client side validation was turned off (we do not need this as we are using our own custom javascript function to show or hide the required field image)
    • Server side validation is turned on (we still need to show the validation summary and force the module to check the required fields for proper requirements and business logic)
    • The configuration was selected to force the user to the top of the page and set focus on the first field in error
    • The setting was checked to display a validation summary message. After checking the box to enable this setting, you can define it within the area under Module Configuration, Header / Footer / System Messages, and selecting the option 'Validation Error Message' from within the dropdownlist.

2) A stored procedure or query was created to render the results of this module. You can get a copy of this stored procedure by reviewing this forum thread. You can also download a copy of this SQL for this stored procedure by clicking here.

  • Keep in mind that if you used SQL Events to store the data into its own tables then you won't need to use this stored procedure.
  • Notice within the SQL some additional clauses were added to not display the postal code column. Even though the question for postal code is a field on the form, you might not want to display that specific field from  within the results. This demonstration should give you a good idea for how you might want to retrieve only specific columns or questions of data.

 

 

Setup the Reports Module


1) This demonstration covers displaying the results within a standard DNN® reports module. Keep in mind that you might consider other 3rd party modules for SQL Reporting purposes that might allow additional features such as searching, charting, or other extended reporting services.

  • Within the module settings add a title and description for this report
  • Within the module settings add SQL to reference the stored procedure for the results. The SQL used for this demonstration was:
    • exec DynamicForms_ExportFormResults_ForTraining 1113
  • Within the SQL to retrieve the results for the reporting, we are passing it the forms moduleID. We determined that this was 1113 by going into Manage Questions/Settings and reviewing the URL within the browser. Typically you can find the moduleID as it will render as &mid=1113 or /mid/1113. This allows us to use the same stored procedure to render specific results only from that specific instance of the module.
  • Within the module settings for this demonstration we enabled paging, sorting, and displaying headers from within the module settings
  • For this example we disabled caching from within the module settings. Caching can be useful but in this example we wanted the results to display immediatly after submission.


In the above demonstration, if a user enters data into the form the results are displayed immediately within another 3rd party module which handles reporting (outside of Dynamic Forms). Implementations such as these can be handled with many other 3rd party modules for advanced integrations and rendering/modifying results or data manipulation.

 
tip6.gifWould you like to setup your form just as this demonstration is setup? If so simply download this template and copy it to your DNN Portals Home Directory to use the IPORTABLE feature of the module (Select Import Content from the module menu and import the template):

 

Feedback Comments
Records per Page
Page 1 of 1First   Previous   Next   Last   
demonstrations@datasprings.com   69   8/20/2008 11:51:31 AM
Caching
In your module, are you redirecting back to the same page or are you not redirecting anywhere? You will probably have to redirect back to the same page instead of setting the redirection to an empty URL.

tom@workmanland.com   69   8/20/2008 11:46:28 AM
caching
You say in the last bullet that you disabled caching. I tried this on my own system''s module using this demo, and can''t get the new row i just entered to show up until i refresh the page. Do you have any suggestions?

Feedback





Enter the code shown above in the box below
Cancel   Send

Copyright 2005 - 2008 by Data Springs, Inc.
Contact Us | Terms Of Use | Privacy Statement