XML & StiXmlDatabase load from memory
Posted: Fri May 27, 2016 5:31 pm
Hi, i need load xml data from memory to report, the report use 3 schemas, no database connection only XML data, and 1 xml, i try some options how i can use StiXmlDatabase to load data from memory, i use next code to work , but this save xml string to disk, and need load directly from memory:
the last code let me load xml from disk and runtime, but i need save before my xml data from memory to disk to work, how i can load directly xml string to report without save to disk.
thanks in advance.
Alvin
Code: Select all
string xml = "<?xml version="1.0" encoding="utf-8" standalone="yes"?......." // bla bla bla
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
doc.Save(@"K:\temp.xml");
tempReport.Dictionary.Databases.RemoveAt(0);
Stimulsoft.Report.Dictionary.StiXmlDatabase myxml = new Stimulsoft.Report.Dictionary.StiXmlDatabase();
myxml.Alias = "XML";
myxml.Name= "XML";
myxml.XmlType = StiXmlType.Xml;
myxml.PathData = @"K:\temp.xml";
tempReport.Dictionary.Databases.Insert(0, myxml);
tempReport.Dictionary.Synchronize();
tempReport.Compile();
thanks in advance.
Alvin