Tuesday, April 15, 2014

H2O contains a default results view that uses the same features as the Table Results view in the Form Editor.  You can over-ride this view for each project to build a custom view of records, allowing you to easily build modules for Classified postings, Job Postings and more. To change the result view, open the project details for the project you want to change the displayed results for and type in your template into the field View HTML. This field can contain any valid HTML. To indicate where field values should go, just type the name of the field into your template. For a link to open the item, use the text “ProjectToolId”.

Here is a sample taken from the H2O Classifieds Projects for an older version of H2O (a new version for H2O 4.0 will be available soon): (Field Names are Bold)

<table border="0" width="100%" cellspacing= "1" cellpadding="0" id= "table1">
   <tr>
          <td rowspan= "2" width= "73" valign "top" ><font SIZE="2" >ProjectToolId </font></td>
          <td rowspan="2" width= "161" ><font face= "Verdana" size= "2">
          <img border="0" src="/Portals/0/ImageURL" width= "161" height="125"></font></td>
         <td><font face="Verdana" size= "2"><b>Title</b></font></td>
  </tr>
   <tr>
          <td height= "91" valign= "top" ><font face= "Verdana" size= "2" >Description </font></td>
   </tr>
</table>

Filtering and Sorting the Results View
To set the filter and sort settings for a specific module, open the Project Details in the module you want to apply the filter/sort to and enter your setting into the text boxes provided. Filter and Sort Rules are the same as the standard .Net View object rules. For example, to filter by the column UserID you would type “UserId>1”. Note that if you did not use standard naming conventions then you may need to include brackets, for example: “[poor field name] = 50”.

 

The image below is a sample custom view in H2O

New changes for v4.0.28
Past versions of H2O allows you to create a filter that will select specific data from the results.  For example, if you created an H2O Form that is attached to the SQL Server View: ONYAK_SIGMAPRO_IssuesView and in the Project for your H2O Form you set the Default Filter to IssueOwnerID='[USR-USERID]', then H2O will only display SigmaPro Issues where you are the current Owner.  The fixed parameters you can use in your filter are the same for parameters you can use in your SQL Enabled controls.  For a list, go to http://dnnforms.com/HowTo/WorkFlowandDynamicSQLDrivenControls/tabid/64/Default.aspx 

With the release of H2O v4.0.28, this has been extended to include Query String and Session values.  For example, if you have a QueryString paramter of USERID and you wanted to filter the H2O results where the UserID parameter matched the OwnerID field, then you would type IssueOwnerID='[QRY-USERID]' into the Default Filter field in the project details.  Your URL may look something like the following: default.aspx?USERID=5

If you wanted to use Sessions to prevent the user from tapping into the querystring, then you would type your filter as IssueOwnerID='[SSN-USERID]' 

Copyright 2012 by OnyakTech Privacy StatementTerms Of Use