Sunday, August 23, 2009

Alternating background colors for odd and even tablix rows

In this blog post I will describe how you can add alternating background colors to SSRS tablix odd and even rows.
What do you need to know is that expression evaluation rules in RS 2008 have changed as a result of the new on-demand processing model. As a result, state in class-level instance variables is discarded as you page through the report which makes maintaining state trickier between page requests. However, RS 2008 introduces report variables that guarantee one-time evaluation semantics.

How we can reuse it to accomplish our goal:

  • Create a function that will update _evenRow flag state each time it's called.
Open report properties box -> Code tab -> Add next code:

Public _evenRow As Boolean

Public Function EvenRow() As Boolean
 _evenRow = Not _evenRow
return _evenRow
End Function

  • Create a variable within Row group and set the expression to call EvenRow function. Since it will be evaluated one time per each row it's what we need.

  • Set row background color depending on variable state.
=iif(Variables!EvenRow.Value, "LightGrey", "Transparent")

  • and finally the outcome



Regards,
Oleh

Sunday, August 16, 2009

What's new in WCF 4.0, WF 4.0

A Developer’s Introduction to Windows Communication Foundation (WCF) .NET 4 Beta 1 describing upcoming WCF 4.0 changes has been published on MSDN. The basic idea is to simplify developer experience and provide more integration with WF 4.0. Introduction to WF 4.0 changes could be found here.


Enjoy!
Regards,
Oleh

Saturday, August 15, 2009

Sysinternals Suite updated

Sysinternals Suite has been refreshed with latest releases and new utilities.

"The Sysinternals Troubleshooting Utilities have been rolled up into a single Suite of tools. This file contains the individual troubleshooting tools and help files. It does not contain non-troubleshooting tools like the BSOD Screen Saver or NotMyFault."

Latest version could be downloaded here.

Enjoy!
Oleh

Saturday, May 30, 2009

Wcf svc mime type on IIS.

I have started exploring WCF. The first issue I have got into was that there is no .svc MIME map on  IIS7 on Vista. When I tried to locate the service I always had the same exception: "HTTP Error 404.3 - Not Found. The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."



In order to resolve this you need to run "\%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i". It will create required .svc mapping.

Regards,
Oleh

Wednesday, May 06, 2009

Variable Scope in JavaScript

Recently I had to add some business logic to the javascript client call back function. I had to iterate through a collection of custom business objects and update state of each of them. I made a mistake in the for loop: declared loop counter not as a local variable!
Instead of
for (var i = 0; i < myCollection.length; i++)
I had
for (i = 0; i < myCollection.length; i++)
The outcome was that I was receiving an error "__pendingCallbacks[...].async is null or not an object" every time my function was executed.


My problem was with the i variable scope. It was declared higher in the stack in the WebForm_CallbackComplete() function
for (var i = 0; i < __pendingCallbacks.length; i++)
so really I was using and updating that variable.



Weird behavior after C# where callee is not able to access its caller's local variables.

But I found my mistake pretty fast.



Hope it helps someone.
Regards,
Oleh

Monday, May 04, 2009

VS2010 .Net Framework 4.0 Developer Certification track updates

Just read about new updates regarding upcoming VS2010 and .NET Framework 4.0 certifications. So far looks like the basic exam (70-536) with no longer be a prerequisite for MCTS developer ones and the MCPD track will be updated but no specific updates were mentioned.

There should be some major changes in new exams topics coverage involved I guess...


Stay tuned!
Regards,
Oleh