diff --git a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs index ceaf1ce82e3..b7e990dec96 100644 --- a/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs +++ b/src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs @@ -44,7 +44,15 @@ public double AutoDetectFileContent(FileName fileName, System.IO.Stream fileCont public IViewContent CreateContentForFile(OpenedFile file) { - if (file.IsDirty) { + bool hasContent = false; + using (var sr = new StreamReader(file.OpenRead())) + { + string line; + while (!hasContent && (line = sr.ReadLine()) != null) + if (line.Length != 0) + hasContent = true; + } + if (!hasContent) { var reportModel = ReportModelFactory.Create(); @@ -55,6 +63,7 @@ public IViewContent CreateContentForFile(OpenedFile file) doc.LoadXml(xml.ToString()); var ar = XmlToArray(doc); file.SetData(ar); + file.MakeDirty(); } var viewCmd = new CreateDesignerCommand(file);