c#asp.net表格Html数据模板转换Pdf文件web打印报表dll
c#asp.net表格Html数据模板转换Pdf文件web打印pdf报表dll
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.xml;
using HtmlTable2pdf;
namespace html2PDF
{
public partial class WebForm1 : System.Web.UI.Page
{
string strtb = ““;
protected void Page_Load(object sender EventArgs e)
{
if (!IsPostBack)
{
/* byte[] buff = SendOutPDF();
Response.ContentType = “application/pdf“;
Response.BinaryWrite(buff);
*/
}
if (Request[“action“] == “list“)
{
list();
}
if (Request[“action“] == “group“)
{
group();
}
if (Request[“action“] == “sub“)
{
sub();
}
if (Request[“action“] == “cross“)
{
cross();
}
}
///
/// Sends a Stream of bytes to Client as a PDF file
///
/// Stream containing bytes
private void list()
{
string fileName = string.Empty;
strtb = @“yle>td {border-bottom-width: 1px; border-bottom-style: solid;border-bottom-color: gray; border-left-width: 1px; border-left-style: solid;border-left-color: gray;} table {border-right-style: solid;border-right-color: gray;border-right-width: 1px;border-top-style: solid;border-top-color: gray;border-top-width: 1px;} yle>
yle=‘text-align:left;font-size:10.5pt;font-family: 宋体‘ width=‘300‘ section=‘页眉‘>
yle=‘border-left-width: 1px; border-left-style: solid; border-left-color: gray; background-color:#CCCC00‘ bgcolor=‘#C0C0C0‘ width=‘220‘>userobject.companyName
这是页眉 yle=‘float:left‘ width=‘390‘>第X页 共Y页
yle=‘border:0;‘>order.customerName ‘时间:‘+(order.billDate).ToString(‘yyyy年MM月dd日‘) ‘单号:‘+order.number ‘时间:‘+userobject.getRMBs(‘123.45‘)
页头:类别 价格 数量 金额 仓库 金额(大写)
yle=‘code=[userobject.rowNum % 2 == 1? ‘‘ : ‘color:#CCCC00‘ ]‘>orderDetail.name+‘ ‘+orderDetail.spec orderDetail.price yle=‘code=[ orderDetail.unitName == ‘吨‘? ‘‘ : ‘background-color:#00FF66‘ ]‘>orderDetail.q
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 155136 2017-08-24 13:55 webPagehtml2PDFinHtmlTable2pdf.dll
文件 37376 2017-08-24 14:28 webPagehtml2PDFinhtmltoPDF.dll
文件 22016 2017-08-24 14:28 webPagehtml2PDFinhtmltoPDF.pdb
文件 3928064 2013-09-16 12:21 webPagehtml2PDFinitextsharp.dll
文件 163840 2013-09-16 12:21 webPagehtml2PDFinitextsharp.xmlworker.dll
文件 4852 2016-06-30 16:13 webPagehtml2PDFhtmltoPDF.csproj
文件 1170 2016-06-30 16:13 webPagehtml2PDFhtmltoPDF.csproj.user
文件 6357 2017-08-24 14:39 webPagehtml2PDFobjDebugDesignTimeResolveAssemblyReferencesInput.cache
文件 675 2017-08-24 14:22 webPagehtml2PDFobjDebughtmltoPDF.csproj.FileListAbsolute.txt
文件 37376 2017-08-24 14:28 webPagehtml2PDFobjDebughtmltoPDF.dll
文件 22016 2017-08-24 14:28 webPagehtml2PDFobjDebughtmltoPDF.pdb
文件 25433 2017-08-24 14:22 webPagehtml2PDFobjDebugResolveAssemblyReference.cache
文件 1317 2016-06-29 15:39 webPagehtml2PDFPropertiesAssemblyInfo.cs
文件 1719 2016-06-30 16:19 webPagehtml2PDFWeb.config
文件 1223 2012-06-06 11:03 webPagehtml2PDFWeb.Debug.config
文件 1284 2012-06-06 11:03 webPagehtml2PDFWeb.Release.config
文件 1937 2017-08-24 16:21 webPagehtml2PDFWebForm1.aspx
文件 25949 2017-08-24 14:28 webPagehtml2PDFWebForm1.aspx.cs
文件 804 2017-08-24 14:13 webPagehtml2PDFWebForm1.aspx.designer.cs
文件 916 2016-06-29 15:48 webPagehtml2PDF.sln
..A..H. 23552 2017-08-24 15:12 webPagehtml2PDF.suo
..A..H. 41984 2016-06-29 15:38 webPagePDF_Count.suo
文件 167 2016-03-19 13:45 winFormApp.config
文件 155136 2017-08-24 13:55 winForminDebugHtmlTable2pdf.dll
文件 3928064 2013-09-16 12:21 winForminDebugitextsharp.dll
文件 163840 2013-09-16 12:21 winForminDebugitextsharp.xmlworker.dll
文件 41472 2017-08-24 14:08 winForminDebugTests.exe
文件 167 2016-03-19 13:45 winForminDebugTests.exe.config
文件 24064 2017-08-24 14:08 winForminDebugTests.pdb
文件 11592 2017-08-24 16:16 winForminDebugTests.vshost.exe
............此处省略42个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)