I am working on a windows based application with c# and built in Crystal Report in Visual Studio 2005. CrystalReportViewer is the tool to show the report.
I found that, my crystal report is not getting any information from my system printer. During development, whatever print information I am saving in my crystal report for my system printer (Design --> Printer Setup), according to that I am facing two types of situation here –
- if it gets that printer active during runtime, it’s showing that information properly. After that, If I change my system printer preferences from control panel then my crystal report is not reflecting those changes. It’s detecting that printer but print preferences are shown as it’s mentioned in the crystal report during development.
- Secondly, if it’s not getting that printer active during runtime (Say some other printers are active in my machine at that time), then its detecting the printer but print preferences are showing for the ‘No Printer’ settings in crystal report.
While Notepad, Word every application is detecting the System printer preferences properly. If I make changes in my System printer preferences then also Notepad, Word etc applications are reflecting those changes properly. So, my question is why crystal report is not reflecting the changes we make in our system printer preferences during runtime? Any suggestion or hint will be greatly appreciated. I tried this code also:
bl.PrintOptions.PaperSize = PaperSize.DefaultPaperSize;
bl --> reference to my crystal report object.
But, no fortune.
My default printer is OKI MICROLINE 321 TURBO with paper size Fanfold 15x12 in(Tractor feed). I am using the built in crystal report from visual studio 2005 for my windows based application. While creating the report I have chosen the printer as OKI with Fanfold 15x12 in(Tractor feed) in the Design->printer setup dialog box from my report. The report is showing properly.
After generating the report when I click the print button in the report, the print dialog box comes out as usual. In the print dialog box the default printer is OKI as expected. Its showing the paper size as Fanfold 15x12 properly.
But, the problem is, it’s keeping the paper size as Fanfold 15x12, even if I change the paper size of my system’s default printer(Say A4) in runtime from control panel.