This blog is a personal outlet to share some things I encounter during my coding adventures and would like to share with the world, so that others (hopefully) can profit by it.

This blog does not express in any way the views and opinions of the companies I work for!

Happy reading and of course leave your comments where you see fit!

donderdag 1 februari 2007

Report Designer flaws VS 2005 SP1

Today I’ve installed the recently released service pack 1 for Visual Studio.NET 2005. Since at the moment I’m working on a really report-intensive project, I noticed some flaws in the Report Designer (that of reporting services) concerning using custom business objects.


In Visual Studio 2005 you have the possibility to use your custom business objects as datasources on which to base your reports. All that the business objects require is one or more procedures which return a generic list (List) compatible collection. These objects btw are also usable inside the ObjectDataSource component.
Since Service Pack 1 however, these custom business objects are no longer visible in the Web Data Sources pane. Before Service Pack 1, they we’re visible, most of the time. If they weren’t usually a rebuild of the site and reopening report would solve the trick, now they are not visible at all, no matter what I do (restarting VS, Windows etc). Did the VS.NET team decide to solve this but by removing the possibility to use custom business objects inside report alltogether? I dont hope so and I dont think so.

There is a workaround which is pretty inconvinient, but I don’t think there’s a choice until the fine people at Microsoft release a fix. The workaround is to edit the report source as xml, entering DataSet tags manually into it (you can copy pieces of report-xml that already contain such custom object data sources). Note that the DataSet tag contains a node which refers back to a DataSource tag in the top of your report, which, in the case of custom objects is called DummyDataSource (pun intended?)




Items
Dnote.TestReport.Model.PersonClass, Dnote.TestReport.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null


true

DummyDataSource



System.Nullable`1[System.Int32]
Id

etc...


You edit a report as xml by right-clicking it in the Solution Explorer, choosing Open With and then XML Editor.

Geen opmerkingen:

Een reactie posten

Labels