private void SaveAction(object obj) { try { if (this.context.Save(Selected)) { if (Message.QuestionYesNo("Data Berhasil Disimpan, Print Faktur ?")) { Selected.NamaCustomer = Selected.Customer.NamaCustomer; Selected.KodeCustomer = Selected.Customer.KodeCustomer; var layout = "MainApp.Reports.Layouts.FakturPernjualan.rdlc"; if (Selected.Pembayaran == StatusPembayaran.Kredit) { layout = "MainApp.Reports.Layouts.FakturPernjualanKredit.rdlc"; } HelperPrint.PrintWithFormActionTwoSource("Print Preview", new ReportDataSource { Name = "Header", Value = new List <Penjualan> { Selected } }, new ReportDataSource { Name = "DataSet1", Value = Selected.Details.ToList() }, layout, null); } BarangSourceView.Refresh(); CancelCommand.Execute(null); } } catch (Exception ex) { Message.Error(ex.Message); } }
private void PrintAction(object obj) { var header = new ReportHeader { Title = Title, Tahun = DateTime.Now.Year }; HelperPrint.PrintWithFormActionTwoSource("Print Preview", new ReportDataSource { Name = "Header", Value = new List <ReportHeader>() { header } }, new ReportDataSource { Name = "DataSet1", Value = datgrafirk }, "Main.Reports.Layout.GrafikMultiSeries.rdlc", null); }