Newbie Show report error
Hello
Forgive me as i am very new to these reports.
I have attached the error i get when i try render my report this is my code.
The error i get is
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
Any suggestions
Forgive me as i am very new to these reports.
I have attached the error i get when i try render my report this is my code.
List<test> t = new List<test>();
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
t.Add(new test());
WebReport1.Report.RegisterData(t, "Statment");
WebReport1.Report.Show();
public class test
{
public test()
{
DocNo = "test";
Type = "test";
Date = "test";
Description = "test";
Amount = "test";
Balance = "test";
Age = "test";
}
public string DocNo { get; set; }
public string Type { get; set; }
public string Date { get; set; }
public string Description { get; set; }
public string Amount { get; set; }
public string Balance { get; set; }
public string Age { get; set; }
}
The error i get is
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it.
Any suggestions
Comments
remove this line of code:
WebReport1.Report.Show();
it's for Windows.Forms only.