xtrareports-devexpress-dot-xtrareports-dot-ui-dot-htmleventargs.md
Gets the content of the currently processed item.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
public DXHtmlContainerControl ContentCell { get; }
Public ReadOnly Property ContentCell As DXHtmlContainerControl
| Type | Description |
|---|---|
| DevExpress.XtraPrinting.HtmlExport.Controls.DXHtmlContainerControl |
An object used for a Web representation of the currently processed item.
|
The following example demonstrates how to use the XRControl.HtmlItemCreated event to customize the content of an XRLabel control, when a report is exported to HTML. In the event handler, create two custom HTML elements, which will display a check box and a hyperlink on a Web page, and add them to the control’s content using the HtmlEventArgs.ContentCell property of the event parameter.
Follow the steps below to create a sample project.
Then, to export a report to HTML, you can use code similar to the following.
using System;
using System.Windows.Forms;
using System.Diagnostics;
// ...
private void ExportToHTML() {
XtraReport1 report = new XtraReport1();
report.ExportToHtml("Test.html");
StartProcess("Test.html");
}
public void StartProcess(string path) {
Process process = new Process();
try {
process.StartInfo.FileName = path;
process.Start();
process.WaitForInputIdle();
}
catch { }
}
Imports System
Imports System.Windows.Forms
Imports System.Diagnostics
' ...
Private Sub ExportToHTML()
Dim report As New XtraReport1()
report.ExportToHtml("Test.html")
StartProcess("Test.html")
End Sub
Public Sub StartProcess(ByVal path As String)
Dim process As New Process()
Try
process.StartInfo.FileName = path
process.Start()
process.WaitForInputIdle()
Catch
End Try
End Sub
See Also