日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 前端技术 > HTML >内容正文

HTML

如何将html转为report,如何使用XtraReport将报表导出为HTML

發(fā)布時(shí)間:2025/3/15 HTML 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 如何将html转为report,如何使用XtraReport将报表导出为HTML 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

下面的示例將演示如何使用XtraReport將報(bào)表導(dǎo)出為HTML,首先需要在項(xiàng)目中添加一個(gè)新的報(bào)表(XtraReport1),并將報(bào)表控件拖放在項(xiàng)目中,然后執(zhí)行下面的代碼。

C#

using System.Drawing;

using System.Diagnostics;

using DevExpress.XtraPrinting;

using DevExpress.XtraReports.UI;

// ...

private void button1_Click(object sender, EventArgs e)

{

// A path to export a report.

string reportPath = "c:\\Test.html";

// Create a report instance.

XtraReport1 report = new XtraReport1();

// Get its HTML export options.

HtmlExportOptions htmlOptions = report.ExportOptions.Html;

// Set HTML-specific export options.

htmlOptions.CharacterSet = "UTF-8";

htmlOptions.RemoveSecondarySymbols = false;

htmlOptions.Title = "Test Title";

// Set the pages to be exported, and page-by-page options.

htmlOptions.ExportMode = HtmlExportMode.SingleFilePageByPage;

htmlOptions.PageRange = "1, 3-5";

htmlOptions.PageBorderColor = Color.Blue;

htmlOptions.PageBorderWidth = 3;

// Export the report to HTML.

report.ExportToHtml(reportPath);

// Show the result.

StartProcess(reportPath);

}

// Use this method if you want to automaically open

// the created HTML file in the default program.

public void StartProcess(string path)

{

Process process = new Process();

try

{

process.StartInfo.FileName = path;

process.Start();

process.WaitForInputIdle();

}

catch { }

}

VB

Imports System.Drawing

Imports System.Diagnostics

Imports DevExpress.XtraPrinting

Imports DevExpress.XtraReports.UI

' ...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles Button1.Click

' A path to export a report.

Dim reportPath As String = "c:\\Test.html"

' Create a report instance.

Dim report As New XtraReport1()

' Get its HTML export options.

Dim htmlOptions As HtmlExportOptions = report.ExportOptions.Html

' Set HTML-specific export options.

htmlOptions.CharacterSet = "UTF-8"

htmlOptions.RemoveSecondarySymbols = False

htmlOptions.Title = "Test Title"

' Set the pages to be exported, and page-by-page options.

htmlOptions.ExportMode = HtmlExportMode.SingleFilePageByPage

htmlOptions.PageRange = "1, 3-5"

htmlOptions.PageBorderColor = Color.Blue

htmlOptions.PageBorderWidth = 3

' Export the report to HTML.

report.ExportToHtml(reportPath)

' Show the result.

StartProcess(reportPath)

End Sub

' Use this method if you want to automaically open

' the created HTML file in the default program.

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

標(biāo)簽:

本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至hey@evget.com

文章轉(zhuǎn)載自:慧都控件網(wǎng)

總結(jié)

以上是生活随笔為你收集整理的如何将html转为report,如何使用XtraReport将报表导出为HTML的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。