Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
var query = (from i in inven.InvoiceDetailwpfs

select i).ToList();
InvoicePrint rept = new InvoicePrint();
rept.Load(@"InvoicePrint.rpt");
rept.SetDataSource(query);
PrintInvoice pir = new PrintInvoice();
pir.crystal_invoice.ViewerCore.ReportSource = (rept);
Posted
Updated 22-Aug-15 4:36am
v2

1 solution

You are using LINQ to fetch records and bind list to report. It seems some column value is NULL in linq query which doesn't support dataset in report.

In order to resolve your problem please use anonymous type and check null value of columns.

C#
var query = (from i in inven.InvoiceDetailwpfs
select new 
{ 
	columnName1 = i.columnName1 ?? 0.0
	columnName2 = i.columnName2 ?? "No Value"
}).ToList();


Here it is checking null value and assigning some blank value to it.

You need to change ColumnName1, ColumnName2 as per your dataset column name and assign blank as per column datatype.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900