Esempio n. 1
0
        public void RunReportTest()
        {
            Current.Company_id = "1";
            Current.Acy_id     = "4";
            Current.Comp_code  = CCompany_exten.GetCode_id(Current.Company_id);

            new SetCustomised();
            Customised.TaxType = Core.SGST;


            List <PrintCopies> printdata = new List <PrintCopies>();

            PrintCopies _printdata = new PrintCopies();

            printdata.Add(_printdata);
            printdata[0].Copies = _printdata.FirstCopy;

            D_Creditnote.Build();
            D_CreditnoteItem.Build();

            FReportPreview frpt = new FReportPreview();

            frpt.reportViewer1.ShowPrintButton = true;
            P_Creditnote.Print(frpt.reportViewer1, ("7"), printdata);
            //P_CreditnoteItem.Print(frpt.reportViewer1, ("6"));
            frpt.Show();
            frpt.BringToFront();
        }
Esempio n. 2
0
        public static void Print(ReportViewer pRptViewer, string pP_id, List <PrintCopies> printdata)
        {
            vPId = pP_id;
            Print_CreditnoteList data = PrintCreditnoteExchange.GetData(pP_id, printdata);

            LocalReport localReport = pRptViewer.LocalReport;

            D_Creditnote.Build();

            localReport.ReportPath  = Application.StartupPath + @"\PRINTS\P_Creditnote.rdlc"; //(1)//
            localReport.DisplayName = "invoice";


            localReport.DataSources.Add(new ReportDataSource("MyDataSource", data)); //(2)//

            localReport.SubreportProcessing += localReport_SubreportProcessing;

            PrinterSettings v_PrinterSettings = GetPrinterSettings();

            pRptViewer.PrinterSettings = v_PrinterSettings;
            pRptViewer.SetPageSettings(v_PrinterSettings.DefaultPageSettings);
            pRptViewer.RefreshReport();
        }
Esempio n. 3
0
        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();
        }