August 2008 Entries

ASP.NET Validation Controls- Good but sometimes I need more

The built in validator controls can remove the tedious code needed to traditionally check user input and I have found that using them in very simple pages is a great time saver but using them on a complex page where valid input varies depending on any number of factors it is better to verify input programmatically, tell the user if there were any problems, tell them what to do, tell them if there were any database errors , or if they successfully completed their transaction. Whenever I create UI...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Cognos 8 date range filter

Business owners wanted a report with a hard coded date range rather than a date range prompt. Customer is always right, especially in an economic downturn. I could not figure out how to do this and after a couple of days of trial and error I got this to work. I hope this saves someone some time. --get past 30 days [Business View].[Sales Tracking Transaction].[Sale Date]between _add_days(current_date,-30) and current_date --get past year [Business View].[Sales Tracking Transaction].[Sale Date]between...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Detailed Error Logging

If detailed error logging is needed you can use the following to get the page name as well as the method name that triggered the error. In my case I log errors to the event log as well as store them in the database using log4net. I like getting back detailed error messages so I can more easily find and fix the related bugs. using System.Diagnostics; using System. Reflection: catch (Exception ex) { //retrieves the name of the page so it does not have to be hardcoded string currentPageName = System.IO.Path.GetFileName(...
  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456