Page 1 of 2
Problems with ICollection<MyType> in Report Designer
Posted: Thu Feb 21, 2013 1:40 pm
by chriga
Hi,
I'm using Business Objects as Data in my report. When I'm adding an ICollection with user defined type (ICollection<MyType>) as column in the Report Designer, I get the following error in Report Checker:
The error of compilation
The error of compilation is found in the 'Report' report:
Invalid token '`' in class, struct, or interface member declaration
How can I solve this problem?
Best regards,
Chris
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 7:16 am
by HighAley
Hello.
Which version do you use? Please, read next article on our Knowledge Base
http://stimulsoft.helpserve.com/index.p ... =383&nav=0.
Thank you.
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 8:08 am
by chriga
Hi,
thank you for your reply.
I'm using v2012.3. Unfortunately synchronizing doesn't help. The type that is shown in the designer for that column is (maybe this is important?)
Code: Select all
System.Collections.ICollection'1[MyNamespace.MyType]
For the sake of completeness, I should mention that this is not the only error message. There are 14 error messages after adding that one column. The first message is
The error of compilation
The error of compilation is found in the 'Report' report:
Identifier expected
The second is (appears three times)
The error of compilation
The error of compilation is found in the 'Report' report:
Invalid token '(' in class, struct, or interface member declaration
The previously mentioned error appears three times
The error of compilation
The error of compilation is found in the 'Report' report:
Invalid token '`' in class, struct, or interface member declaration
The following error appears once
The error of compilation
The error of compilation is found in the 'Report' report:
Invalid token '"MyTypes"' in class, struct, or interface member declaration
The following appears twice
The error of compilation
The error of compilation is found in the 'Report' report:
Type or namespace definition, or end-of-file expected
And the last error type appears four times
The error of compilation
The error of compilation is found in the 'Report' report:
Unexpected character '`'
Do you know any other solution for that problem?
Best regards
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 8:26 am
by Alex K.
Hello,
Can you please send us a sample project which reproduces the issue for analysis.
Thank you.
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 9:07 am
by chriga
Hi,
here is sample project. I hope this helps.
Best regards,
Chris
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 10:21 am
by Alex K.
Hello,
Please try to use the RegBusinessObject() method for registration your data.
Thank you.
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 11:10 am
by chriga
Hi,
when I try to register my data with
Code: Select all
report.RegBusinessObject("Ent1", new Ent1{MyTypes = myTypes, Desc = new Desc(){Info = "i1"}});
The business Object "Ent1" will created in the report beside the existing DataSource "Ent1". But the columns MyTypes and Desc are missing (see attached screenshot). The error messages still exist.

- Screenshot.png (9.66 KiB) Viewed 5034 times
Best regards
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 11:18 am
by Alex K.
Hello,
Please try to use the following code:
Code: Select all
report.RegBusinessObject();
report.Dictionary.SynchronizeBusinessObjects(2);
Thank you.
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 11:32 am
by chriga
Hi,
there is no RegBusinessObject() method that takes no arguments. Using report.Dictionary.SynchronizeBusinessObjects(2) after the call of RegBusinessObject that I have used, doesn't make a difference.
Best regards
Re: Problems with ICollection<MyType> in Report Designer
Posted: Fri Feb 22, 2013 11:41 am
by chriga
Hi,
when I call
Code: Select all
report.RegBusinessObject("Ent1", new Ent1{MyTypes = myTypes, Desc = new Desc(){Info = "i1"}});
report.Dictionary.SynchronizeBusinessObjects(2);
after loading (report.Load(...)) my report the columns Desc and MyTypes are now in the Business Object. But the error messages are still existing.
Best regards