public void pdfgenforffd(TextBox TextBox3, HiddenField HiddenField1, HiddenField HiddenField4, AjaxControlToolkit.HTMLEditor.Editor Editor1)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
// Create PDF document
Document pdfDocument = new Document(PageSize.A4, 50, 25, 15, 10);
PdfWriter wri = PdfWriter.GetInstance(pdfDocument, new FileStream("d://" + HiddenField1.Value + "_" + HiddenField4.Value + ".pdf", FileMode.Create));
PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream);
pdfDocument.Open();
string htmlText = Editor1.Content;
//string htmlText = htmlText1.Replace(Environment.NewLine, "<br/>");
HTMLWorker htmlWorker = new HTMLWorker(pdfDocument);
htmlWorker.Parse(new StringReader(htmlText));
pdfDocument.Close();
HttpContext.Current.Response.End();
}
Run Code Online (Sandbox Code Playgroud)
我正在使用上面的代码从HTMLEditor(ajax控件)中的html文本生成pdf.如果我用不同宽度的每一列硬编码一个表,进入HTMLEditor文本而不是生成pdf时,列得到相同的分配即使所有列在pdf上都有固定的大小,即使我为每列指定了一些自定义宽度.
我想生成可以将html转换为pdf的pdf,也可以将表格列除以指定的宽度.怎么做?
我在asp.net c#中有2个下拉列表,其中一个只有两个项目('OK''PK'),另一个绑定到数据库字段,其中有158个项目.
我想在用户选择"确定"时从第二个列表中删除两个项目,并在用户选择"PK"时保留原始列表.
我该怎么做??因为我将第二个列表绑定到数据库是否有任何属性可以隐藏列表中的一些值?
我使用以下代码将Editor(Ajax控件)中的内容转换为pdf,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;
using iTextSharp.text.html.simpleparser;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
/// <summary>
/// Summary description for pdfgeneration
/// </summary>
public class pdfgeneration
{
public pdfgeneration()
{
//
// TODO: Add constructor logic here
//
}
public void pdfgenerator(String name1, AjaxControlToolkit.HTMLEditor.Editor Editor1)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
// Create PDF document
Document pdfDocument = new Document(PageSize.A4, 70, 55, 40, 25);
PdfWriter wri = PdfWriter.GetInstance(pdfDocument, new FileStream("e://" +name1 + ".pdf", FileMode.Create));
PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream); …Run Code Online (Sandbox Code Playgroud) 我正在尝试将日期添加到如下检索的日期
//reading fromdatabase
Dim expenddt_ As String = rdr("Expected_End_Date").ToString
Dim dt_1 As Date = Date.Parse(expenddt_)
Dim expenddt As String = dt_1.ToShortDateString()
txtenddt.Text = expenddt
Run Code Online (Sandbox Code Playgroud)
假设expenddt_ 值为"11/1/2012 12:00:00 AM",而不是 dt_1值#11/1/2012#并且expenddt具有"11/1/2012",那么在文本框中txtenddt,值显示为expenddt.
现在,当我尝试添加一天dt_1作为
Dim test As Date = dt_1.AddDays(+1)
Run Code Online (Sandbox Code Playgroud)
比测试中的值更新为11/2/2012,即添加一个月而不是一天.我怎样才能添加一天?任何人都可以帮我解决这个问题吗?
以下是代码: ASPX代码
<asp:Chart ID="Chart1" runat="server" Width="414px" Height="396px" BackColor="Transparent"
Palette="SeaGreen">
<Series>
<asp:Series Name="Education" XValueMember="State" YValueMembers="Education" IsVisibleInLegend="true"
ChartType="Pie" Color="255, 255, 128">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true">
<AxisX LineColor="DarkGray">
<MajorGrid LineColor="LightGray" />
</AxisX>
<AxisY LineColor="DarkGray">
<MajorGrid LineColor="LightGray" />
</AxisY>
<Area3DStyle Enable3D="True" WallWidth="5" LightStyle="Realistic"></Area3DStyle>
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend>
</asp:Legend>
</Legends>
</asp:Chart>
Run Code Online (Sandbox Code Playgroud)
CS代码
var table = new DataTable();
table.Columns.Add("State", typeof(string));
table.Columns.Add("Education", typeof(long));
table.Columns.Add("Lbl");
var row = table.NewRow();
row["State"] = "Gujarat";
row["Education"] = 791;
table.Rows.Add(row);
row = table.NewRow();
row["State"] = "Delhi";
row["Education"] = …Run Code Online (Sandbox Code Playgroud) 我的客户端已超过默认的sharepoint阈值. 
我知道不建议增加默认限制,但在我的情况下,我没有其他选择,只能提高阈值.
任何人都可以告诉我,我可以提出的最大限额是多少?客户期待另外50000个文件进入文档存储.
按照这个它说,最大限制为50万美元.我可以增加多少钱?
如果我把它增加到5或者1000万,我会变得像个傻瓜吗?
我想从datetime字段中获取日期,当我在数据库中选择此字段时,我得到的结果为'yyyy-mm-dd hh:mm:ss'我希望结果像dd/mm/yyyy
我正在使用ASP.net开发网站C#使用Mysql.query我做的是:
// ***获取下一个日期
string nextdatequery ="SELECT next_dt FROM testcase.heardt where fil_no =?and next_dt>?;";
请帮我解决我的问题.
我有一个Date变量startdt和一个String变量hdnsdate.
假设if startdt具有3/1/2012形式hdnsdate的值并且具有03/01/2012形式的值.我怎么能比较这两个日期在vb.net中是相同的.
在if我的程序的条件下,我想做这个检查.如果两个日期匹配移出if循环,否则进入if循环.
例如C#中的一个样本我到底想要什么.
if(startdt !=hdnsdate)
{
//Do
}
else
{
//Do this
}
Run Code Online (Sandbox Code Playgroud) 我想用sql查询来改变大小写
例如,如果文本是:( My nAme is iShAn halaRNkar文本混乱,即它可能包含小写或大写的任何地方)
比我想要的输出是: My Name Is Ishan Halarnkar
我还没有在sql查询上工作过多.请帮助.
Image img = new Image();
img.ImageUrl = "images/sample1.jpg?rnd=" + (new Random()).Next();
// added random for caching issue.
this.Controls.Add(img);
Run Code Online (Sandbox Code Playgroud)
我得到的错误是
无法创建抽象类或接口'System.Drawing.Image'--->第1行的实例
'System.Drawing.Image'不包含'ImageUrl'的定义,也没有扩展方法'ImageUrl'接受类型'System.Drawing.Image'的第一个参数(你是否缺少using指令或程序集引用) ?)---> Line2
最好重载方法匹配"System.Web.UI.ControlCollection.Add(System.Web.UI.Control)"具有一些无效参数---> 3号线
错误10参数'1':无法从'System.Drawing.Image'转换为'System.Web.UI.Control'
请帮我解决错误.
asp.net ×8
c# ×5
date ×2
itext ×2
vb.net ×2
charts ×1
date-format ×1
datetime ×1
html-to-pdf ×1
mysql ×1
pdf ×1
pie-chart ×1
sql ×1
sql-server ×1
threshold ×1
title-case ×1