My reports that I am using in an WPF application just to print directly to a printer have some issues after the upgrade. We also had an issues when we upgraded last year.
Here is where the report is called
string orderIds = "153461,153567,153843,153845,153872,153942,153966,153985,154210,154252,154298,154363,154382,154411,154431,154437,154463,154471,154521,154538,154556,154560,154631,154650,154686,154687";
var reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
var typeReportSource = new Telerik.Reporting.TypeReportSource();
typeReportSource.TypeName = typeof(Accounting.Reports.RptPostedDeposits).AssemblyQualifiedName;
typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumbers", orderIds));
var px = new System.Drawing.Printing.PrinterSettings();
reportProcessor.PrintReport(typeReportSource, px);
Then in my Needs_Datasource event of the report I have something like
if (this.ReportParameters[0].Value.ToString() != "")
{
string sqlQuery = "Select O.OrderID, Case When D.PayorName = '' Then CAL.SubAccountName Else " +
"SUBSTRING(CAL.SubAccountName, 0, 7) + '-' + D.PayorName End as Customer, D.EntryDate, D.PaymentNumber, D.PaymentTypeID, " +
"D.TotalDeposit, D.AmountAppliedToInvoice, O.GrandTotal, D.PostedToCyma, ISNULL(O.PostedDate, ISNULL(O.ShipDate, GETDATE())) as PostedDate " +
"From FCMDB.dbo.FcoOrders O " +
"JOIN FCMDB.dbo.CustAccountLocations CAL ON CAL.AccountLocationsID = o.AccountLocationID " +
"JOIN FCMDB.dbo.AcctDeposits D ON D.OrderID = O.OrderID " +
"Where O.OrderID IN (" + ReportParameters[0].Value + ")";
SqlConnection cn = new SqlConnection(MyConnection);
cn.Open();
SqlCommand cmdGet = new SqlCommand(sqlQuery, cn);
DataTable dtGet = new DataTable();
dtGet.Load(cmdGet.ExecuteReader());
cmdGet.Dispose();
cn.Dispose();
//This line we changed in 2016 because just setting the this.datasource would no longer reference the current report
(sender as Telerik.Reporting.Processing.Report).DataSource = dtGet;
//this.DataSource = dtGet;
}
Now I need to access the parameter through the sender object. If I leave it the way it is currently the parameter is blank. Is this something that has been done intentionally? If so why isn't an email or something sent out about it or adding it into the whats new?