1

I have to extend report's query to add a new field. I've created extension of a query, joined required datasources and can see new field in the list of fields. For some reason the report in the AOT is displaying with red cross sign:

enter image description here

In properties i can see error in metadata: "There was an error reading metadata. Make sure the metadata xml file(s) are accessible, are well formed and are not corrupted with duplicate or missing xml elements. The exception message is: Element named: 'Copy1' of type 'ModelElement' already exists among elements: 'Copy1'. Parameter name: item Additional information: AOT/Reports/Reports/WHSInvent"

There is an .xml of that object in packages local directory, there are no any duplicate names in any node of that report.

Any ideas how it can be fixed?

rjv
  • 1,058
  • 11
  • 29
1gentlemann
  • 164
  • 1
  • 3
  • 14

1 Answers1

2

I've run into this before and there are a two things that come to mind.

  1. Often times it's due to an incorrect merge where changes are merged and metadata is accidentally duplicated (in your case it's possible there are two xml nodes with the same name/id in the .rdl file) If this report is checked in with corrupt metadata, you need to manually modify the RDL file, which is not great, but hopefully the error contains enough hints. Open the report rdl file in your favourite editor (report likely located in a similar path as this: K:\AosService\PackagesLocalDirectory\YOURMODEL\Reports) and look for an xml node with an attribute Name="Copy1". With luck, you have two duplicate nodes next to each other due to the merge. Remove the offending duplicate node, save, and refresh the AOT in Visual Studio.

  2. If the error is in your local changes only (xml file is corrupted for whatever reason) and you are sure that your source control contains the correct version and you simply wish to overwrite the local contents with the source controlled version, follow these steps. Note: this will overwrite local changes.

First, undo pending changes.

UndoPendingChanges

Then force a get latest:

GetSpecificVersion1 GetSpecificVersion2

rjv
  • 1,058
  • 11
  • 29
  • Thanks a lot, but i've already solved the problem removing from the report duplicated designs: somehow they were just copied one by one that's why it had that red icon. Nevertheless your response would be useful due to the fact that i did the same steps but via designer, not editting .xml file. – 1gentlemann Feb 04 '19 at 07:29