StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



StrataFrame with Report Sharp-ShooterExpand / Collapse
Author
Message
Posted 05/24/2008 11:17:27 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 06/12/2010 2:27:20 PM
Posts: 149, Visits: 513
If you received the error below when choosing an option of the menu of previewForm

-------------------------------------------------
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


http://blog.licitec.com.br
Post #16568
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Trent L. Taylor, Dustin Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 11:23am

Powered by InstantForum.NET v4.1.4 © 2010
Execution: 0.063. 7 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.