concept report in category sql

This is an excerpt from Manning's book SQL Server MVP Deep Dives Vol. 2.
Because you have normalized, queries will be easier to write and understand. Your design is coherent, so you don’t have to spend hours blankly staring at the tables thinking, “What the heck does this mean?” The documentation you created helps clarify what you were thinking in complex cases. You’ve covered the fundamentals of data integrity, so queries and reports all make sense. Because you’ve implemented solid security, your temp worker hasn’t emailed off a list of your customers to his friend Mugsy for 20 bucks. And you have tuned the system so it runs faster. So not only does it work, but it works well and is easy to change when the need arises.
Report element property expressions— These expressions are embedded as Visual Basic source in the RDL where they’re used to set element properties at render time. For example, you probably use expressions to set the BackgroundColor, Visibility, and Value properties. Due to limitations in the report processor, only a subset of the full Visual Basic language is supported for this type of expression. In this approach, changes to report expressions require visiting each place the expression is used, making changes, and retesting the report. Report Code property expressions— In this case, a set of expression functions is saved in the report’s Code property. Individual property expressions are coded to call into functions or leverage variables in the Code property. This means the property expressions are simpler and less change-dependent. The report Code property can contain functions that use virtually all of the Visual Basic language—but no other. External DLL code classes— If expression code needs to be shared between several reports or it’s confidential, proprietary, or overly complex, it can be (and probably should be) compiled into a custom DLL. In this case, the code can be written in any .NET managed code language. The code is invoked by the report processor via references to the registered DLL’s functions. Changes to the coded functions need not require any changes to the report at all. In many cases, you can simply update the DLL and move it to the appropriate location, where it’s invoked by the report processor. This chapter isn’t about creating reports, so I’m not going to waste a lot of paper showing you how to create the report that I’ll use to illustrate the expressions. The report itself is simple. It executes the following query against the AdventureWorks-2008 database:
3. Paste in the code shown in listings 1 and 2 (the functions SetBGColor and SetTextColor) to manage the Color and Text properties into the report Code property editor, as shown in figure 4.

This is an excerpt from Manning's book SQL Server MVP Deep Dives.
Don’t make every string column VARCHAR(255). Don’t make every column that holds money values MONEY. You wouldn’t serve pigs from a teacup, nor would you serve tea from a pig’s trough. Use the right-sized data type; this is the first line of defense in ensuring the integrity of your data. It is amazing how many databases use VARCHAR(255) when the front-end application only allows 30 characters and report definitions only allow 20.
This is a design choice that makes a big performance difference. Drill-down would be a wonderful UI choice if it weren’t for the problem of performance. The issue here is similar to filters. All the data is brought over from the database. Even though the user might never drill down into the data, all of the data is still retrieved. Imagine your query returns an entire year of sales data. You show the per-week totals that can be expanded to show by day and the by-day expanded to show the detail information. This type of report would mean that all the year’s sale data is being processed by the RS engine, which puts a large burden on your server.
A better way of handling this is to design a drillthrough report instead, because RS is optimized for this type of report. Plus, I’ve found that users find the interface quite easy and intuitive. Taking the same example as before, I’d create a report that summarizes the sales per week. Next, I’d add a column and put in a text box report item that says By Day, add an underline, and make it blue. Then I’d use Jump To Report to open up the By Day report.