------------------------------------------------- ThreadStateException O thread atual deve ser definido no modo STA (single thread apartment) antes que chamadas OLE possam ser feitas. Verifique se a função Main tem STAThreadAttribute marcado. A exceção somente será gerada se um depurador estiver anexado ao processo.
Source : System.Windows.Forms -------------------------------------------------
It sees the code below to solve the problem:
#region CodeArea(StrataFrame with Report Sharp-Shooter) in new Thread(STA)
private void inlineReportSlot2_RenderCompleted(object sender, EventArgs e) { Thread newThread = new Thread(new ThreadStart(Exibe)); newThread.SetApartmentState(ApartmentState.STA); newThread.Start(); }
void Exibe() { Thread.Sleep(0); using (PerpetuumSoft.Reporting.View.PreviewForm previewForm = new PerpetuumSoft.Reporting.View.PreviewForm(inlineReportSlot2)) { previewForm.WindowState = FormWindowState.Maximized; previewForm.ShowDialog(); } }
#endregion
Rogério Mauri