Wednesday, September 30, 2009

Creating an MVC Web Application using Entity Framework

I was walking through some sample MVC applications I found on the web today, by trying to create them myself step by step. Even though I was following the steps explained in them very closely and accurately, I still could not get the Entity Data Model classes to get generated automatically in my application. In other words, even though I would create the sample database as described and the Model, I could not get the Entities to show up in the designer or the Model classes to get created.

I found out that if the tables in the database I am trying to generate a Model for, do not have a Primary Key defined on one of the columns, the EF will not be able to generate classes for the tables in that Database.
The Tutorials that I was walking through for learning MVC using EF did not mention this point.
So this was an important discovery I made and thought I might share with it others who may experience the same problem, in case they are new to EF.

Wednesday, September 9, 2009

Display Column Headers on each page of a Multi Page report created using SQL Server Reporting Services, 2008

1. Click on the down arrow on the side of Column headers at the bottom of the Report area/section.
2. Turn on the Advanced mode if not already on, by making sure that there is a check mark against it.
3. Once this mode is turned on, you will see static columns under Row Groups as well as Column Groups.
4. Select the very first Static section under Row Groups and this will open up the Properties pane on the right hand side for this static section
5. In the properties pane, set the following 2 properties :
a) KeepWithGroup = After
b) RepeatOnNewPage = True

I believe this is all we have to do to make the column headers repeat on each page. Since these settings are not a very obvious part of the report design process, I tend to forget them each time and thought it might be worthwhile to add them to my blog so I can refer to them next time I need to create such a report.