Monday, November 28, 2011

A New Challenger Has Arrived

Historically, I've run this blog on hand coded HTML, Wordpress, and Textpattern.  Those CMS platforms ran on Linux, Macs, and Solaris platforms.  And now it's all Google.
But what I really miss is my favorite CMS, Textpattern.  So in the interest of restoring some of my historical posts (namely, my Japan trips) and to challenge myself to learn the .NET development stack and Windows Azure platform, I've begun the challenge to recode Textpattern.  Okay, maybe not the whole thing, since Azure supports PHP, but at least get it into my RDBMS of choice, SQL Server.  So, where to begin?

Development Platform

To easy my way into the Windows development world, I'm going to cheat and start with WebMatrix.  It's fast, easy, free and has a one-click installer for everything I need, named:
  • WebMatrix IDE
  • MySQL 5
  • SQL Server Compac 4.0
  • IIS Express 7.5
  • PHP Extensions for PHP
After I've installed the lot, it's a matter of getting the data replayed into a new database.

Getting Your Data Back

Before restoring, I had to brush up on MySQL syntax, but quickly discovered what I needed.  First open the MySQL prompt, connecting with the root password you set during the install.  Then create a target database:
mysql> create database textpattern;
mysql> use textpattern;
mysql> source C:\path\to\mysql-dump.sql;
mysql> exit;
That's all there is to it!

I can has data back!


Connecting The Dots

Next I created a new project in WebMatrix at the root folder of my extracted download of the latest version of Textpattern.



If you'd like to take a look at your data from within WebMatrix, setup a database source connection to MySQL as in the screenshot below.

Setup a MySQL Connection

Look at those pretty tables

Then, I renamed config-dist.php to match the MySQL settings I had configured, just as if I was deploying Textpattern for the first time.

Launching the Textpattern admin interface for the first time forced a minor schema upgrade.  Then switching to the Admin interface, I updated my website URL to match my development environment for relative URIs, and that was all I had to do!

Take a quick look at my 404 page, which is clearly not Apache!
Definitely not Kansas

Friday, November 18, 2011

Why, SSRS, Why?

Once again, I've been digging into SSRS reporting.  Today, I thought to myself, I should had a multi-valued parameter to this report for filtering my tablix aggregations.  So, I created a data-set that was a self-join for gathering a list of Managers.  Easy enough, that'll work great for a drop-down selection.  But let's say a manager wants to only look at certain employees that they manage.  A multi-valued parameter would be great for this!  

I'd like a side of extra values in an array, please.
Add one data-set for that scenario, and re-order the parameters for proper cascading.

Then it's just a matter of adding my managed employees MVP to the tablix filter, right?  Okay, here it is, I'll just double click it and get the right syntax.

What's wrong with this picture?

So, why am I only getting one member's aggregates in my tablix?  This is some serious fail!

Oh, of course!
A few searches through MSDN for syntax and we discover that for multi-valued parameters, appending "(0)" in your expression causes SSRS to query only the first value in your array.  I'm glad that got added by default when the parameter was an explicitly typed array.  Not very conducive for learning syntax on the fly.  But now we've got one (significantly more readable) report.