Hi,
I have report xml data previously produced with Telerik Windows Designer in my database. That is the xml version of the report.For example:
<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Report Width=\"6.5in\" Name=\"test\" xmlns=\"http:// schemas.telerik.com/reporting/2021/1.0\">\r\n <Items>\r\n <PageHeaderSection Height=\"1in\" Name=\"pageHeaderSection1\">\r\n <Items>\ r\n <TextBox Width=\"1.2in\" Height=\"0.2in\" Left=\"2.7in\" Top=\"0.4in\" Value=\"test\" Name=\"textBox1\ " />\r\n </Items>\r\n </PageHeaderSection>\r\n <DetailSection Height=\"2in\" Name=\"detailSection1\" />\r\n <PageFooterSection Height=\ "1in\" Name=\"pageFooterSection1\" />\r\n </Items>\r\n <PageSettings PaperKind=\"Letter\" Landscape=\"False\" ColumnCount=\"1\" ColumnSpacing= \"0in\">\r\n <Margins>\r\n <MarginsU Left=\"1in\" Right=\"1in\" Top=\"1in\" Bottom=\"1in\" />\ r\n </Margins>\r\n </PageSettings>\r\n <StyleSheet>\r\n <StyleRule>\r\n <Style>\r\n <Padding Left=\"2pt\" Right =\"2pt\" />\r\n </Style>\r\n <Selectors>\r\n <TypeSelector Type=\"TextItemBase\" />\r\n <TypeSelector Type=\"HtmlTextBox\ " />\r\n </Selectors>\r\n </StyleRule>\r\n </StyleSheet>\r\n</Report>
I want to be able to design and send such xml content to web report designer.
Converting to json format, deserizale etc. I tried many methods but without success.
Error:
Uncaught (in promise) SyntaxError: Unexpected token '<', "<?xml vers"... is not valid JSON
Some methods I've tried:
var xml = (XmlReportSource)sourceReportSource;
var reportInstance = this.DeserializeReport(xml);
var ss = this.DeserializeReport(xml);
XmlDocument doc = new XmlDocument();
doc.LoadXml(result);
var json = Newtonsoft.Json.JsonConvert.SerializeXmlNode(doc, Newtonsoft.Json.Formatting.None, true);
I would be very happy if you could help with this.
enjoy your work.