예제 #1
0
        public void getData()
        {
            Class.main_function cM  = new Class.main_function();
            DataTable           Dot = new DataTable();
            SqlParameter        par = new SqlParameter();

            par.Value         = invID;
            par.ParameterName = "@invID";
            Dot = cM.getAllData("Print_Inv", par, null, null, null);

            //string exeFolder = Path.GetDirectoryName(Application.ExecutablePath);
            // reportViewer1.LocalReport.ReportPath = @"Restauant.report.sale_invoice.rdlc";
            //reportViewer1.LocalReport.ReportEmbeddedResource = "Restauant.report.sale_invoice.rdlc";
            //LocalReport report = new LocalReport();
            //report.ReportEmbeddedResource = "Restauant.report.sale_invoice.rdlc";
            //reportViewer1.LocalReport.DataSources.Clear();
            //reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("invoice", Dot));


            reportViewer1.Reset();
            reportViewer1.LocalReport.ReportEmbeddedResource = @"Restauant.report.sale_invoice.rdlc";
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("invoice", Dot));
            reportViewer1.RefreshReport();
            reportViewer1.RenderingComplete += new RenderingCompleteEventHandler(PrintSales);
        }