Tuesday, June 4, 2013

Crystal Reports

This is actually a delayed post. Somehow it skipped me to post it earlier. Here goes the story and the details....

In early 2011 had to work on Crystal reports for 2-3 applications that we were converting from Excel to Web apps. 

Being afresh to Crystal reports, we wanted to learn the tool but did not have the time to go to a class room. Hence taking Google as our teacher we researched and learned the tool in a couple of weeks, while simultaneously working on a project.

Sharing our findings below(which i think are pretty neat) in case it is helpful to anyone else with a similar need and situation. 

There are links and videos, arranged in order, to give a newbie good jump start to using the tool.
1.    Crystal reports articles

http://www.beansoftware.com/ASP.NET-Tutorials/Using-Crystal-Reports.aspx : Gives a good introduction to the tool (though not really convinced of PUSH and PULL model).

http://www.c-sharpcorner.com/articles/articlelisting.aspx?sectionid=1&subsectionid=61 : Good repository of various Crystal articles based on your situation e.g: How to pass parameters programmatically to Crystal reports; Crystal reports with Dynamic columns

http://www.c-sharpcorner.com/UploadFile/uditsingh/CR1111022006055359AM/CR11.aspx : Really NEAT on how the author uses Import pick list and simple formula fields to create dynamic columns on a Standard report

         Use the design view in Crystal Reports by Business Objects at www.teachUcomp.com

          Crystal reports tutorial data

         Crystal Reports XI Using the Section Expert (27 videos in sequel)

         Crystal Reports XI On-Demand Sub-reports (27 videos in sequel)

          Formula Field tutorial

          How to create a C# Asp.Net Crystal Report (Part 1)

2.    The link below gives you view of all the CR products, their  assemblies version and supported VS.Net.
It is interesting and an important chart, as the successive CR products do support similar to their predecessors e.g. Crystal 10.5 supports .Net 2008 while CR 11.5 does not.

To be on a safer side, You should ASSUME that Crystal Reports is NOT compatible with new versions of Visual Studio

3.    The 3 links below from a blog give a good idea of using Crystal reports in embedded format versus using them via Servers.
Using Crystal report engine in embedded state, restricts it to 3 simultaneous threads, with the 4th thread kept waiting. (though for certain vendors and OEMs the thread count is higher, as per comments by the author in response to questions)

Wednesday, April 18, 2012

Instagram - Value of Innovation

Many of you may have read or heard about Face book buying out Instagram for $1bn. Interesting deal!

I was reading some blogs on this and thought of consolidating and sharing some of the interesting insights to this deal.

What is Instagram:-

Simply put it is a mobile application which allows users to do some tricks on their photographs and share on Facebook, Twitter, etc. Another interesting fact is that it is an organization of only 12 developers.

Some basic financials:-

Facebook IPO is valued at $ 80bn. With a user base of 800mn, that means $100 per user.

Instagram has a user base of 33mn. So with a buyout of $1bn, it means that it is valued at $30 per user.


So why is Facebook paying $1bn for Instagram? Can’t Facebook develop the Instagram Application? Each of the 12 developers of Instagram would get approx $100mn; would they really be interested in working after that much money?


In all likelihood the 33mn users of Instagram are already part of Facebook. And Facebook definitely has the resources & power to build an application like or even much better than Instagram. But successful consumer product takes more than great technology.

The first product on the market has a big advantage; People get used to the product, invite friends and the growth cycle starts exponentially. And once the user community starts to grow exponentially they are not likely to switch to another product...even if it is better.

Technology can be replicated but not the timing and luck.

Mobile is the future and photos are core to Facebook. And Instagram is better than Facebook in both. And hence the deal is worth the price to Facebook.. though mathematically or numerically it may not make all that sense.

In a similar way, Google video did everything like hosting/sharing a video, but it could not really replicate YouTube. And eventually it had to buy YouTube for $1.6bn though technically it had everything in its Goggle Video.

Monday, July 4, 2011

CSS Sprites and the ASP.NET Sprite and Image Optimization Library

The following link points to an article of Scott Mitchell on using inline Images and CSS sprites to improve the download time of page.


The number of HTTP requests a browser makes to download a page can be reduced by usingf either of the two techniques: Inline images and CSS. But the primary challenge in using these techniques lies in creating the sprites and CSS rules.
The ASP.NET Sprite and Image Optimization library is a free, open-source library from Microsoft that simplies working with inline images and CSS sprites by automatically creating the sprites and CSS rules. This above article showed how to get started with the Sprite and Image Optimization library in WebForms and MVC applications.

Tuesday, June 7, 2011

Ways to define a JavaScript class

Following article gives a good overview of ways to define JavaScript class.

Though the author seems to have dthe point of effectiveness of using prototypes compared to other methods, the reponses by quite a few folks in the article drive home that point quite convincingly.

Overriding/Wrapping/Extending ActiveX and XMLHttpRequest object

Sometimes a special or a custom behaviour may be desired whenever an Ajax call is made from the Javascript code in the page.

In Internet Explorer 6 and earlier, XMLHTTP was implemented as an ActiveX object provided by Microsoft XML (MSXML). Beginning with Internet Explorer 7, XMLHTTP is also exposed as a native scripting object.

The native implementation of the XMLHTTP object is designed with cross-browser compatibility in mind. With just a bit of script, it is easy to build a function that works with either version of Internet Explorer, or any browser that supports XMLHTTP
Also it is more efficient to create a native scriptable object than to create an ActiveX object.

var xmlHttp = null;
if (window.XMLHttpRequest) {
// If IE7, Mozilla, Safari, and so on: Use native object.
xmlHttp = new XMLHttpRequest();
if (window.ActiveXObject) {
// ...otherwise, use the ActiveX control for IE5.x and IE6.
xmlHttp = new ActiveXObject('MSXML2.XMLHTTP.3.0');
//Msxml2.XMLHTTP.6.0 ; Msxml2.XMLHTTP.3.0 ; Microsoft.XMLHTTP

Overriding ActiveX object: Following link gives the details of overriding Activex object:-

The code first stores the instance of the actual ActiveXObject in a variable ActualActiveXObject.
Then the actual ActiveXObject's constructor is overridden with a custom constructor.
The custom constructor creates an instance of the Actual (or the overriden) Activex object.

If the arguement passed to constructor is not "msxml2.xmlhttp", then the instance of the actual Activex object is returned; Else, the rest of the code in the custom constructor is executed which creates a custom object O with certain variables and functions like Open(), Send, ReadyStateChanged(), etc. These custom functions contain user code and eventually call the respective function of the actual instance of the ActiveXObject.

Overriding XMLHttpRequest object: It is on almost similar lines to above code.
The following link and comments in it give details on overriding XMLHttpRequest object.


MVC, MVP and MVVM are patterns, or more specifically architectural patterns, which specify guidelines (or recommended practises) for defining layers within an application and their communication styles for effectively maintaining, scaling, testing, etc the application and its layers.

MVC - Defines 3 layers i.e. Model, View and Controller. Controller receives the UI events and accordingly guides the model and/or view to update themself. And in case the Model is updated from other sources too, it can notify the View(s) to refresh themselves via the observer pattern.
For more details, please refer the following MSDN link:-

MVP:- is a variant of MVC, with the primary difference that there is no interaction between View and Model. And the Presenter interacts with the View via an interface.
For more details, please refer to following article by Dino Esposito:-

MVVM: Model ,View and View Model is very similar to MVP pattern. Or it is some sort of specialized form of MVP pattern. Here Presentator is known as ViewModel.
Model communicates with ViewModel with notification and ViewModel communicates with View with data binding and command .
Following article gives idea of MVVM at high level:-

Also the following link, too gives decent links to various details about MVC and MVP (some video links too are referrred):-

Saturday, February 12, 2011

Basic Instincts: Virtual Method; New; Override

Ever wondered how defining a function as virtual impacts its working at run time and how is it intervowen with the access modifiers NEW and OVERRIDE.

The following sample chapter from Vijay Mukhi will make things very clear. The chapter is in form of explanations of snippets of code, but it is very effective


Essentially to summarize the chapter: Defining a function as virtual gives the power of deciding at run- time which method will be called based upon the assigned object i.e if you have a base class A which is inherited by class B and class C as shown below

Class A
public virtual One()

public Two()

public virtual Three()

Let's assume that class B inheriting from Class A overrides methods One and Three. Now if an object of class B is assigned to a variable of type A; then on calling a.One() and a.Three(); the implementation of these methods in class B will be called.
Since Two() is not virtual, there is no question of overriding it in B and hence a.Two() will always results in calling the implementation of the method within class A.

Also if a virtual method is not overriden in inherited class; by default the access modifier NEW is assumed thus breaking the chain of the virtual method in inherited classes from thereonwards.

But even if the chain is broken, down the line a new chain can be established if any of the inheriting class down the line, defines the same method as virtual and other classes under it override the implementation of the method. But as specified this would be a new chain.