Ranganathan's Blog

Techie

Monday, July 26, 2004

How to Change Font Color and Size in Crystal Report on Run time

Public Sub setReportStyle(ByVal objReport As Object)
Dim intObjectCount As Integer
Try
intObjectCount = 0
'Checking whether report object is nothing or not
If Not Nothing Is objReport Then
'get all report sections into ReportSections variable
ReportSections = objReport.ReportDefinition.Sections
End If
If Not Nothing Is ReportSections Then
'Iterate through all sections
For Each Reportsection In ReportSections
'Iterate throw all fields in each section
For intObjectCount = 0 To Reportsection.ReportObjects.Count - 1
' for field type objects
If Reportsection.ReportObjects.Item(intObjectCount).Kind = ReportObjectKind.FieldObject
Then fldObject = Reportsection.ReportObjects.Item(intObjectCount)
Dim strName As String
If Not Nothing Is fldObject Then strName = fldObject.Name.ToLower fldObject.ApplyFont(New Font("Arial", 12, FontStyle.Underline))
fldObject.Color = Color.Maroon
End if
Next
Next
End if
Catch ex as Exception
End Try
End sub

How to Lock the DeskTop in different Way 

This is a interesting piece of info that you can use to lock your work-stations without using the combo key "CTRL- ALT- DEL" If CTRL-ALT-DELETE seems like too much of a hassle, try this instead:
 

1. Right click an empty spot on the desktop, point to New and click Shortcut.

2. In the Create Shortcut dialog box, type the following into the Type the location of the item text box: "rundll32 user32.dll,LockWorkStation" // remove quotes while typing

3. Click Next.

4. In the Select a Title for the Program dialog box, type "Lock Desktop" in the Type a name for this shortcut text box.

5. Click Finish.

Sunday, July 25, 2004

Server.Transfer VS Response.Redirect

Server.Transfer is often a better choice than Response.Redirect.

Example: Let's say you're on A.aspx and you want to send the user to B.aspx.

Response.Redirect flowA.aspx calls Response.Redirect("B.aspx",false); which sends a 302 redirect header down to the client browser, telling it that the asset it has requested (A.aspx) has moved to B.aspx, and the web application terminates. The client browser then sends a request to the webserver for B.aspx. IIS tells asp_wp.exe to process the request. asp_wp.exe (after checking authentication and doing all the other setup stuff it needs to do when a new request comes in) instantiates the appropriate class for B.aspx, processes the request, sends the result to the browser, and shuts down.

Server.Transfer flowA.aspx calls Server.Transfer("B.aspx");. ASP.NET instantiates the appropriate class for B.aspx, processes the request, sends the result to the browser, and shuts down.

Note that Server.Transfer cuts the load on the client and the server. Server.Transfer is easier to code for, too, since you maintain your state. Information can be passed through the HTTP Context object between the pages, eliminating the need to pass information in the querystring or reload it from the database.

More info http://dotnetjunkies.com/WebLog/familjones/archive/2004/04/08/11020.aspx and http://www.eggheadcafe.com/articles/20030531.asp.

Tuesday, July 13, 2004

Visual Studio 2005 Beta Documentation

http://lab.msdn.microsoft.com/library/