Page 1 of 1

InvalidCastException in Samples PrintGrid

Posted: Fri Sep 07, 2018 12:48 pm
by wrobbeling
Hello,

I need some help with this samples.

I always become an InvalidCastException.

Code: Select all

 private void PrintDataGrid(DataGrid sender)
        {
            DataView dataView = (DataView)sender.DataSource; // that causes the InvalidCastException

            StiReport report = new StiReport();
            report.ScriptLanguage = StiReportLanguageType.CSharp;
What can I do to fix it?

See the screenshot please.

Re: InvalidCastException in Samples PrintGrid

Posted: Tue Sep 11, 2018 9:52 am
by Lech Kulikowski
Hello,

It is type conversion exception, you can not convert DataTable to DataView.
https://stackoverflow.com/questions/306 ... a-dataview

Thank you.