How to print without showing preview?

Posted by Laghaterohan under Regular Expressions on 11/16/2010 | Points: 10 | Views : 4357 | Status : [Member] | Replies : 5
Hello ,

I am developing a web application (C# , vs 2008). I have a form where i enter roll no of students say FROM : 1 TO: 100 . I get total count as 100. After this i have a print button , where in when i click
on it my sp fires returns a dataset which i need to print directly without displaying it in any crystal report etc....

Can anyone please let me know how to PRINT the dataset directly ON A4 SIZE PAPER without displaying it any where?? How can i do it?

IS THIS POSSIBLE ??
OR ELSE CAN ANY ONE SUGGEST ME ANY OTHER WAT TO DO IT?

PLEASE DO LET ME KNOW AS IT IS URGENT...PLEASE SHOW SOME SAMPLE CODE ASWELL...IF POSSIBLE


THANKS A LOT IN ADVANCE!!

Best Regards,
Rohan Laghate



Responses

Posted by: Lalji_mer on: 11/16/2010 [Member] Bronze | Points: 25

Up
0
Down
check this link

http://stackoverflow.com/questions/731049/how-to-print-a-reportviewers-report-without-showing-a-form

LP MER

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 11/16/2010 [Member] Starter | Points: 25

Up
0
Down
THANKS LP MER for your reply however, it is of no use.....:(

Please help me out please...........

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lalji_mer on: 11/16/2010 [Member] Bronze | Points: 25

Up
0
Down
Hi,

Try below code will help
Code Snippet

CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();

string repName = null;

repName = CrystalReportSource1.ReportDocument.FileName;

report.Load(repName);

report.PrintToPrinter(1, false, 0, 0);


More Reference link
http://msdn.microsoft.com/en-us/library/aa691452.aspx

LP MER

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vanchi050585 on: 11/16/2010 [Member] Starter | Points: 25

Up
0
Down
hi,

use crystal report for this



Thanks
tvn

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 11/16/2010 [Member] Starter | Points: 25

Up
0
Down
Thanks a lot LP MER !!!! i hope this solution will work finally!

I really wonder y no such solution i found even though i googled sooo many times for this problem....?


Thanks a lot once again!!



Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response