CrystalReports add data from dataview

75 Views Asked by At

Hello i am trying to make a report with crystal reports and i want to add a list of my object, i made an object with inherited DataRow, then i do a list of DataRows but i cannot convert it, how i can handle it?

 pdta.Columns.Remove("client_id");
 pdta.Columns.Remove("id1");
 pdta.Columns.Remove("units");
 pdta.Columns.Remove("provider");
 pdta.Columns.Remove("sub_categorie");
 pdta.Columns.Remove("id_invoice");
 pdta.Columns.Remove("id_product");
 pdta.Columns.Remove("invoice_date");       
 pdta.Columns.Remove("collection_method");
 pdta.DefaultView.AllowNew = false;
 pdta.DefaultView.AllowEdit = false;
 pdta.DefaultView.AllowDelete = false;
 InvoiceProductsDataGrid.ItemsSource = pdta.DefaultView;
 try
    {
       DataView dt = pdta.DefaultView;
       DataTable dta = pdta.DefaultView.ToTable();
       List<InvoiceProducts> llista = dta.AsEnumerable().ToList();
    }
    catch(Exception ex)
    {
            await DialogService.ShowMessage("Error",ex.Message);
    }
0

There are 0 best solutions below