Thursday, 14 November 2013

How to use a Session Parameter

What are sessions?

A session can be defined as a server-side storage of information that is desired to persist throughout the user's interaction with the web site or web application. (Source : http://www.lassosoft.com/Tutorial-Understanding-Cookies-and-Sessions)

In Stadium version 4.1.2344.5213 , we have added Session Parameters. Session Parameters can be used to pass information between pages, like a Page Parameter would. The difference is, you will only need to set it once and use it throughout the application. The values for the session parameter will change in one of the following cases :

1. The session parameter has been reassigned to another value
2. The session expires

How to use Session Parameters?
  1. Add a session parameter in the Application Explorer.
  2. Use the 'SetSessionParameter' action to assign values to the session parameter. Once set, you can use it in any page. Unlike Page Parameter, you will not need to pass the values specifically in the NavigateToPage action.


Where can I use Session Parameters?

Session parameter values can be set from the following sources :
  • Text
  • Page Parameter
  • Control values
  • Custom Settings
  • Value from another session parameter
  • System Variable
  • Variable
Session parameters can be used in the following properties :

Label

  • Text
  • Tooltip
  • Height and Width
  • Font  property
DataGrid
  • DataSource - use values in parameter
  • DataSource - dropdown field query parameter
  • Visibility
  • Column Visibility
  • Column Enable/Mode property
  • SupportsExport
  • PageSize
  • DisplayEmptyDataText
  • Wrap
Button
  • Text
  • Visibility
  • Tooltip
  • Height and Width
DetailsView
  • DataSource- use values in parameter
  • DetailsView visibility
  • Dropdown - query parameter
  • Field Visibility
  • Field Enable/Mode property
DataInput
  • Dropdown values - query parameters
  • Default text
  • Label Text
Link
  • Set Text
  • Set Visibility
Filter
  • Visible
  • Collapsed
  • FieldReadOnlyCondition
TreeView
  • DataSource - use values in parameter
  • Selected Node
RadioButtonList
  • DataSource - use values in parameter
CheckboxList
  • DataSource - use values in parameter
Textbox
  • Text
  • Height and Width

Monday, 28 October 2013

Stadium 4.1.2344.5213 is available

Stadium 4.1.2344.5213 can be downloaded from the Twenty57 website. A big thank you to Dina for all the assistance and to Ryan and Justin for the development work. Please remember to make a backup copy of your css before installing the build so that your custom changes aren't lost.

The build includes the following features and fixes:

  • Session parameters have been added to Stadium 4. They will keep their value until it is changed or the session expires. You create your session parameters on the application explorer tree and set them on a Click Event. The value persists on post back and can then be used in events on other pages and to set control values on the same page

  • Extended password policy - You can now force the user to use mixed case (upper and lower) and include special characters in their password (forms authentication only)

  • Stadium is no longer dependent on MSTDC

  • Details View drop down is required: Ensure all scenarios involving a dependant drop down work correctly

  • Top and bottom padding on a child grid has been exposed in the css; Class .ChildGridPanel padding-top: 5px; padding-bottom: 5px;

    • If you have a custom css and want to make use of these attributes, please include them in the relevant class

  • Allow configurable connection string on the Export to Excel Action

  • New property on the Grid: DisplayHeaderRow. Default value is True. When set to False the Header row is completely collapsed. You won't see the text or the space reserved for it

  • Open and Save file now works correctly when opening in the same window or opening a format that the browser cannot recognise

  • Current File Path and Name displayed in the Stadium Designer Header

  • Bug Fix: Tree View not working with '&' symbol

  • Bug Fix: SQL parameters work correctly when setting a connection string from a SQL Query

Note: You will need to upgrade your SAP files by opening them in the Designer and saving them.

Friday, 25 October 2013

Stadium 5 Beta is available

You can download the beta from http://stadium.twenty57.com so head over and take it for a spin. A very big thank you to Dina, Anton, Shaun, Amol, Ryan, Franz and Shamima for all their hard work, ideas and support.

Stadium 5 is not compatible with Stadium 4. It has a simplified control and functionality set and events and actions are implemented in a completely new way. It can be run side by side with earlier versions of Stadium.

Auto Update

Stadium checks for a new version when you open the designer. If there is one, it will offer to install it.

What you See is What you Get Designer

Controls are displayed in the designer canvas similarly to how they will look in your browser. You can place controls horizontally or vertically without needing panels.

Scripts to execute your click events

We have introduced Scripts in Stadium 5. Scripts are self-contained pieces of code that will do the work when you click a button or link. The components in your script aren't exposed directly to your page controls and your controls aren't exposed to the script components. You will need to create input and output parameters on the script and use these to pass information between your page and your script. The idea behind this is that it allows the same script to be used in different places on the same page and is a better framework for introducing custom actions, allowing the same script to be used across different pages and executing a script on different events, not only click.

Build your own form: stand-alone controls rather than a data input

Instead of a data input control we have created separate controls so you can build the form you want in the layout that suits you best.

Data Model/Data sources

Write all your queries in one place and select which one you want to link to a control or component. You can use the same query in multiple places.

Help

Help is available online: http://help.stadium.twenty57.com. Click the help icon in the menu bar.

Stand Alone Applications as separate sites

Every Stadium application uploaded generates its own code with a separate IIS website and a unique URL. This means you can customise every application in a different way and the generated application is portable and can be installed on any server. To navigate to any application, use this URL.



Admin UI

The Stadium Admin website is only used to manage your applications and users. If you aren't an admin user, you won't be able to access it. If you run many applications and you want one website where the end users can access all of them, build it in Stadium!

Authentication

When you upload a SAP File you can choose whether people need a log-in to access it or whether it should be open for any one with the url. If you require authentication, your application is created with the same authentication method applied to your Stadium Admin Site.


Browser Compatibility

We use HTML5, CSS3 and JS to ensure your site will run in any modern browser as well as on mobile.

No Database needed

Stadium 5 is not dependent on SQL Server to store your application and user information. It is stored in memory. We will look at allowing you to integrate with a database in future releases.

Friday, 27 September 2013

Regional Settings on Server 2012 and Windows 8

We have come across many different errors when users open a SAP file or launch Stadium application on web server. Some of the errors encountered were:
  1. Opening a SAP file results in 'The file is not a valid Stadium application file'
  2. Users are unable to select Date from the DatePicker control. The display resets to ____/__/__ when a date is selected
Many of these have occurred after migrating Stadium application to Server 2012/Windows 8.

The solution was to apply correct Regional Settings in the server. The steps can be found in Zendesk Knowledge Base article :

https://twenty57.zendesk.com/entries/25566633-Date-Picker-not-working-on-Windows-Server-2012-environment

Hence, if you have just migrated the Stadium application to a new server, it is essential to check if the above settings have been applied.

Tuesday, 13 August 2013

Dynamic Connection Strings

Connection is one of the core properties of DataGrid and DetailsView controls. From release 4.1.2311.5146, users can specify dynamic connection strings in the DataGrid control. The connection string can be derived from these 3 sources :

1.  Connection
  • Contains a list of available connections as specified in ConfigSettings --> Connections
2. Custom Setting
  • Contains a list of available Custom Settings as specified in ConfigSettings --> CustomSettings
  • Example of a connection string definition in CustomSettings :
3. SQL Query
  • Store the connection strings in a database table.
  • Write a SQL Query to return the value from database
  • Example :


Tips :
**Query must return only 1 connection string
**You can also use this feature in Dropdown columns in DataGrid

Link DataGrid and DetailsView validations to Button control

Before release 4.1.2311.5146,  data in DetailsView and DataGrid controls are only validated when used with the 'Save and Cancel' buttons. That means, users would have to write custom validations if they wish to use a Button control. Now, you can link standalone buttons to DataGrid and DetailsView validations using the 'ApplyValidationsButton' property. Here's how it works:

1. Create an editable DataGrid.
2. Create a Validation. In this example, I am adding a Required Field Validator.
3. Select the Validation in the DataGrid column.

4. Add a button. Select the button in the 'ApplyValidationsButton' property. This links the button to the DataGrid validation.


Results :
1. The actions on the button will not be executed if any of the validations fail.


Tips :
** This feature also works for Required Field validation in DetailsView dropdown.

Monday, 12 August 2013

Stadium 4.1.2311.5146 is available

Stadium 4.1.2311.5146 is available for download from the Twenty57 website. It includes the following:

New features
  • Dynamic connection strings have been implemented on grids and drop downs in grids. You can now read your connection string from a Db or constant, not only from a fixed value in your config file.
  • Parameters can be passed through to an external page via the URL Viewer.
  • Validations on grids and details view can now be executed by a stand-alone button on the page. There is a new property on the Data Grid and Details View, ApplyValidationsButton. Specify which button on the page should be used to execute the validations. This means that one button can verify the validations on multiple grids and details views.
  •  Install changes:  You can test the DB connection during the install and we will check if the DB already exists when a clean install is done. If it already exists on the server specified we will update it, if we can't find it we will try to create it.
Bug Fixes
  • Export to Excel within a decision is now working
  • Using & in a text filter no longer gives an error
Many thanks to Ryan for all the development work done and Dina for all the testing!

Note: You will need to upgrade your SAP files by opening them in the Designer and saving them.

Tuesday, 28 May 2013

Exporting Reports with Report Viewer 2012

There is a known bug in the Report Viewer 11 component which results in the export of some reports either timing out or taking exponentially longer to complete than previously, especially with large datasets. This is due to Code Access Security (CAS) changes implemented in ASP.net 4. It does not seem as if Microsoft is releasing a fix for it but fortunately there is a work-around. It mostly affects reports using Groupings so one option is to rewrite these to use other report controls. This is not ideal so you can also add the following to the <system.web> your web.config file if you experience this issue.

<trust legacyCasModel="true" level="Full"/>

This reverts the CAS level to ASP.net 3.5. Since we have added all the dll's and 'trust them' this shouldn't have an effect on anything else in Stadium. We have run the build with this change through the automated tests and everything passes.

Additionally, if you are still running Report Server 2005, you cannot view remote reports with Report Viewer 2012. Microsoft only extended backwards compatibility to Reporting Services 2008. If you are affected by this and have no plan to upgrade to a newer version of SQL soon let me know so I can assess the impact and see what can be done to accommodate you.

Thursday, 16 May 2013

FormatConditions - ColourField property

Pre-requisite : Setup a basic Format Condition

Do you need to set the row font colour to be based on value returned from columns or fields? You can do so by making use of the ColourField property in FormatConditions (only available since Stadium 4.1.2280.5070). This property is similar to the ColourField property in TreeView node.

Scenario : Text colour for the 'Description' column is based on values returned from the 'Colour' column

Steps 
  1. Setup a format condition as follows :
  • Conditions - I am setting up a minimum condition so that it applies to ALL data  in the Grid
  • ColourField - The ColourField dropdown contains a list of Text type columns available in the Grid. Select the column which returns the value for colour. My selected column name is Colour.
Apply the format condition to the 'Description' column.


Results

View the application :

The FormatConditions is applied to the 'Description' column. You can see that the colour of the text is set to value from 'Colour' column in the same row.

Tips and Tricks
  1. If the value for ColourField property is defined, other Font Colour values will be overridden
  2. If the text returned from the field is invalid (not a valid colour), it will default to Black
  3. To apply format to all rows, you can set GreaterThanOrEquals '0' for Integer fields, and GreaterThanOrEquals 'a' for String fields.
  4. This property can be found in both DataGrid and DetailsView controls
  5. Only Text type columns are selectable in the ColourField dropdown list.

Global Format Conditions

Pre-requisite : View this post to setup basic FormatConditions.

The recent release of Stadium 4 includes a new feature, which is the Global Format Conditions. This feature allows you to define general Font properties which can then be used in Format Conditions editor. It reduces repetitive actions on applying the same format across different DataGrid or DetailsView columns. Here are some guidelines on how to use this new feature.

Quick step summary :
  1. Add and specify a global format condition in the FormatConditions node.
  2. Select the GlobalFormatCondition from the dropdown list in Format Conditions editor.
  3. Apply the format condition to the DataGrid column or DetailsView field.

Adding a GlobalFormatCondition

  1. Navigate to the FormatConditions node in your SAP file.
  2. Right-click on the FormatConditions node and click on “New Format Condition”. A new GlobalFormatCondition will be added.
  3. Change the Name from default "GlobalFormatCondition1" to “BoldRed”.

Specifying Font properties

  1. On the newly added "BoldRed" condition, expand “Font” property. You will see a list of properties.
  2. Specify the properties according to your requirements. In this scenario, I am setting it to “Bold” and “Red”.

Using GlobalFormatCondition

  1. GlobalFormatCondition can be used within the DataGrid and DetailsView Format Conditions editor.
  2. Open the Format Conditions editor and add a FormatCondition.
  3. Specify Conditions and select “BoldRed” from the GlobalFormatCondition dropdown list. You will notice that the Font properties are automatically populated with the GlobalFormatCondition values.
  4. Click OK.
  5. Link the FormatCondition to a column. The format will be applied to the column.
You can use the same GlobalFormatCondition in multiple DataGrid and DetailsView. Notice that you will not need to specify the same format repeatedly.



Required Field Validation for DropDown fields

In the recent release, we have included a required field validation for DropDown fields. This feature has only been added for the DetailsView control.

Property NameAllowed ValuesDescription
IsRequiredTrue/FalseSet to True if you want the field to be a required   field
IsRequiredInitialValueStringThis property is used to specify the initial value   for the field and compare if the field value has changed.
** Only valid if IsRequired   = True


This  post will teach you how to :
  • Setup required field validation for dropdown field
  • Changing value for selected text
Setting up Required Field validation
Step 1 : Add a DetailsView with DropDown field

Step 2 : Set IsRequired field property to ‘True’

Result :

  • A validation message is displayed when the ‘Save’ button is clicked.

Changing value for selected value in dropdown field
Step 1 : Set IsRequiredInitialValue to ‘I need to change this’

Result :

  • Selected value will be ‘I need to change this’
  • A validation message is displayed if user does not select a different value


Step 2 : Set IsRequiredInitialValue  property as blank

Result

  • Selected value will be blank

Additional information
  1. You cannot change the validation message.
  2. You can use Custom Setting / Page Parameter / System Variable / SQL Query to specify IsRequiredInitialValue text.
  3. If IsRequiredInitialValue is populated, DefaultValue will be overridden

Wednesday, 15 May 2013

Stadium 4 Release: 4.1.2280.5070

Stadium 4.1.2280.5070 is available for download from the Twenty57 website. Please remember to back up your install folder before doing an upgrade. I know many people have edited the css for their chosen theme but the install will overwrite all files (except the web.config file and the configuration folder) to update them with any changes we have made. You can also rename your theme folder to something specific and change the Theme name in your web.config file to point to your 'custom' theme. The upgrade will not overwrite your renamed folder so your changes will not be lost. You will need to merge in any of the changes we have made that you want to make use of. You will need to upgrade your SAP files by opening them in the Designer, clicking Save and then refreshing them on the UI.

It is a bumper release and includes the following features:
  • ExecuteSQLCommand - Parameter Source None renamed to OutputToVariable
  • DisplayEmptyDataText is now a string rather than a Boolean Value so you can set your own message. Default is No data to display
  • The following properties can now be configured at a Global level for the Data Grid: Appearance>DataGrid
    • Column Wrap: Default True
    • Font Size: Default Empty (set from css)
    • Page Size: Default 20
    • Display Empty Data Text: Default No data to display
  • Set the font for a textbox
  • Break Tags are allowed in a label. This is the only HTML allowed
  • The UserApplicationRoleAccessRight view has been updated to include all user information
  • New Task on Site Roles: Assign Users to Site Roles. If checked a user assigned to the Site Role will be able to assign other users to Site Roles. For all existing Site Roles it is checked
  • Required Field Validation for Details View Dropdown. See . There are 2 new properties
    • IsRequired: Default is False
    • IsRequiredInitialValue: Default Please Select
    • If IsRequired is set to True then the first value in the Dropdown will be the Initial Value. The user will need to select a different value otherwise they will get a 'Required Field' message on Save
    • Any Default Value is overwritten in IsRequired is set to True
  • DataGrid Column Visible Property - Specify Condition option
  • Grid Iterator - Option to Auto Generate columns
  • Global Format Conditions Application Explorer>FormatConditions
    • Set the Font properties on a global level
    • On the control you will still need to specify the conditions (since these are usually Page and parameter specific) and select the Global Format from the Dropdown.
    • If you select a Global Format Condition you will not be able to set the Font for that specific Control Format Condition
  • Audit Logging of Users, Applications and Roles add, edit and delete
  • Hide the Stadium Header text on the Admin pages and login or change its value. You need to add the below attributes to the appSettings section of your web.config file. If you don't add them we will continue to display 'Stadium'
    • <add key="HideHeaderText" value="false" />
    • <add key="HeaderText" value="Stadium" />
  • Changes to the Forest Theme shades
  • Editable White space between the menu and the controls. You will need to change the default value in the css file for your theme to change this
    • Class: .MenuContainer
    • Property: margin-bottom: 12px;
  •  Format Conditions on Grid and Details View new property ColourField. It allows you to set the colour based on a value from one of your fields
  • Remember panel position when page is refreshed
  • Image Viewer alters the size of the panel not the image
    • Image with set width (in px) : The size of the image will not change. Only outer panel is resized. Viewing large images will have scroll bars.
    • Image with width (in %) : The size of panel will depend on image. Zooming in/out will not cause panel to resize.
    • Default width : The size of panel will depend on image.
And now for the significant change, Stadium 4 has been Upgraded to Report Viewer 2012 (version 11). We have tested a wide range of reports but please test your reports and let me know if any are not working. Please take note of the following:
  • Update your web.config file to reference Report Viewer 11 instead of 9. There are 2 places to account for different versions of IIS
    • In the HttpHandlers section replace the existing Report Viewer attribute with this one:
      • <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    • In the  Handlers section replace the existing Report Viewer attribute with this one
      • <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
  • Microsoft Report Viewer 2012 runtime is required (http://www.microsoft.com/en-us/download/details.aspx?id=35747)
  • If you don't have SQL Server 2012 or 2008 R2 running, you can download the stand-alone report authoring tool, Report Builder 3.0 (http://www.microsoft.com/en-us/download/details.aspx?id=6116). This is the report builder application for both of these versions of SQL
    • Existing 2005 and 2008 rdls can be opened in Report Builder 3.0. A backup is automatically created for you and when you save the report it upgrades the format
    • Shared data sources have to be created on a reporting services 2008 R2 or 2012 server instance to make use of them in the tool. You cannot link to a shared data source saved elsewhere
    • You can specify a data source within the report that only exists for that report
  • Some 2005 and 2008 rdls do run in Report Viewer 2012 in local mode without requiring an upgrade. Others will give an error and need to be upgraded as described above
  • If you are running your reports in a Reporting Services instance and only viewing them in Stadium, Reporting services should take care of rendering any version of the rdl; 2012, 2008 R2, 2008 or 2005. Reporting services has a built-in 2005 report renderer
  • We have tested viewing reports running in Reporting Services 2008, Reporting Services 2008 R2 and Reporting Services 2012 instances.
Thank you to Ryan for all the development work and to Dina for all the Stadium knowledge and expertise she brings to the feature discussions as well as all the testing done!

Wednesday, 10 April 2013

Format Conditions

Format Conditions can be very useful when you need to distinguish data. In Stadium, FormatConditions property is available in DataGrid and DetailsView controls.

Quick Steps :
  1. Add a DataGrid and add columns to it
  2. Add a format condition in the Format Condition editor
  3. Specify Conditions and the formatting to be applied
  4. In the Column Editor, select the format condition you want to apply

Here are some examples of Conditions you can try :
  1. Apply format conditions to a String value:
  2. Apply format conditions to an Integer value:
  3. Apply format conditions to a Date value (default format is yyyy/MM/dd) :
  4. Apply multiple format conditions using OR operator - add 2 separate Format Conditions

  5. Apply multiple format conditions using AND operator -  combine the conditions
  6. Apply format condition to a null or blank value
**Note :
  • Default Date format is yyyy/MM/dd
  • String values are case sensitive - "Dina" is not equals to "dina"