Tuesday, 21 May 2013

XBMCbuntu Frodo 12.2 no Sound over SPDIF after upgrade

I recently upgraded to XBMC Frodo 12.2 and lost my sound over SPDIF. The option for SPDIF wasn’t available in the options.

After some searching around, I found the following forum post;

http://forum.xbmc.org/showthread.php?tid=161251

Which suggested;

1. Set speaker config to 2.0 or 2.1 in XBMC.
2. Set speaker config to 2.0 in osx audio-midi-setup
3. Activate AC3 and DTS options in XBMC
4. Disable LPCM otption in XBMC

Done

Binding the WPF WebBrowser Source Property

In an MVVM application I am currently creating, I had the need to embed the WPF WebBrowser control and quickly discovered that the Source Property is not a dependancy object, and so cannot be bound.

I quickly search around on StackOverflow.com and found a neat solution in c#;

http://stackoverflow.com/a/265648/1305169

The VB Version of which is;

   1: Namespace Helpers
   2:  
   3:     ''' <summary>
   4:     ''' Allows for the Source Property of the WebBrowser to be Bindable to the DataContext
   5:     ''' </summary>
   6:     ''' <remarks></remarks>
   7:     Public Class WebBrowserUtility
   8:         Private Sub New()
   9:         End Sub
  10:         Public Shared ReadOnly BindableSourceProperty As DependencyProperty = DependencyProperty.RegisterAttached("BindableSource", GetType(String), GetType(WebBrowserUtility), New UIPropertyMetadata(Nothing, AddressOf BindableSourcePropertyChanged))
  11:  
  12:         Public Shared Function GetBindableSource(obj As DependencyObject) As String
  13:             Return DirectCast(obj.GetValue(BindableSourceProperty), String)
  14:         End Function
  15:  
  16:         Public Shared Sub SetBindableSource(obj As DependencyObject, value As String)
  17:             obj.SetValue(BindableSourceProperty, value)
  18:         End Sub
  19:  
  20:         Public Shared Sub BindableSourcePropertyChanged(o As DependencyObject, e As DependencyPropertyChangedEventArgs)
  21:             Dim browser As WebBrowser = TryCast(o, WebBrowser)
  22:             If browser IsNot Nothing Then
  23:                 Dim uri As String = TryCast(e.NewValue, String)
  24:                 browser.Source = If(uri IsNot Nothing, New Uri(uri), Nothing)
  25:             End If
  26:         End Sub
  27:     End Class
  28:  
  29: End Namespace

You then use your new Bindable Property in the XAML as;



<Window
    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"
    xmlns:Helpers="clr-namespace:FrontEnd.Helpers"
    x:Class="frmKiosk"
    x:Name="Window"
    
    Width="1920" Height="1080" WindowStyle="None" WindowStartupLocation="CenterScreen" WindowState="Maximized" Background="#FF1327D0" Cursor="None">
 
    <WebBrowser x:Name="wbMain" Helpers:WebBrowserUtility.BindableSource="{Binding KioskWebAddress}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
 
</Window>

Then simply creating a Property in the DataContext, and setting the source like;



KioskWebAddress = "c:/HTML/index.html"

Wednesday, 8 May 2013

Unable to open Database .SQL Files in Visual Studio 2012 Update 1 and onwards

This morning I attempted to open a .SQL file in my Visual Studio 2012 Update 2 installation, and was faced with the following Message Box;

enter image description here

Clicking the “Learn more…” link took me to a “Page Not Found” page, which wasn’t very handy.

A quick search on StackOverflow and I found;

http://stackoverflow.com/questions/15798422/what-about-sql-server-data-tools-for-vs2012-being-incompatible-with-sql-server-2

With a helpful answer by JorgenH directing me to update the SQL Server Data Tools found at this page;

http://msdn.microsoft.com/en-us/jj650015

I downloaded and installed the SQL Server Data Tools, shown at Step 2, from;

http://go.microsoft.com/fwlink/?LinkID=274984

Hey presto, problem sorted!

Wednesday, 1 May 2013

SSRS 2008 R2 on Windows 8… Cannot log in

I recently installed SQl Server 2008 R2 with Advanced Services on a Windows 8 Box. However, when I tried to log into the ReportManager of SSRS, I found that it wouldn’t accept my Username and Password Combo.

After some searching, I found this poston Stack Overflow, which explained it nicely;

http://stackoverflow.com/questions/14433068/user-does-not-have-required-permissions-ssrs-2008-on-windows-8

Turns out, that as standard, the Administrator account isn’t active in Windows 8, and needs to be turned on. More annoyingly, this means that SSRS needs to be uninstalled, and reinstalled using the hidden Administrator account.

The steps I took to finally resolve were;

  1. Uninstall SSRS Node COMPLETELY by going to control panel>SQL Server 2008>Remove>Check Reporting Services
  2. Enable default admin account: command prompt>run as administrator>net user administrator, hit enter.
  3. New line: net user administrator /active:yes
  4. Reboot
  5. Logging in as default administrator
  6. Setup a Password of your Choice
  7. Reinstall the SSRS Node
  8. Install SP3 as administrator
  9. Go to IE.exe DIRECTLY in Windows 8: C:\Program Files\Internet Explorer\iexplore.exe>Run as administrator.
  10. Go to http:// (servername)/Reports
  11. You SHOULD now be able to finally see site settings. NOW YOU CAN FOLLOW everyone's directions of adding YOUR USER under site settings. Also go to folder permissions and add the user as a default here as well.
  12. (optional) For safety I would hide the default admin account now by using step 2 but substitute /active:no in.

SSRS 2008 R2 Reports are blank in Chrome

I stumbled across this apparently well documented problem today, where my SSRS 2008R2 Report was showing up fine in IE, but blank in Chrome;

http://stackoverflow.com/questions/5968082/ssrs-2008-r2-reports-are-blank-in-safari-and-chrome

It seems as though the main Div Tag uses IE compatible only Overflow styles, which Chrome doesn’t interpret well.

I found a nice blog post here which explained how to work around this issue;

http://grumpydba.blogspot.co.uk/2012/02/sql-2008-r2-report-doesnt-show-on.html

The Short and curlies of it are;

Connect to your Reporting Services server, and find the relevant ReportingServices.js file - this will probably be somewhere like "C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js", or on a 64 bit machine, "C:\Program Files (x86)\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportManager\js\ReportingServices.js"


First up, take a copy of this file - let's not be silly here and assume this is a 100% foolproof solution!
Next, edit this file in notepad. Do a quick search for PageLoad, to ensure no-one else has already hacked applied this fix, then jump to the bottom of the existing text.
Simply append the following code:

function pageLoad() 
{
    var element = document.getElementById("ctl31_ctl10");
    if (element)
    {
        element.style.overflow = "visible";
    } 
}


Save the file, and restart Reporting Services - you should now find that Chrome displays your reports again.


You’ll need to find the correct ElementId, by viewing the Source of the report in Chrome. If you search for “VisibleReportContent”, you should find something like “VisibleReportContentctl31_ctl09”. Where the “ctl31_ctl09” is the ElementID you’re looking for!