locked
printing from crystal reports RRS feed

  • Question

  • User915784594 posted

    i have asp.net app that loads the crystal reports but i cant get it to print to local printers. only options is to PDF. how can i get this to print to client side printing.

    using vs studio community 2015 and cr for vs 13_0_19. 

    Monday, March 20, 2017 4:06 PM

All replies

  • User-884998766 posted

    It might be your printer, maybe a controller or connection problems with the wire, check it.

    Sunday, April 2, 2017 8:44 PM
  • User705563967 posted

    Check this code to generate pdf from crystal report 

     
            protected void ShowPdf(ReportDocument rptDocument)
            {
                try
                {
    
                    DiskFileDestinationOptions DiskOpts = new DiskFileDestinationOptions(); // Document Cache Constructed in memory
                    string path = Server.MapPath("~/ReportCaching") + @"\";           // Make Document Create Pathe=
                    string Filename = System.Guid.NewGuid().ToString() + Convert.ToString(DateTime.Now.Second) + Convert.ToString(DateTime.Now.Millisecond); // Docment Name and Extension
                    rptDocument.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; // Saving Option
                                                                                                   
                   {
                        Filename = Filename + ".pdf";
                        rptDocument.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
                    }
                
                    DiskOpts.DiskFileName = path + Filename; // Combination of Path and FileName
                    rptDocument.ExportOptions.DestinationOptions = DiskOpts;
    
                    rptDocument.Export();
    
                    {
    
                        ScriptManager.RegisterStartupScript(Page, typeof(Page), "myscript", "window.open('" + ResolveUrl("~/ReportCaching/") + Filename + "',target='new');", true);
                    }
    
    
                }
                catch (Exception ex)
                {
    
                   
                }
            }

    Tuesday, April 18, 2017 10:31 AM