Thursday, April 10, 2008

Quotation of the Day

"If you do serious Oracle Development, you will be clueless sooner or later." source

Tuesday, April 1, 2008

Edit .csproj file in Visual Studio

I bet everyone had the need to view or edit the content of .csproj file. I used to use notepad to do that. Accidentally I've discovered that it is possible to do so directly in Visual Studio. First you have to unload the project. You can use the context menu on the project in Solution Explorer to do so. Then this context menu changes so that it contains the item "Edit .csproj", by clicking which you can access and edit the content of .csproj file. Don't forget to "Reload Project" after you are finished.

Changing the size of paper in ActiveReports

I wanted to change the size of paper to A4. Thus I set the report's property PageSettings.PaperKind to System.Drawing.Printing.PaperKind.A4. The report designer reflected the change, but quite surprisingly I received the error when running the report:

Printer does not support A4 papersize. Please use PaperKind.Custom in your PageSettings or specify a papersize supported by the current printer

So I used PaperKind.Custom even though my printer supports A4 very well and specified the dimensions of A4 manually. What was my surprise when Adobe Acrobat Reader (viewer) still used the size of Letter! I searched ActiveReports' Support Forums and managed to find the idea of the solution: Document.Printer.PrinterName must be set to an empty string, after that you may specify both PageSettings.PaperKind and Document.Printer.PaperKind arbitrarily; the latter is esential for viewer.