FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

XML header in Web Report

Open RedKot73 opened this issue 5 years ago • 1 comments

Hi I found that report templates are sometimes saved with a title like: or

Unknown reason, this text results in an error because the template is trying to load the text as Base64 encoded.

I changed the code and now it works like this: /// \FastReport-master\FastReport.Base\Report.cs const string cnstXMLHeader = "<?xml version=\"1.0\" encoding=\"utf-8\""; //int startIndex = s.IndexOf("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); int startIndex = s.IndexOf(cnstXMLHeader, 0, StringComparison.OrdinalIgnoreCase); if (startIndex != -1) { UTF8Encoding encoding = new UTF8Encoding(); using (MemoryStream stream = new MemoryStream(encoding.GetBytes(s.Substring(startIndex)))) ///

RedKot73 avatar Feb 27 '21 06:02 RedKot73

Hi @RedKot73 . Hmm, can you create pull request with this fix? I don't quite understand what was changed

KirillKornienko avatar Mar 10 '21 13:03 KirillKornienko