A couple of tips for creating lookup columns as a feature

June 29, 2008 by steenbach

I recently used Chris O’Brien’s approach to create lookup columns as a feature, and it works great.

After some time, I was making a query to the SharePoint webservice, for some reports I was making – by the way, I’m using Enesys RS Data Extension for this job, I can recommend that product, it makes it much easier to write queries to SharePoint lists.
So I noticed that the columns made with Chris’s approach was not included in the response!…. Strange…

I was able to access the fields via the Object Model without problems. 

It took me quite some time to figure out, but eventually ended up compairing the SchemaXML to a regular lookup column, made in the SharePoint UI.
And there were some differences.

On my custom made lookup columns there was a namespace attribute.
After removing the attribute in the FeatureActivated method everything is running as it should.

 

 

Thanks to Frederic from Enesys for pointing me in the right direction!

Prepare your report date fields for Excel export

May 26, 2008 by steenbach

I made some rdlc reports to be shown in report viewer.
Often theese reports are exported to Excel, for further processing.

I made a typed dataset for my tables, defining the date columns as ‘xs:date’
To remove the timestamp in the report, I used FormatDateTime(Fields!OrderDate.Value, 2), and everything was fine….. Untill the users start complaining, that the date columns where not formatted as date in the exported excel sheet.

The solution is to use the ‘Format’ property of the field, here you can specify the formatting for dates.
For example =”dd/MM/yyyy”. Here you can also make an expression to handle different language options etc.
This approach preserves the date format in exorted excel sheets.

Vidnik – nice video app for YouTube

May 10, 2008 by steenbach

I came across a project called Vidnik af Google Code.
It’s a nice little app, that records video from your iSight camera. Then you can do basic cropping, and upload the video to YouTube from within the program.

The project is still in it’s starting fase, but it’s simple and nice.

Keyboard shortcuts in Mac OSX for Visual Studio

May 9, 2008 by steenbach

If you’re lucky enough to have an Intel Mac, you will be able to run Visual Studio via Parallels – nice:)

Pretty fast you will discover, that some of the often used characters when coding, are not available right away.
For example curly brackets, square brackets and other shortcuts connected to the ‘Alt Gr’ key.

Fortunately you can use Ctrl + Alt – and you’re ready to go…. almost…

So far, I haven’t been able to use backslash (on my danish keyboard, that involves Alt Gr)
If anyone has found a solution – please leave a comment! 

Restrict users shown in the peoplepicker in SharePoint

May 8, 2008 by steenbach

It is possible to restrict the search in the peoplepicker, so it only contains users that are registered on the site collection instead of the entire domain.

Stsadm.exe -o setproperty –url http://sharepoint –pn peoplepicker-onlysearchwithinsitecollection –pv yes

 

 

Importing custom certificate to Windows Mobile device

May 8, 2008 by steenbach

If you have an Exchange setup with your own ‘homemade’ certificate for the front-end, you will need to import the certificate to your mobile in order to connect to the exchange server via ActiveSync.

But by default Windows Mobile won’t let you install custom certificates.
So we need to do a little registry hack (remember – this is just a windows box).

  • Download the utility RegEditSTG – a registry editor for Windows mobile.
  • Change the registry key: HKLM\Security\Policies\Policies0001017 = 144
    And remember the original setting – we must revert i later 
  • Now you will be able to install your custom certificate.
  • Now change the registry key to it’s original value.

Stramit SharePoint Caml Viewer

May 8, 2008 by steenbach

If you’re developing for SharePoint, this is a must have tool – and it’s free:-)

Stramit SharePoint Caml Viewer lets you create a view via the SharePoint GUI, and then you can go behind the scenes with Stramit SharePoint Caml Viewer, and see the xml markup query.

Check it out: http://www.codeplex.com/SPCamlViewer

Reporting on SharePoint Data – Enesys RS Data Extension

May 8, 2008 by steenbach

If youre looking for an easy way to make Reporting Services reports on SharePoint data, RS Data Extension from the company Enesys is worth taking a look at.

I downloaded the trial, and spend about 10 minutes installing it, and it worked right away.

Very easy, and really powerfull tool…

http://www.enesyssoftware.com

SharePoint and Reporting Services integration

May 8, 2008 by steenbach

I’m currently working on a SharePoint project, where we have to run some Reporting Services reports on the SharePoint data as well as data from a DB2 database.

The tricky thing is that SharePoint site is public available to known users, but how to handle authentication with Reporting Services??

Well – Microsoft fixed that for you in SP2 for SQL Server 2005, where they introduced a feature called Reporting Services in SharePoint Integration Mode

I’m still in the early adoption fase, but it looks pretty promising to me – decide for your self…

http://technet.microsoft.com/en-us/library/bb326290.aspx

Improving code readability when using iDB2 .Net connector for iSeries

May 8, 2008 by steenbach

I have done a few apps over the last years using IBM’s .Net data connector for iSeries (i5)

When you use the DataReader, you usually end up with a lot of places where you access the content of your datareader like this: ‘dr.GetString(8)’
The problem is that after some time you can’t remember which fields actually had number 8 in the array, and you have to go to your SQL statement to find out.

I came across the method “GetOrdinal” on the DataReader object and wondered what was the purpose for that, and after a little googling, I found out, that it actually solved one of my everyday problems (a small one, but anayway;))

So here is how it works.
In the scope of ‘while(dr.Read())’, you call the method with the DB2 field name, and it returns an integer telling the index of the field in the datareader array: 

int db2CustomerNo = dr.GetOrdinal(“ODKUND”);

and then in your code, you can access the field using your assigned integer like this:

dr.GetString(db2CustomerNo)

No rocket science – just a little trick, that makes your day a little bit easier;)