Showing posts with label ReportViewer. Show all posts
Showing posts with label ReportViewer. Show all posts

Thursday, November 16, 2006

Great power come great responsibility

Coding in .NET for about 2 years, I got hooked up with the framework damn!
I am not gonna talk about cross platform challenges that Java guy raised. I will do it another day. But hell, what kind of application you want to build? It remind me of an old expression from Microsoft "Where do you wan to go today?" :)

How about creating a ticket system allow user to plug their webcam and capture image do a quick selection (face of cause) and then add it to card tray send cards direct to printer.
How many day? lines of code? will you need to write in C/C++.

At the end of the day, I am the on who scratch my head trying to get thing to work it such a great experience. I hope that my client would enjoy using it ;)

Monday, October 09, 2006

Using collection object as report datasource

Chorn Chan Reasey, my very first daughter.
Well I am not gonna talk much about her now since I am still at my early stage as a father :)

Today topic is:
"How to pass Generic collection to Report.rdlc DataSource"

Well if you follow the walkthrough in MSDN everything seem to work perfect. However I ran into a situation where I define my object as bellow:

class Person{
private string _firstname;
private string _lastname;

public string FirstName{
get{ return _firstname;}
set{ _firstname = value;}
}

public string LastName{
get{ return _lastname;}
set{ _lastname = value;}
}

public Person(string fname, string lname){
_firstname = fname;
_lastname = lname;
}
}

okay, nothing wrong it just a normal object definition right?
Then I go

class PersonList{
List m_Persons = new List();

public List Persons{
get{ return m_Persons;}
}

public PersonList(){
m_Persons.Add(new Person("Chorn
", "Sokun"));
m_Persons.Add(new Person(
"Yim", "Seiha"));
m_Persons.Add(new Person(
"Chorn", "Chan Reasey"));
}
}

again it simple once.
Now when I tried to pass PersonList to Report.rdlc I hope that the following statement will do the job:

PersonList list = PersonList();
personBindingSource.DataSource = list; // this is not gonna work - how I stuck.
personBinddingSource.DataSource = list.Persons; // now it work - right because this is where the actual collection hidden.