You can insert a line feed / carriage return by inserting 'Chr(13)' in your selection formula in Crystal Report.For an example,StringVar textToDisplay := "Title for the Cross-Tab" + Chr(13) + "Period from Year X to Year Y"Happy Coding...
Tuesday, December 30, 2008
Thursday, December 25, 2008
C# array in descending or reverse order
How do you sort a C# array in descending or reverse order? A simple way is to sort the array in ascending order, then reverse it:int[] intArray = new int[] { 3, 1, 4, 5, 2 };Array.Sort<int>( intArray );Array.Reverse( intArray ); Of course, this is not efficient for large arrays.A better approach is to create a custom Comparer. Following is a nice generics class that will sort an array in descending order. Note that the object type must be comparable (inherit from IComparable) as any useful class should.Here’s a simple web application to...
Saturday, December 20, 2008
Design Pattern - Abstract Factory Pattern
Today I'm going to write about one of the most popular patterns in the design patterns world - the abstract factory.You can read my previous posts about design patterns here:Design PatternSingleton Design PatternAn abstract factory provides an interface for creating families of related objects without specifying their concrete classes.The abstract factory dictates which products the concrete factories will produce. Each concrete factory can build...
Design Pattern - Singleton
Before we move to Singleton pattern, first we should know what is instantiation and how it will play main role in Singleton.Please refer my previous post for basic information about Design Pattern if you needs.Instantiation means creating an object using a class as a template. There are two approaches to instantiation:Lazy instantiationEager instantiationLazy instantiation : a class is not instantiated until a request is made via the Singleton.Instance()...
Saturday, December 6, 2008
Highlight Datagrid or GridView row on mouse over in asp.net
To highlight the row and when mouse moves out, the style sheet is switched back to normal. Use the following two steps to solve this case. This will applicable for both Gridview and Datagrid controls.Step 1 : Create styles for normal and highlight view of the row.<style type="text/css">.normalrow{ background-color:white;}.hightlighrow{ background-color:#cccccc;}</style>Step 2 : Now add handler for RowCreated event for the grid and add the attributes for onmouseover and onmouseout javascript events.Following...
Friday, December 5, 2008
Allow only numbers / digits in TextBox.
Allow only numbers/digits in TextBox. How to use Javascript to allow only numbers to be entered in a textbox. This is useful for phone numbers, ZipCode, and etc., Use the following two step to solve this situation. This solution works in both IE and Netscape/Mozilla. Step 1: Add the following javascript into you page.function AllowNumbersOnly(evt){ // Allow numbers only in the Textbox. var e = event evt; // for trans-browser compatibility var charCode = e.which e.keyCode; if (charCode > 31 && (charCode < 48 charCode...