Monday, 23 May 2016

Adding BI4 designer.exe as a reference in Visual Studio on Windows 7

Recently I had been having massive problems trying to get designer.exe added as a reference in Visual Studio. I had installed the BI4 client tools, I could see it as an option to add as a reference but whenever I added it I got the following error...

A reference to 'BusinessObjects Designer 14.0 Object Library' could not be added. Could not register the ActiveX type library 'C:\..\win32_x86\designer.exe'.

I tried registering designer.exe via regsrv32.exe, I also tried registering designer.tlb, but nothing seemed to work.

After searching far and wide, I came across this stackoverflow post.

And after registering designer.tlb using regtlibv12.exe, I saw a new entry in the available references for BusinessObjects Designer 14.0 Object Library. The notable difference here is that the version number was listed as 14, whereas the original entry was listed as version 20. I added this and everything was good to go.

Specifically, what I did was

  • opened a cmd prompt (as administrator, but I'm not sure if this was necessary. 
  • cd to the business objects installation folder (C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86)
  • run the command
    • C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe designer.tlb
  • You should then see "Registration of designer.tlb successful." returned.
  • Add the reference in VS.

Thursday, 2 October 2014

Logging into postgresql database through powershell

Something I spend a while trying to figure out that may be of help to someone is how to provide a password when logging into a database using psql.exe.

When logging in, powershell just hung because when logging in at the command line, you are then prompted to enter the user's password.

The way around this is to set a temporary environment variable for the username you are logging in as in the powershell script. This will only exist for the duration of the running script.

$Env:PGPASSWORD = "YourPasswordHere"
$sqlScript = "C:\script_location\script.sql"
$executeCommand = 'psql.exe -d DBNAME -U USERNAME -f $sqlScript'
iex "& $executeCommand"

Friday, 5 September 2014

Having to open Excel spreadsheets twice

For as long as I can remember I have had an issue on my work laptop where if I open a spreadsheet, Excel will open but only the application. I then had to open the spreadsheet again in order to view it.

Most solutions I cam across said to uncheck the "Ignore other applications" setting in excel options but this didn't work in my case.

Today I came across this blog post by JClermont which has resolved my issue.

  1. First, open any folder in Windows XP.
  2. Click on the Tools menu, and choose Folder Options.
  3. From the dialog that pops up, click the File Types tab. You will now be presented with a list of all document types recognized by your computer.
  4. Scroll down to XLS, select it, and click the Advanced button. Now you'll see several "Actions" registered for Excel worksheets.
  5. Usually, Open is the default (indicated by being in bold). Select "Open" and click the Edit button.
  6. The main piece of data in here is the field labeled "Application used to perform action". This should point to your Excel executable, followed by some command-line arguments. Here's how it appears on my PC: "C:\Program Files\Microsoft Office\Office\EXCEL.EXE" /e "%1"
  7. It is very important to make sure that the %1 is surrounded by quotes. %1 is the variable representing the full path and file name of the document you are opening. If it contains any spaces, and this is not surrounded by quotes you will get a flurry of weird errors.
  8. "Use DDE" is normally checked. Now, make sure that "DDE Message" is empty. Click OK.
  9. Click OK back at the Edit File Type dialog. Click Close on the Folder Options dialog.

In my case, the "Application used to perform action" was missing the "%1" parameter.

Tuesday, 30 July 2013

Make chrome open a search from the address bar in a new tab (when you want it to)

Sometimes I want chrome to open a new tab for a search done in the address bar, but not all the time.

In order to do this without messing around with the chrome settings and making it a permanent feature, just press the Alt key before hitting return when you've entered your search into the search bar.

Wednesday, 3 July 2013

Fixing notepad++ file associations

I decided to move from using the ANSI version of notepad++ to the Unicode version but upon doing so I managed to royally screw up the file associations for files with the extensions .txt, .sql, .log etc.

The best I could manage was having them open with notepad.

Open with Notepad++ was missing from the right click context menu and when I tried to select a program to open text files with Notepad++ wasn't listed. Even when browsing to the location of the Notepad++.exe file this wouldn't work.

Turns out something got buggered in the registry settings.

For the key...


this had been changed to some office type MS monstrosity.

I changed the value for the (Default) String and replace the file path to the path to where Notepad++ resides, in my case...

"C:\Program Files\npp\unicode\notepad++.exe" %1

note the "%1" refers to the file name being passed to the command.

This then allowed me to select Notepad++ from the open with context menu and then tell XP to remember the file association.

UPDATE: Something else stopped "Open with Notepad++" appearing so what I did was went through all registry keys searching for "Notepad++" and where an old file path appeared (I had paths for older versions of NPP appearing in "open with" shell commands) I replaced these with the correct file path for notepad++.exe.

Working ok now.

Thursday, 13 September 2012

Copy TOAD's Schema comparison sync script

TOAD does not allow you to copy the sync scripts created by it's schema comparison tool unless you shell out for the DBA Modules add in. All you can do is print it to a stupid xps file.

In order to get around this I created a small autoit script to copy the output to your clipboard.

Here is the code

Opt("WinTitleMatchMode", 1)

WinActivate("Toad for Oracle")

$Text=ControlGetText("Toad for Oracle","","[CLASS:TAdvToadSyntaxMemo; INSTANCE:1]")


If $Text Then 

   MsgBox(0,"pwnt","Copied to clip board")


   MsgBox(0,"uh oh","Couldn't copy text. Has the schema comparison been run?")


If need be, I might upload the compiled exe file.

Tuesday, 8 February 2011

I just received my first Arduino through the post. I went with the Arduino Duemilanove ATmega 328 which I bought on eBay from the seller who I can highly recommend. Their feedback speaks for itself.

I haven't had a chance to properly play around with it yet due to a house move but I will post something later on about it.