Problems with ICollection<MyType> in Report Designer

Stimulsoft Reports.WPF discussion
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Problems with ICollection<MyType> in Report Designer

Post 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
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problems with ICollection<MyType> in Report Designer

Post 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.
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Problems with ICollection<MyType> in Report Designer

Post 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
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problems with ICollection<MyType> in Report Designer

Post by Alex K. »

Hello,

Can you please send us a sample project which reproduces the issue for analysis.

Thank you.
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Problems with ICollection<MyType> in Report Designer

Post by chriga »

Hi,

here is sample project. I hope this helps.

Best regards,
Chris
Attachments
ClassLibrary1.zip
(73.64 KiB) Downloaded 310 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problems with ICollection<MyType> in Report Designer

Post by Alex K. »

Hello,

Please try to use the RegBusinessObject() method for registration your data.

Thank you.
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Problems with ICollection<MyType> in Report Designer

Post 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
Screenshot.png (9.66 KiB) Viewed 5039 times
Best regards
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Problems with ICollection<MyType> in Report Designer

Post by Alex K. »

Hello,

Please try to use the following code:

Code: Select all

report.RegBusinessObject();
report.Dictionary.SynchronizeBusinessObjects(2);
Thank you.
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Problems with ICollection<MyType> in Report Designer

Post 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
chriga
Posts: 14
Joined: Thu Feb 21, 2013 1:15 pm

Re: Problems with ICollection<MyType> in Report Designer

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