Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Hi Friends I've Creating an Invoice Windows Application using C# and Crystal Report XI...I want to generate Report in Dotmatrix..I've already Created Crystal Report and its Print fine in Laser printer..How can i Print in Dotmatrix using Crystal Report Without Slow Process..

Thanks in Advance...
Posted
Comments
[no name] 12-Aug-13 10:43am    
"How can i Print in Dotmatrix", the exact same way?
MichealRay 12-Aug-13 11:35am    
Hello Genius i know printing has been executed fine bt printing report has been very Slow compare to .Txt file Printing...i want solution for this....
David_Wimbley 12-Aug-13 13:46pm    
Insults/Sarcasm will only bring the wrath of those more knowledgeable down upon you.

DotMatrix is not lightning fast...there is a reason that printer is old as dirt...without knowing exact details/seeing your code (could your code be optimized?) or peering over your shoulder im going to say you've reached a hardware limitation

There is a reason why printing has advanced since 1980's.
fyulaba 12-Aug-13 15:59pm    
Dot matrix drivers work best with plain text, make sue you don't include any graphics or try and get a text output from crystal

Hi,

To get fast printing with a dotmatrix printer, you have to send raw bytes to the printer. I'd do this:

1. Export the rpt file to txt by using this snipped code:
C#
ReportDocument myReport = new ReportDocument();
myReport.Load(Server.MapPath("~/MyReport.rpt"));

string txtReportContent = null;
using (MemoryStream ms = (MemoryStream)myCrystalReport.ExportToStream(ExportFormatType.Text))
{
    txtReportContent = System.Text.Encoding.UTF8.GetString(ms.ToArray());
}            


2. Install the "Generic / Text Only" driver that comes with Windows and attach it to your dotmatrix printer

3. Use this the code available at http://support.microsoft.com/kb/322091[^] and specify to it the txtReportContent and the printer name
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900