public void Imprimir(Ticket ticket) { var report = new LocalReport { ReportPath = @"..\..\Ticket.rdlc" }; report.DataSources.Add(new ReportDataSource("Ticket", new List<Ticket> { ticket })); Export(report); Print(); }
public void Printing(Ticket ticket) { try { _ticketToPrint = ticket; var pd = new PrintDocument(); var paper = new PaperSize("Custom", 300, 394); pd.DefaultPageSettings.PaperSize = paper; pd.DefaultPageSettings.Margins = new Margins(10, 10, 10, 10); pd.PrintPage += pd_PrintPage; // Print the document. pd.Print(); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void Imprimir(Ticket ticket) { Printing(ticket); }