Having fun being a father and a web geek.
Hello, my name is
Who am Who am I? I am a
geek/programmer/webmaster/manager for the bestest company.
I write applications for Web Services and Windows. I also do on the side
contract programming as my time allows (which is not very much).
|Tuesday, December 10, 2013|
Do you see them? Daphne and I certainly did. They look much more severe up close. It actually shocked me when I saw them from the correct angle. Driving by these radio towers almost everyday for the past 14 years, I had never noticed how much the supporting cables actually bend in their own weight. From the sides and from far away it doesn't look like they bend even a little. But up close. Well that is totally different.
|Tuesday, November 12, 2013|
Gorgeously cold cold morning
It was a gloriously cold morning 10 degrees. The lake was steaming, the sun was shining, and everyone was complaining. I was just sitting there admiring that gorgeous sunrise. God is good.
|Tuesday, October 08, 2013|
Sorting your Arrays(I mean your parameters) returned from a SharePoint list
Unfortunately the SharePoint Listing RSS feed will not allow you to actually sort the list. It seems to sort the list sometimes. Especially in development on your machine. But when deployed to a SharePoint or SSRS Reports area the list is no longer default sorted. You can insure your list is always sorted with the following call
So you end up with a parameter list populated with an XML call like this.
rssharepointlist xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
So as you can see from the Microsoft specification if you go look for it. You cannot sort this at all. You can read about that here
the really annoying part is the start of the second paragraph in the applied filters section. "You cannot change the sort order "
can we all just say *UGH* seriously MS why can't I apply a sort to a SharePoint List in SSRS? Oh I know the whole thing about you apply it to the default view. But I have notice that getting lost. I have an actual example of it getting lost but I cannot show it here. Confidential names yadda yadda. Just trust me it gets lost from development on my machine to the deployed state on the server.
So all that being said. What you have in each item in the SharePoint Drop parameters list is an Array of Objects. But you might have one array for the Values and another array for the User readable titles. Case in point the List above. I have the "ID" Field and I also have the " Project_Name" field. The users can read the Title Field but the server can only really read the ID field. So we need a way to make this all work.
Well without futher ado. here is your code for doing just that.
Public Shared Function sortObject(ByVal spstr As Object(), ByVal lblStr As Object(), ByVal iCol As Integer) As Object()
Dim tempLbl(UBound(lblStr)) As Object
Dim tempVal(UBound(spstr)) As Object
tempLbl = lblStr
For i As Integer = 0 To UBound(lblStr)
For j As Integer = 0 To UBound(tempLbl)
If lblStr(i) = tempLbl(j) Then
tempVal(i) = spstr(j)
If iCol = 1 Then
The Call to make this work is something along the line of
=Code.sortObject(Parameters!ProjectNum.Value, Parameters!ProjectNum.Label, 1)
This would entered in the Value area for the parameter. The Label would be
=Code.sortObject(Parameters!ProjectNum.Value, Parameters!ProjectNum.Label, 2)
Where ProjectNum is populated with the dataset from the RSSharePointList dataset above.
Then you just build your new parameter based upon this one with the Code.sortobject calls above.
Hide this parameter and you are good to go
|Saturday, October 05, 2013|
wonderful night for some Marching Bands
We went down to Pella last weekend to watch our girl be in marching band. It was a gorgeously chilly evening.
|Tuesday, October 01, 2013|
Converting a stored RTF binary field into readable text.
Ok, in many ways this is ugly. There are some solutions out there on the net. But they all lack a lot of things. Always remember you have many tools available to you in your endevors. In SSRS more than most things. In Microsoft Project Server you have a field called task_rtf_notes which are the notes stored in Rich Text Format. This really is a double conversion.
In SQL do a double convert
cast(cast([task_rtf_notes] as varbinary(max)) as varchar(max)) as tnotes
In code you would have this then
Public Function casttoString(ByVal rtfbin As String) As String
|Tuesday, September 24, 2013|
SSRS Development. Sometimes you needs to Codez
so you have determined that there is something that SSRS just will not do. And you know you could write alittle itty bitty function to do this thing. And Attaching a function to SSRS reports isn't hard. There are a host of references about how to attach or call the function from inside a report. Code.FunctionName(parm1, parm2) not hard.
But your biggest issue isn't knowing how to do this. Your biggest issue is the Custom Code window under Report, Report Properities. In Visual Studio 2010/2008 you get this little blank box.
You get no code completion. No way of stepping thru your code to know if it actually worked. You type your code and hope. Quite often you end up with an error Function Call is invalid (Please Try try again) I added the Try again.
Isn't that fun, Isn't that special. Just like the old days. Give me a bad text editor and let me at it. Unfortunately if you are like me. I am one of the thousands who stood on my desk and cheered wildly when Microsoft announced intellisense. That might have been the greatest benefit inside of visual studio EVER! Google of course is the greatest outside of VS.
My solution. If you haven't already came up with your own. Is to start a general Scratch pad VS Visual Basic form project. I then throw a textbox on that form and a command button and call the various functions I am writing and testing. I named it something really stupid like soortingstupidSSRS. You can name yours whatever you want. Anyhoo, This gives me the ability to step thru code. and to test it out. Then I can copy/Paste it into the above window in SSRS and 9/10 times it just works. One Time I had to fully reference a dll library for one of the function calls within a function. That is another story. Anyway Create your project and go. Keep it ugly but just make sure it compiles.
|Friday, September 20, 2013|
Last night at the old field
This is the last night at the old field for North Polk football. Gorgeous evening for football.
pictures are here.
Other stuff of interest to people possibly.
Trip to Tahiti.
is nice as well