Thursday, February 16, 2012

Show Column Headers on every page in SQL Server Reporting Services

To repeat coulmns on every page of report on SQL Server Reporting Services you need to:
  • select tablix
  • set RepeatColumnHeaders property to True
Unfortunately, this does not work for some reports. In that case you need to:
  • select tablix
  • view Column Groups/Row Groups pane
  • this pane contains a little arrow on the right side that allows you to enter Advanced mode. Select it.
  • You will see one or more (Static) row groups before your regular (Details) group. You need to set their RepeatOnNewPage property to True. 

I've done this from Visual Studio 2008 on SQL Server 2008 R2 Reporting Services report.

Monday, May 2, 2011

rsInvalidDataSourceReference on a Microsoft SQL Server Reporting Services Report


When you deploy reports that were working on one SQL Server Report Server to another without Visual Studio or BIDS you sometimes get errors like: The report server cannot process the report or shared dataset. The shared data source 'MyDataSource' for the report server or SharePoint site is not valid. Browse to the server or site and select a shared data source. (rsInvalidDataSourceReference). This typically does not occur on Development environment because developers use Visual Studio to deploy reports. However, when same reports are deployed to QA or Production environment such errors frequently occur.
Problem is that giud that are referring to data sources are different in different versions of the database.
Execute following script against ReportServer database:
select *
from dbo.DataSource ds
where ds.link is null

The following script may resolve your problem. Again, you have to execute against Reporting Server database. If you are happy with results replace rollback with commit statement:

begin tran
update dbo.DataSource
set Link = c.ItemID
from dbo.DataSource ds
inner join dbo.Catalog c
on ds.Name = c.Name
and c.Type = 5
where ds.link is null

select ds.Link oldlink, c.ItemID
from dbo.DataSource ds
inner join dbo.Catalog c
on ds.Name = c.Name
and c.Type = 5
--where ds.link is null


select *
from dbo.DataSource ds
where ds.link is null

rollback tran
-- commit tran

Thursday, April 7, 2011

How to get rid of IE6?

Some organizations are still (April 2011) using IE 6 as standard (and mandatory) browser. Reason is typically that they have some applications that use one of the technologies (such as ActiveX) that can run only in IE6.
I consider their IT managers "very brave". It is a ticking bomb with many holes that can expose whole infrastructure of an organization.
How to resolve this issue? Some organizations are trying to identify legacy applications, convert them they planning to move to IE 8 (although IE 9 is out already).
Alternative solution is to install another browser like FireFox or Google Chrome in parallel and have people working in it most of the time and use IE (6) only when it is necessary.

Wednesday, December 22, 2010

Stored Procedures in LightSwitch

I do understand that Visual Studio 2010 LightSwitch should be a simple tool for building simple applications, but I would like it to be able to run stored procedures as well.
If you agree with me, please vote for this proposal on Microsoft Connect: https://connect.microsoft.com/VisualStudio/feedback/details/632862/run-stored-procedures-from-lightswitch

As always there is a complicated way to run stored procedures in code.
You could to define a custom WCF RIA Service that exposes your database stored procedures. Then add the RIA Service as a data source.

It is also described in this article:
http://tejana.wordpress.com/2010/12/09/microsoft-lightswitch-and-stored-procedures-using-wcf-ria-services/

However, why should thousands and thousands of developers write something that is relatively complicated and clearly infrastructure work? The deal between business developers and MS developers is that MS provides infrastructure and we do business functionality.

Isn't it better for MS to include this in LightSwich so that developers does not have to write this again and again and again? (Maybe Microsoft should find motivation to do this in how much will they save on support if they do not have to explain and debug this to thousands of people.)

Visual Studio 2010 LightSwitch

Couple of months ago Microsoft announced that they are developing application for creating simple business applications without coding. It is still in Beta 1. This is a simple system that allows you to create forms for aditing database tables and glue them together in an application.

Application built with this are not amazing, but usefull little things that I can quicly deploy to allow customers to search and populate simple set of little tables. Instead of getting an application developer and doing a project for couple of days or weeks, I can provide solution in couple of hours.

Another intersting aspect is that applications can be deployed as Windows (2-tier or 3-tier ClickOnce) or Web (3-tier) applications. This is due to the fact that applications are built on Silverlight platform.

Friday, July 30, 2010

StarInix Database Compare – free SQL Compare alternative

Colleague showed me a nice free program as SQL Compare alternative – StarInix Database Compare. It’s a free program that can compare two database on SQL Server, MySQL or MS Access.

To display TSQL code differences, it invokes ExamDiff  (also freeware and which is installed along with StarInix Database Compare). Unlike Red Gate’s program, it does not produce script that would make databases identical.

Thursday, June 17, 2010

Double-hop on SQL Server

How to set delegation for SQL Server?

How to resolve an error like:

Msg 18456, Level 14, State 1, Line 1
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

It typically occurs when you use linked server – when you request from machine A something from machine B which then requests something from machine C.

Excellent text:

http://kendalvandyke.blogspot.com/2008/11/delegation-what-it-is-and-how-to-set-it.html