示例#1
0
        private void btn_print_Click(object sender, RoutedEventArgs e)
        {
            object item = datagrid_invoiceshow.SelectedItem;

            if (item == null)
            {
                MessageBox.Show("لطفا فاکتوری را از لیست انتخاب کنید");
                return;
            }

            Win_ShowReport wn           = new Win_ShowReport();
            int            getinvoiceid = Convert.ToInt32((datagrid_invoiceshow.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text);

            // id
            wn.Params[0] = Convert.ToString((datagrid_invoiceshow.SelectedCells[0].Column.GetCellContent(item) as TextBlock).Text);
            // name
            wn.Params[1] = Convert.ToString((datagrid_invoiceshow.SelectedCells[1].Column.GetCellContent(item) as TextBlock).Text);
            //telephone
            wn.Params[2] = Convert.ToString((datagrid_invoiceshow.SelectedCells[2].Column.GetCellContent(item) as TextBlock).Text);
            //addres
            wn.Params[3] = Convert.ToString((datagrid_invoiceshow.SelectedCells[3].Column.GetCellContent(item) as TextBlock).Text);
            //type
            wn.Params[4] = Convert.ToString((datagrid_invoiceshow.SelectedCells[4].Column.GetCellContent(item) as TextBlock).Text);
            //date
            wn.Params[5] = Convert.ToString((datagrid_invoiceshow.SelectedCells[5].Column.GetCellContent(item) as TextBlock).Text);
            //price
            wn.Params[6]    = Convert.ToString((datagrid_invoiceshow.SelectedCells[6].Column.GetCellContent(item) as TextBlock).Text);
            wn.ShowFormoula = "{ VW_InvoiceItem.InvoiceID} =" + getinvoiceid;
            wn.ReportName   = "Factor.rpt";
            wn.ShowDialog();
        }
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (listView_Report.SelectedIndex == -1)
            {
                MessageBox.Show("لطفا موردی را از لیست انتخاب کنید");
                return;
            }

            wn              = new Win_ShowReport();
            wn.ReportName   = ReportName;
            wn.ShowFormoula = ReportFormula();
            wn.ShowDialog();
        }