Posts

Showing posts from September, 2010

SharePoint 2007 list item print button with SSRS reportviewer

Image
Recently I was tasked to migrate the old Asset data on Access db to SharePoint 2007. It's not difficult using 'Export to Sharepoint List' command and modified certain things such as creating new asset content type, site columns etc. I can view the list and the items. Great. but there is no print button! In Access db, they were using Access form to print the asset item. In SharePoint 2007, turns out that I have to do a bit of development to do just that. I found the nice blog on how to do this. However, I don't want to spend ridiculous amount of time playing with HTML markup to get the design I want. It is error-prone as well in terms of printing etc. Therefore, I decided to try using Reporting Service reportviewer control on the page that will render the layout. The list item details will be passed as parameters :) Cool! If you search google, you would find many articles about passing the parameters in the URL. this is not good since you will get ugly url and i...

.NET Convert Word Document into PDF

Howdy, I came across this old code of converting Word into PDF: This used to work well until recently the avdoc object sometimes doesn't get the instance (i.e. null) , however running it twice usually fixed it. I don't know what caused this. It might be a system update or something. I also researched that the above code shouldn't even work since it's using Acrobat interop to open a 'doc' type - so that code was kind of a hack. To fix the issue, I decided to find alternative way of converting word to PDF pro grammatically. This other way requires office 12 interop instead. So the idea is to open the doc in office and save it as PDF. Simple enough! here is the code: P.S: Don't forget to install Office2007 and Acrobat on the machine :) enjoy!