July 25, 2010

Experience with Crystal Reports printing on Dot Matrix Printer

Since few months, I was working on a project which involved migrating Cobol based ERP application to .NET. It includes writing object oriented code, creating RDBMS database and import data from old files (flat files actually) to this database. And finally generate reports and bills (in huge amount, hundreds of pages at a time)

I have been using Crystal Reports (CR) since a long time, so I decided to go for it. CR is the best tool for designing reports. Its easy and support many export formats. The most exciting thing is – it comes bundled with Visual Studio for evaluation purpose. Hence, I could evaluate it before purchasing.

So, I designed the reports and tested it on regular laser/ink jet printers – it was perfect. The formatting, printing speed and page-breaks was as expected.

In India (as per my knowledge and requirements of this application), even though we talk about e-Governance and paperless office, to submit reports to government (or to be specific RG32 report) it must be in triplicates (on different colour paper). So, laser/inkjet printers was no option and It was a costly solution. Hence, we had to depend on dot matrix printer. But, problems like - the speed of printing which was very slow, formatting which was very dark and incorrect page-breaks on continuous paper were introduced when I printed the same reports on dot matrix printer. The problem is mentioned here and here on MSDN

So, I checked many options (as listed below) from various sources (SAP Forum, MSDN Forum, other software products in same category, etc).

  • I tried exporting report to given formats (Word, Excel, PDF) but the same problem of printing speed, incorrect formatting and incorrect page-breaks remained as it is – unsolved.
  • Some software products used to export the report data to DOS and print from there. This wasn’t feasible for me and didn’t want to do this. Because, actually I was migrating DOS based application to Windows.
  • Install correct printer drivers was one solution. So, I tried latest drivers from manufacturer as well as drivers which comes bundled within Windows. But, it wasn’t the solution. The problem was still there.
  • On some forums (link here), I found out that we need to install Generic/Text printer driver. This will give option to use Draft font with Character Per Inch (CPI) size required for dot matrix printers. The report in viewer showed correctly, but on printer – the same problem.

At last, I found one solution (listed here) which exports the report to text format and print it directly. But then the code was showing error on line

ExportOptions.CreateTextFormatOptions.CharactersPerInch = 16


After searching a lot, I found (actually a reply to my question on SAP Forum) that, the version of CR which comes with VS2008 is BASIC. It doesn’t have export to text functionality (!). I’ll need to upgrade to CR2008 Full. Hence I upgraded to the full version and tested the code mentioned at this link 



And Bingo! I was able to export the raw data to text file and print it directly. And everything (font, formatting, page breaks, speed) was as expected.



There were many other issues which came into picture when I upgraded to full version of CR, like it doesn’t integrate well with VS2008. I needed SP0 of CR2008 to do this integration, then deployment of CR2008 runtime on client machines. But these issues were not of much headache and importance. These all issues are now got resolved and now my project is in testing and final data migration phase.



It is also scheduled for next version with additions of new functionalities.



When people are happy, I’m happy Smile



I hope, this will help developers, who are interested in building applications which involves reporting and printing these reports on dot matrix printers.



Namaste



Mayur Tendulkar | www.mayurtendulkar.com

July 16, 2010

WP7 Developer Tools Beta–Installation Experience

On July 12, Windows Phone team released Windows Phone 7 Developer Tools – Beta. You can find more information about it on their blog (refer links at the end of this post).

However, when I uninstalled CTP tools and tried to install Beta version of the same, I received lots of error messages. Even after uninstall, some tools or some registry entries were present in the system. This problem may persists if you uninstall these tools in incorrect sequence or some other versions of VS (for example RC) or Silverlight (4 Beta) are installed side by side. Following figure shows, tools to be uninstalled and the order of it.

Untitled

If you’re having the same problem, here is the solution.

From Control Panel > Programs and Features select Microsoft Windows Phone Developer Tools – CTP. After its initialization, try to repair the installation. This will repair and correct the CTP installation. Once you have your CTP installation ready.

After this go to Control Panel > Programs and Features and remove the same tool. It will uninstall the tools and remove all entries. Once you’ve done this, start Beta tools installation. This should work.

Following are the resources which you may refer to install the latest tools:

I hope this will help you to kick start your WP7 Development.

Namaste

Mayur Tendulkar | www.mayurtendulkar.com

July 7, 2010

Microsoft Pune User Group Community TechDays, July 2010

I’m very much excited about the event, which Microsoft and PUG are hosting on 17th July 2010. This event, Community TechDays is the place for people to gather, learn new technologies and share their expertise.

This time, I’ll be speaking on Microsoft Windows Phone 7 Development. I’ll try to cover the platform, tools and application development process from scratch. So, if you are a new to mobile development or want to get started with Windows Phone development, this session will be helpful.

Apart from that, my friend Ketaki and Pravin will be taking sessions on Visual Studio Tools for Office (aka VSTO) and Expression Blend 4.

You can find more information about it at: http://www.communitytechdays.com/

Hope to see you there.

Namaste

Mayur Tendulkar | www.mayurtendulkar.com

July 5, 2010

Complete Book Review–.NET CF 3.5 Data Driven Applications

NET_CF_3_5[7]

In my previous blog post .NET Compact Framework 3.5 Data Driven Apps, I mentioned about PACKT Publication’s .NET Compact Framework 3.5 Data Driven Applications book. I just completed this book and I must say, this is one of the best handful books on .NET Compact Framework.

This book covers the entire application development with a nice example of CRM application, running on Windows Mobile device. Developers will learn to build such applications from scratch. A very good practical approach.

Even though, the title is Data Driven Applications, this books covers many other features of Windows Mobile application development. And this is the best part of this book. For example, this book tells you about, how to implement SMS sending functionality, how to intercept incoming messages, which is added bonus.

This book is certainly the best book to read, if you want to get started with .NET Compact Framework based Windows Mobile applications. And it is a must, if you want to build data driven applications (using SQL CE to be precise) for WM.

To read a sample chapter for this book click here.

Happy Reading.

Mayur Tendulkar | www.mayurtendulkar.com