Thursday, May 30, 2013

Resources for programmers and coders

I found these resources helpful while learning how to code:

  1. When to use classes? This article explains concepts of class, when to create a class, inheritance, composition and aggregation. It provides a visual approach and goes step-by-step from easy to harder concepts.
  2. C# Cheat Sheet: I made a cheat sheet when I was learning C#. It helped me remember common syntax, some important concepts and contains code snippets for a memory refresh.
  3. Learn something new: This website has tons of resources ranging from concepts on algorithms to practicing languages such as C# .You are sure to find something new to learn or brush up your skills http://www.codeproject.com/script/Content/SiteMap.aspx
  4. http://www.experts-exchange.com/tutorials/ tons of free tutorials.

Wednesday, May 29, 2013

Using business objects in Report Viewer in Microsoft Visual Studio - (problems with data sources, data bindings)

I recently started using Visual Studio to create reports from business objects ( objects in C#). However, I must admit, it is a bumpy ride trying to figure out all the nicks and nacks of Reporting Software and the resources available are quite scattered and all over the place. I hope this post will help you to overcome the problems that I had during the development phase.

To create a report using ReportViewer in Visual Studio:

1. Create a new Windows Forms Application Project. This creates a Form.cs file and Form designer file.
2. Add a class which will hold all business objects. Go to Project->Add Item->C# class.
3. Write the code for returning objects in this class file.
4. Now Add a New Item and click on Dataset. If you don't find it, it is probably hidden in the "Data" section.
5. Here you would want to literally draw out your dataset. Use the toolbox on the left to "Add a DataTable". The name of the Datable could be something sensible such as "Products", "Persons" etc.
6. Add methods that return values in the columns of this datatable. Keyboard shortcut is Ctrl + L to add a new column.
7. Once you have finished adding columns, you can create another datatable or hit "Save".
8. Now "Add another Item" and add a "Report" CAUTION: DO NOT USE REPORT WIZARD. CLICK ON REPORT (NOT REPORT WIZARD). DO NOT CLICK REPORT WIZARD. Got it? Good! :)
9. Now you would need to access your Report Data. If you do not already see a Sidebar titled "Report Data", click on View-> Report Data

Search This Blog