我有一张垂直和水平线条的桌子.但我不想要水平线.我只想要垂直线.我怎么设置它.我预期的o/p是
我的表格代码
PdfPTable table = new PdfPTable(5);
table.TotalWidth = 510f;//table size
table.LockedWidth = true;
table.HorizontalAlignment = 0;
table.SpacingBefore = 10f;//both are used to mention the space from heading
table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
table.AddCell(new Phrase(new Phrase(" SL.NO", font1)));
table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
table.AddCell(new Phrase(new Phrase(" SUBJECTS", font1)));
table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
table.AddCell(new Phrase(new Phrase(" MARKS", font1)));
table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
table.AddCell(new Phrase(new Phrase(" MAX MARK", font1)));
table.DefaultCell.HorizontalAlignment = Element.ALIGN_LEFT;
table.AddCell(new Phrase(new Phrase(" CLASS AVG", font1)));
Doc.Add(table);
Run Code Online (Sandbox Code Playgroud)
例如:
有人请帮忙
我用PdfContentByte创建了矩形.现在我想在这个矩形中添加一个文本.我怎样才能做到这一点.如果有人有想法请与我分享.我的矩形代码是
Document doc = new Document(new Rectangle(570, 924f));
PdfWriter writer = PdfWriter.GetInstance(doc,Response.OutputStream);
PdfContentByte cb = writer.DirectContent;
cb.Rectangle(doc.PageSize.Width -90f, 830f, 50f,50f);
cb.Stroke();
Run Code Online (Sandbox Code Playgroud) 我是条码.现在我想在条形码标签下插入学生代码.我怎么能这样做?我的代码是
foreach (GridViewRow row in grdBarcode.Rows)
{
DataList dl = (DataList)row.FindControl("datalistBarcode");
PdfContentByte cb = new PdfContentByte(writer);
PdfPTable BarCodeTable = new PdfPTable(6);
BarCodeTable.SetTotalWidth(new float[] { 100,10,100,10,100,10 });
BarCodeTable.DefaultCell.Border = PdfPCell.NO_BORDER;
Barcode128 code128 = new Barcode128();
code128.CodeType = Barcode.CODE128_UCC;
foreach (DataListItem dli in dl.Items)
{
String barcodename= ((Label)dli.FindControl("lblBarCode")).Text;
string studentcode= ((Label)dli.FindControl("lblStudCode")).Text;
code128.Code = "*" + productID1 + "*";
iTextSharp.text.Image image128 = code128.CreateImageWithBarcode(cb, null, null);
BarCodeTable.AddCell(image128);
BarCodeTable.AddCell("");
}
doc.Add(BarCodeTable);
Run Code Online (Sandbox Code Playgroud)
我现在的输出是
我想将学生代码也带到条形码标签下.请告诉我一个实现它的方法
或者让我知道如何传递多个参数throgh pdftable.Addcell()函数.. !!
我正在运行一个存储过程,但在运行它时显示如下错误
超时已过。操作完成前超时时间已过或服务器未响应。
我已经设置了我的网络配置
<add name="SAMPLECONNECTION" connectionString="Data Source=ADMIN\SQLEXPRESS;Initial Catalog=PFGRT;Persist Security Info=True;MultipleActiveResultSets=true;User ID=sa;connect Timeout =1000000;Password=PASSWORD"
providerName="System.Data.SqlClient" />
Run Code Online (Sandbox Code Playgroud)
我也试过像设置一样connect Timeout = 0;
,但我得到了同样的错误。
我该如何解决?
我的存储过程调用类
public DataSet adFeedBackReportFacultyWise(string SetID, string FacultyID, string SubjectID,string groupid)
{
DbUtil du = new DbUtil();
Dictionary<string, SqlParameter> cmdParameters = new Dictionary<string, SqlParameter>();
cmdParameters["SetID"] = new SqlParameter("SetID", SetID);
cmdParameters["FacultyID"] = new SqlParameter("FacultyID", FacultyID);
cmdParameters["SubjectID"] = new SqlParameter("SubjectID", SubjectID);
cmdParameters["groupid"] = new SqlParameter("groupid", groupid);
return du.ExecuteQuery("adFeedBackReportFacultyWise", cmdParameters);
}
Run Code Online (Sandbox Code Playgroud)
我的 DButil 类是
public class DbUtil
{
string connection = ConfigurationManager.ConnectionStrings["gatikkcmsConnectionString"].ConnectionString; …
Run Code Online (Sandbox Code Playgroud) 我有一个字符串
String data="CE|2014-2015|ClassA"
Run Code Online (Sandbox Code Playgroud)
我需要输出像
string Batch="2014-2015"
string Class="ClassA"
Run Code Online (Sandbox Code Playgroud)
我怎么能实现它?我尝试了很多字符串,Split()函数.但我没有得到预期的输出.请帮助我,我试过,
string s = "CE|2014-2015|Class1";
string[] words = s.Split('|| ');
Run Code Online (Sandbox Code Playgroud)