I hope you figured how to show or render a crystal report. But to print it on server side i guess you are trying for. you need the following code
using (Impersonation imp = new Impersonation(impersonationUsername, impersonationDomain, impersonationPWD))
{
if (!string.IsNullOrEmpty(printerName))
{
myreport.PrintOptions.PrinterName = printerName;
}
myreport.PrintToPrinter(copies, false, 0, 0);
}
Since your process runs under IIS localhost user Here am doing Impersonation so that i can access the SYSTEM/print. Generally crystal report prints to the default printer on the machine.
IMHO dont use crystal reports for printing they didn't implemented atleast basic W3C standards like you cant get styles, bulleted data etc. A simple details can be done but if you want bit look and feel none in world had the compatibility.
I recommend
http://stackoverflow.com/questions/10024273/crystal-report-with-html-content-formatting[
^] and
http://stackoverflow.com/questions/11208167/html-or-pdf-printing-on-server-side-c-sharp[
^]
Regards,
Pavan N