I've built (literally) hundreds of reports using different versions of Crystal Reports. You can produce great output with it, which makes users happy. However, Crystal also has quirks, which can frustrate developers. Fortunately, some can be resolved.
For example, suppose you've created an ADO.NET DataView (e.g. AmountOwed > 5000), and you want to generate a report based on the contents of the dataview. So you instantiate the report object, and issue the following:
oMyReport.Database.Tables[0].SetDataSource(MyDataView);
It compiles and runs without error - but the report output is blank! As recently as CR10, Crystal doesn't handle dataviews the way you'd expect. Business Objects confirms this as a known issue, and suggests that you populate a new DataTable object with the filtered data and pass that table object to the report.
I haven't tested brand new CR11 yet to see if it supports DataViews. Even if it does, there are probably thousands of developers who have to stay with prior versions of CR.
In VS2005, converting a dataview to a datatable is easy - you can take advantage of the new DataView.ToTable method. However, those using VS2003 must write some code. I'll be back tomorrow with a little bit of code to handle that in 2003.
Peace out...KG
Comments