private void richEditControl1_CalculateDocumentVariable(object sender, DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs e)
 {
     if (e.VariableName == "dvField")
     {
         e.Value   = "Test";
         e.Handled = true;
     }
 }
Example #2
0
 private void richEditControl1_CalculateDocumentVariable(object sender, DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs e)
 {
     if (e.VariableName == "CHART")
     {
         ChartImage chart = new ChartImage(e.Arguments[0].Value.ToString());
         chart.Initialize();
         DocumentImageSource    image = chart.CreateImage();
         RichEditDocumentServer srv   = new RichEditDocumentServer();
         srv.Document.Images.Append(image);
         e.Value   = srv.Document;
         e.Handled = true;
     }
 }
Example #3
0
        void Document_CalculateDocumentVariable(object sender, DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs e)
        {
            int detailId = -1;

            if (Int32.TryParse(e.Arguments[0].Value, out detailId))
            {
                RichEditDocumentServer server = new RichEditDocumentServer();

                string path = string.Format("{0}\\Detail{1}.rtf", System.IO.Directory.GetCurrentDirectory(), detailId.ToString());

                server.LoadDocument(path);

                e.Value   = server;
                e.Handled = true;
            }
        }
Example #4
0
        void Document_CalculateDocumentVariable(object sender, DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs e)
        {
            if (filesCollection.ContainsKey(e.VariableName))
            {
                IRichEditDocumentServer server = richEditControl1.CreateDocumentServer();
                FileFieldInfo           info   = filesCollection[e.VariableName];
                server.Document.Images.Insert(server.Document.Range.End, new Bitmap(Icon.ExtractAssociatedIcon(info.FullFileName).ToBitmap(), new Size(16, 16)));
                DocumentRange range     = server.Document.AppendText(info.FileName + "; ");
                Hyperlink     hyperlink = server.Document.Hyperlinks.Create(range.Start, range.Length - 1);
                hyperlink.Target      = info.FullFileName;
                hyperlink.ToolTip     = info.FileName;
                hyperlink.NavigateUri = info.FullFileName;

                e.Value   = server.Document;
                e.Handled = true;
            }
        }
 private void richEditControl1_CalculateDocumentVariable(object sender, DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs e)
 {
     e.Value   = e.VariableName + "'s value";
     e.Handled = true;
 }