dv2020
Active member
- Joined
- Dec 18, 2020
- Messages
- 30
- Programming Experience
- 1-3
Hi All,
I'm trying to have all three of my crystal reports refresh at the same time. I am using the code below but receiving an error.
"Controls created on one thread cannot be parented to a control on a different thread."
I'm not to sure why, as i though running with Parallel would generate separate controls.
Any ideas?
Thanks
David
I'm trying to have all three of my crystal reports refresh at the same time. I am using the code below but receiving an error.
C#:
//Allowing three task to execute at a time
ParallelOptions parallelOptions = new ParallelOptions
{
MaxDegreeOfParallelism = 3
};
Parallel.Invoke(
parallelOptions,
() => this.crystalReportViewerProfileSum.RefreshReport(),
() => this.crystalReportViewer1.RefreshReport(),
() => this.crystalReportViewerBRL.RefreshReport()
);
"Controls created on one thread cannot be parented to a control on a different thread."
I'm not to sure why, as i though running with Parallel would generate separate controls.
Any ideas?
Thanks
David