public static void Print(ReportViewer pRptViewer, string p_id) { Print_invoiceItemsList data = GetData(p_id); LocalReport localReport = pRptViewer.LocalReport; D_CreditnoteItem.Build(); //= Set Report Path localReport.ReportPath = Application.StartupPath + @"\PRINTS\P_CreditnoteItem.rdlc"; //(1)// localReport.DisplayName = "invoice items"; //= Set Report Data Source localReport.DataSources.Add(new ReportDataSource("MyDataSource_Items", data)); //(2)// //= Refresh the report PrinterSettings v_PrinterSettings = GetPrinterSettings(); pRptViewer.PrinterSettings = v_PrinterSettings; pRptViewer.SetPageSettings(v_PrinterSettings.DefaultPageSettings); pRptViewer.RefreshReport(); }
private void Print_copies() { /// List <PrintCopies> printdata = new List <PrintCopies>(); /// if (check_original.Checked) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[0].Copies = _printdata.FirstCopy; } /// if ((check_duplicate.Checked) && (check_original.Checked)) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[1].Copies = _printdata.SecondCopy; } else if ((check_duplicate.Checked) && (!check_original.Checked)) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[0].Copies = _printdata.SecondCopy; } /// if ((check_triplicate.Checked) && (check_duplicate.Checked) && (check_original.Checked)) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[2].Copies = _printdata.ThirdCopy; } else if ((check_triplicate.Checked) && (!check_duplicate.Checked) && (check_original.Checked)) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[1].Copies = _printdata.ThirdCopy; } else if ((check_triplicate.Checked) && (!check_duplicate.Checked) && (!check_original.Checked)) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[0].Copies = _printdata.ThirdCopy; } else if ((check_triplicate.Checked) && (check_duplicate.Checked) && (!check_original.Checked)) { PrintCopies _printdata = new PrintCopies(); printdata.Add(_printdata); printdata[1].Copies = _printdata.ThirdCopy; } Current.Comp_code = CCompany_exten.GetCode_id(Current.Company_id); new SetCustomised(); Customised.TaxType = txt_taxtype_id.Text; D_Creditnote.Build(); D_CreditnoteItem.Build(); FReportPreview frpt = new FReportPreview(); frpt.reportViewer1.ShowPrintButton = true; P_Creditnote.Print(frpt.reportViewer1, (vId), printdata); //P_CreditnoteItem.Print(frpt.reportViewer1, (vId)); frpt.Show(); print_panel.Hide(); this.Hide(); }