Reporting Services Table in a Table

by Ken Tucker 17. July 2010 19:24

I was working on a Sql Server Reporting Services Report and needed to display a table inside of a Table.  I was not able to find a blog entry on how to do it.  So this was goal to create a report that looks like this

image

 

Step one lets create the sql query to get the data from the Northwind database

 

In this query we will get the Orders and Order Details to display in a sub table

 

image

 

Now that we have a query to get the data lets create an sql server reporting project in visual studio 2008

 

Add a new report to reporting project and use a datasource to the Northwind database

 

 

Select
    o.orderid,
    p.ProductName,
    od.UnitPrice,
    od.Discount,
    od.Quantity,
    o.CustomerID,
    o.RequiredDate,
    o.ShipAddress,
    o.ShipName,
    o.ShipCity,
    o.ShipCountry,
    o.ShipPostalCode  from [Order Details] od
    inner join Orders o on od.OrderID = o.OrderID
    inner join products p on od.ProductID = p.ProductID

 

In the design the query part of the wizard use the query above.

 

Select Tabular for the report type.

 

In the Design the table part of the wizard put the orderid in the group by fields and the rest under details

 

image

 

In the Choose the Table screen make sure you enable drill down and sub totals

Finish the wizard and you should get something like this

 

image

 

 

Go ahead and change the report name to something like Northwind Orders

 

In the blue line with [orderid] go ahead and move the CustomerId, RequiredDate, ShipAddress, ShipName, ShipCity, ShipCountry, and ShipPostalCode to the same line.  Adjust title of the column above the fields so you have something like this

 

image

 


Right click on the row with ProductName and select add row outside group above.   In the bottom row give put the ProductName, UnitPrice, Discount, and Quantity fields.  Delete any other fields in that row.  You should have something that looks like this

 

image

 

 

In the row you added the Titles to right click and select row visibility.  When the report is initially run hide the row and have so the display can be toggled by this report item and select orderid

 

image

 

 

 

Now when you run the report you should see a table under the main row.  Hope this helps

Silverlight 3 Could Not download the silverlight Application

by Ken Tucker 11. October 2009 11:53

I created a simple Silverlight 3 app.

 

<UserControl x:Class="SilverlightApplication2.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    <Grid x:Name="LayoutRoot">
        <TextBlock Text="Hello World!" ></TextBlock>
    </Grid>
</UserControl>

 

When I run it I get an error about not being able to download the silverlight app

 

Line: 56
Error: Unhandled Error in Silverlight Application
Code: 2104   
Category: InitializeError      
Message: Could not download the Silverlight application. Check web server settings   

 

Well if you look in the ClientBin folder you will see it is empty so the xap file is not available to be used

 

To fix this right click on the web application and select Build Order.  On the Dependencies tab make sure the Checkbox next to the Silverlight app is checked.

Windows 7 RC User Profile Service Failed the Logon

by Ken Tucker 23. May 2009 21:30

I upgraded my laptop the other day to use Windows 7 RC.  I am really liking the speed improvements and the windows virtual pc that it comes with. Dont forget to enable virtualization on your microprocessor in your computer's bios settings if you want to use windows virtual pc.

 

 The other day after the upgrade I was not able to log into my account. I got an message User Profile Service Failed the Logon.   The error was caused by a messed up registry key for the user profile for my account.  Well I was able to boot into safe mode and follow the instructions in this post in the Windows Vista Forums and fix the problem.  

http://www.vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded.html

 

Hope this helps

Windows 7 RC User Profile Service Failed the Logon

by Ken Tucker 23. May 2009 21:30

I upgraded my laptop the other day to use Windows 7 RC.  I am really liking the speed improvements and the windows virtual pc that it comes with. Dont forget to enable virtualization on your microprocessor in your computer's bios settings if you want to use windows virtual pc.

 

 The other day after the upgrade I was not able to log into my account. I got an message User Profile Service Failed the Logon.   The error was caused by a messed up registry key for the user profile for my account.  Well I was able to boot into safe mode and follow the instructions in this post in the Windows Vista Forums and fix the problem.  

http://www.vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded.html

 

Hope this helps

Space Coast .Net Meeting – June 16, 2009 John Papa

by Ken Tucker 11. May 2009 11:55
John Papa - Ado.Net Data Services

6/17/2009 6:30:00 PM

6/17/2009 8:00:00 PM

About

jp2

John Papa is a Microsoft C# MVP, INETA speaker, member of the WPF and Silverlight Insiders, consultant, speaker, author, and trainer for ASPSOFT who specializes in professional application development with Microsoft technologies including Silverlight, WPF, C#, .NET and SQL Server. John has written over 70 articles and authored 9 books including his latest book Data Driven Services with Silverlight 2 by O’Reilly Media. John is currently working on a follow up to his Silverlight book, with a working title of Silverlight for Business.

He can often be found speaking at industry conferences such as MIXVSLive and DevConnections, speaking at user groups around the country, and viewed on MSDN Web Casts. John also spearheaded the 1st annual Silverlight MIXer, a gathering of some of the most influential members of the Silverlight community for a great night a MIX09. You can always find John at johnpapa.net.

John Papa will be showing Astoria using Silverlight 3 beta as the client.

ADO.NET Data Services (codenamed Astoria) exposes entity models through RESTful services. It can dramatically simplify the code required to expose business objects through web services and reduce a tremendous amount of code. This session will show how to expose entity models using ADO.NET Data Services, how to consume and save data, and how to debug the communications using various tools. When the technology does not quite do what you need out of the box, it also allows for customizations to create custom service operations, intercept queries, and enforce permissions. Attendees will walk away with an understanding of the capabilities of ADO.NET Data Services, how to use them with Silverlight, and when and where it is ideal to use in an application architecture and when there are better options.

Street: 8045 N. Wickham Road
City: melbourne
Country: USA
State: Florida

Getting Windows Mobile Device ID

by Ken Tucker 26. March 2009 21:10

I got email today asking me how to get the device ID from a pocket pc with vb

 

Imports System.Text

Public Class Form1

    <System.Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function GetDeviceUniqueID(ByVal appdata As Byte(), ByVal cbApplictionData As Integer, ByVal dwDeviceIDVersion As Integer, ByVal deviceIDOuput As Byte(), ByRef pcbDeviceIDOutput As Integer) As Integer
    End Function

    Private Function GetDeviceId(ByVal appData As String) As Byte()

        Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)
        Dim outputSize As Integer = 20
        Dim output(19) As Byte

        Dim result As Integer = GetDeviceUniqueID(appDataBytes, appDataBytes.Length, 1, output, outputSize)

        Return output

    End Function

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sbId As New StringBuilder

        Dim bID() As Byte = GetDeviceId("MyAppName")

        For Each b In bID
            sbId.Append(String.Format("{0:x2}", b))
        Next

        Debug.WriteLine(sbId.ToString)
    End Sub
End Class

 

References

 

http://www.peterfoot.net/GetDeviceUniqueIDForVB.aspx

http://msdn.microsoft.com/en-us/library/ms893522.aspx

Getting Windows Mobile Device ID

by Ken Tucker 26. March 2009 21:10

I got email today asking me how to get the device ID from a pocket pc with vb

 

Imports System.Text

Public Class Form1

    <System.Runtime.InteropServices.DllImport("coredll.dll")> _
Private Shared Function GetDeviceUniqueID(ByVal appdata As Byte(), ByVal cbApplictionData As Integer, ByVal dwDeviceIDVersion As Integer, ByVal deviceIDOuput As Byte(), ByRef pcbDeviceIDOutput As Integer) As Integer
    End Function

    Private Function GetDeviceId(ByVal appData As String) As Byte()

        Dim appDataBytes As Byte() = System.Text.Encoding.ASCII.GetBytes(appData)
        Dim outputSize As Integer = 20
        Dim output(19) As Byte

        Dim result As Integer = GetDeviceUniqueID(appDataBytes, appDataBytes.Length, 1, output, outputSize)

        Return output

    End Function

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim sbId As New StringBuilder

        Dim bID() As Byte = GetDeviceId("MyAppName")

        For Each b In bID
            sbId.Append(String.Format("{0:x2}", b))
        Next

        Debug.WriteLine(sbId.ToString)
    End Sub
End Class

 

References

 

http://www.peterfoot.net/GetDeviceUniqueIDForVB.aspx

http://msdn.microsoft.com/en-us/library/ms893522.aspx

Microsoft Patterns &amp; Practices&rsquo; Composite Application Guidance for WPF and Silverlight now in VB.NET!

by Ken Tucker 25. March 2009 06:35

The Patterns and Practices team has released VB versions of the Quick Starts, Hands on Labs, and How to Topics. You can download them here

 

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=537da1cd-43e1-4799-88e7-a1da9166fb46

Microsoft Patterns &amp; Practices&rsquo; Composite Application Guidance for WPF and Silverlight now in VB.NET!

by Ken Tucker 25. March 2009 06:35

The Patterns and Practices team has released VB versions of the Quick Starts, Hands on Labs, and How to Topics. You can download them here

 

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=537da1cd-43e1-4799-88e7-a1da9166fb46

Rendering problems with IE8

by Ken Tucker 24. March 2009 21:18

Microsoft released IE8 during Mix 2009.  Microsoft spent a lot of time making IE8 comply with the browser standards.  When you upgrade your browser to IE8 if you find the web site does not render right.  Do not worry there is a simple fix for this. 

 

There is a tag you can place in the Head section of your webpage which will force IE8 into IE7 compatibility mode.

 

<html>
<head>
  <!-- Mimic Internet Explorer 7 -->
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <title>My Web Page</title>
</head>

 

 


For more info on IE8 compatibility read this article

http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

 

Hope this helps