Page 1 of 1

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Thu Nov 24, 2011 11:46 pm
by mathat1970
I created a MRT (see below in Code Section) using a dictionary generated from XML (see below in Code Section). I noticed it had two Relations named ParentEntity so I modified the following:

Changed in the designer:

public Stimulsoft.Report.Dictionary.StiDataRelation ParentEntity;
to
public Stimulsoft.Report.Dictionary.StiDataRelation ParentEntity1;

and

public Stimulsoft.Report.Dictionary.StiDataRelation ParentEntity;
to
public Stimulsoft.Report.Dictionary.StiDataRelation ParentEntity2;

In the report design I now do not have a conflict of names but …. when I attempt run the report during runtime though our application and I get the following error message:

The type 'Reports.Report' already contains a definition for 'ParentEntity'.

I thought this issue was fixed …. See related issue:

Stimulsoft Forum » Stimulsoft Reports product line » Stimulsoft Reports.Net » Issue with word "Parent" ... compile error (already contains a definition)

Can you please verify if this is still a bug or what can I do to fix it without changing the XML sent at runtime?

XML is attached
MRT is Attached

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Mon Nov 28, 2011 4:04 am
by Alex K.
Hello,

We couldn't reproduce this bug. Could you send us a step-by-step guide how to reproduce the issue?

Thank you.

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Mon Nov 28, 2011 6:05 pm
by mathat1970
Hello Aleksey,

It would take time to extract how we compile and run it but in general

We compile and run the report within a Windows Environment with the application being Winforms coded in C#?

How did you check the see if it worked or not ?

Below is one path we have in the code to compile and run which has the problem

Code: Select all

				.....
				using (StiReport report = new StiReport())
				{
					try
					{
						report.Load(reportFile);
						report.DataSources.Clear();
						report.Dictionary.Databases.Clear();
						report.Dictionary.ImportXMLSchema(data);
						report.RegData(data);
						Stimulsoft.Report.Export.StiPdfExportSettings settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
						settings.Compressed = true;
						settings.EmbeddedFonts = false;

                        report.Render(false); // Exception occurs when executing this line
                        .....
                        .....
					}
					catch (Exception ex)
					{
						.....
					}
				}
Note
- MRT is in the reportFile string
- data is a System.Data.DataSet built from the XML
- catch catches the error when executing : report.Render(false);

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Tue Nov 29, 2011 7:11 am
by Alex K.
Hello,

When you create relations names of the the following construction are assigned to them
"Parent" + "TableName (parent DataSource)"
in your case, a table has a prefixed "Parent" because of what it turns that there are 2 items with the same names. To solve this problem, you can rename your relation:
ParentEntity1 and ParentEntity2.

Thank you.

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Tue Nov 29, 2011 4:50 pm
by mathat1970
Thanks Aleksev,

I believe I understand what the problem is but need to know how to fix it under the following circumstances:

( 1 ) I cannot modify the XML as it is used elsewhere and the dataset is dynamically generated from the XML
( 2 ) If I just modify the MRT (renamed the relation) in the designer it works OK only in the designer but NOT when run in our windows application. I think code is regenerated within the MRT at runtime.

Questions:

( A ) Given these options is it still possible to rename the relation ..... if so how ?
( B ) Shouldn't Stimulsoft generate an appropriate name that is unique as I am only supplying the data, stimulsoft is creating the relations ? (i.e. it should not matter what names are used in the data) ?


thanks

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Wed Nov 30, 2011 8:31 am
by Alex K.
Hello,

We are working on this problem. We will let you know when the solution is available.

Thank you.

Runtime Error : The type 'Reports.Report' already contains a definition for 'ParentEntity'

Posted: Mon Dec 05, 2011 7:48 am
by Alex K.
Hello,

The issue is fixed.
Please check the prerelease build on next week.

Thank you.