I am working on a POS system in c#. I need to print a bill in the end of the invoicing. I am using these coding to print directly on button click event with the following codes.
//Print codes to a default printer with my crystal report
RPT_RetailInvoice objRpt = new RPT_RetailInvoice();
objRpt.SetDataSource(ds.Tables[1]);
objRpt.PrintToPrinter(1, false, 0, 0);
I gave a custom page size 3*5 inches paper in crystal report, the print is perfect with 2 or 3 items in this invoice, but when I exceed the paper length, it is printing my report header and footer in the middle of the page and printing the bill, I want this to print with dynamic page length size. I've googled for 3 days but could not find a proper solution to fix my requirements, please help me guys.