In our base we save FlowDocument as Text. And i have to display it on Report.
I found this Topic http://forum.stimulsoft.com/viewtopic.p ... ent#p12393.
So i've code this on GetValueEvent :
Code: Select all
byte[] byteArray = System.Text.Encoding.Default.GetBytes(ListeDesMouvementsCaisse.Commentaire);
System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
string str = Stimulsoft.Report.Wpf.StiRtfHelper.ConvertFlowDocumentToRtf(stream);
e.Value = System.Xml.XmlConvert.EncodeName(StiRichText.PackRtf(str));
My FlowDocument is valid because i can display it in my application on a WPF RichTextBox with a string to FlowDocument convert :Expression in Text property of 'RichText1' can't be evaluated! Root element is missing.
Code: Select all
var flowDocument = new FlowDocument();
var valeur = myStringOfFlowDocument;
if (!string.IsNullOrEmpty(valeur))
{
var stringReader = new StringReader(valeur);
var xmlTextReader = new XmlTextReader(stringReader);
flowDocument = (FlowDocument)XamlReader.Load(xmlTextReader);
}
Regards,
Morgan SOULLEZ