Click here to Skip to main content
15,898,222 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionImage Change in datagrid Pin
Prasadsm3-Nov-08 21:15
Prasadsm3-Nov-08 21:15 
AnswerRe: Image Change in datagrid Pin
Kannan Ar3-Nov-08 23:55
professionalKannan Ar3-Nov-08 23:55 
GeneralRe: Image Change in datagrid Pin
Prasadsm4-Nov-08 0:26
Prasadsm4-Nov-08 0:26 
GeneralRe: Image Change in datagrid Pin
Prasadsm4-Nov-08 1:16
Prasadsm4-Nov-08 1:16 
Questiongridview Datafield Problem! Pin
mr_muskurahat3-Nov-08 21:15
mr_muskurahat3-Nov-08 21:15 
AnswerRe: gridview Datafield Problem! Pin
Sneha Bisht4-Nov-08 0:17
Sneha Bisht4-Nov-08 0:17 
AnswerRe: gridview Datafield Problem! Pin
RichardGrimmer5-Nov-08 2:31
RichardGrimmer5-Nov-08 2:31 
QuestionI have been trying to generate some reports to PDF file format from ASP. NET2.0 application (using itextsharp.dll) Pin
Member 31171723-Nov-08 20:46
Member 31171723-Nov-08 20:46 
this code not working can any help


Document document = new Document();
try
{

System.IO.MemoryStream msReport = new System.IO.MemoryStream();
PdfWriter writer = PdfWriter.GetInstance(document, msReport);
document.Open();
iTextSharp.text.Table datatable = new iTextSharp.text.Table(8);
datatable.Padding = 4;
datatable.Spacing = 0;
//datatable.setBorder(Rectangle.NO_BORDER);
float[] headerwidths = { 50, 50, 50, 50, 50, 40, 40, 45 };
datatable.Widths = headerwidths;
datatable.WidthPercentage = 100;
Cell cell = new Cell(new Phrase("Applicant Wise Report", FontFactory.GetFont(FontFactory.HELVETICA, 15 ,Font.BOLD)));
cell.HorizontalAlignment = Element.ALIGN_CENTER;
cell.Leading = 15;
cell.Colspan = 8;
cell.Border = Rectangle.NO_BORDER;
cell.BackgroundColor = new Color(0xC0, 0xC0, 0xC0);
datatable.AddCell(cell);
datatable.DefaultCellBorderWidth = 1;
datatable.DefaultHorizontalAlignment = 1;
datatable.DefaultRowspan = 1;
datatable.AddCell(new Phrase("Name", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Address", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("State", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("City", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Email ID", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Exam Attended", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Result Status", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));
datatable.AddCell(new Phrase("Exam Date", FontFactory.GetFont(FontFactory.TIMES, 11, Font.BOLD)));

datatable.DefaultCellBorderWidth = 1;
datatable.DefaultRowspan = 1;
if (Dt.Rows.Count > 0)
{
for (int i = 0; i <= Dt.Rows.Count - 1; i++)
{
datatable.DefaultHorizontalAlignment = Element.ALIGN_LEFT;
string name = Convert.ToString(Dt.Rows[i][0]);
datatable.AddCell(new Cell(new Phrase(name, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))),i+1,0);
string address = Convert.ToString(Dt.Rows[i][1]);
datatable.AddCell(new Cell(new Phrase(address, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 1);
string state = Convert.ToString(Dt.Rows[i][2]);
datatable.AddCell(new Cell(new Phrase(state, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 2);
string city = Convert.ToString(Dt.Rows[i][3]);
datatable.AddCell(new Cell(new Phrase(city, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 3);
string mailid = Convert.ToString(Dt.Rows[i][4]);
datatable.AddCell(new Cell(new Phrase(mailid, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 4);
string exam = Convert.ToString(Dt.Rows[i][5]);
datatable.AddCell(new Cell(new Phrase(exam, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 5);
string result = Convert.ToString(Dt.Rows[i][6]);
datatable.AddCell(new Cell(new Phrase(result, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 6);
string examdate = Convert.ToString(Dt.Rows[i][7]);
datatable.AddCell(new Cell(new Phrase(examdate, FontFactory.GetFont(FontFactory.TIMES, 10, Font.NORMAL))), i + 1, 7);

}

document.Add(datatable);
}


document.Close();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=ApplicantWiseReport.pdf");
Response.ContentType = "application/pdf";
Response.BinaryWrite(msReport.ToArray());
Response.End();
AnswerRe: I have been trying to generate some reports to PDF file format from ASP. NET2.0 application (using itextsharp.dll) Pin
darkcalin4-Nov-08 0:09
darkcalin4-Nov-08 0:09 
QuestionWhy we are using ClientID while using master page ? Pin
md_azy3-Nov-08 20:32
md_azy3-Nov-08 20:32 
AnswerRe: Why we are using ClientID while using master page ? Pin
Ashfield3-Nov-08 21:03
Ashfield3-Nov-08 21:03 
AnswerRe: Why we are using ClientID while using master page ? Pin
Abhishek Sur3-Nov-08 23:39
professionalAbhishek Sur3-Nov-08 23:39 
AnswerRe: Why we are using ClientID while using master page ? Pin
Guffa4-Nov-08 12:51
Guffa4-Nov-08 12:51 
Question[Message Deleted] Pin
raghvendrapanda3-Nov-08 20:24
raghvendrapanda3-Nov-08 20:24 
AnswerRe: how to store an image in database.. Pin
Ashfield3-Nov-08 21:06
Ashfield3-Nov-08 21:06 
QuestionPdf2Swf PinPopular
M. K. BASHER3-Nov-08 20:21
M. K. BASHER3-Nov-08 20:21 
AnswerRe: Pdf2Swf Pin
Abhishek Sur3-Nov-08 23:30
professionalAbhishek Sur3-Nov-08 23:30 
Questionhow to get download the file from localdrive Pin
Satish - Developer3-Nov-08 20:08
Satish - Developer3-Nov-08 20:08 
QuestionHow to use contextmenustrip(windows) control in web pages(ASP)? Pin
blakshmi3-Nov-08 19:26
blakshmi3-Nov-08 19:26 
AnswerRe: How to use contextmenustrip(windows) control in web pages(ASP)? Pin
Sathesh Sakthivel3-Nov-08 20:46
Sathesh Sakthivel3-Nov-08 20:46 
GeneralRe: How to use contextmenustrip(windows) control in web pages(ASP)? Pin
blakshmi4-Nov-08 2:23
blakshmi4-Nov-08 2:23 
AnswerRe: How to use contextmenustrip(windows) control in web pages(ASP)? Pin
m-khansari4-Nov-08 3:31
m-khansari4-Nov-08 3:31 
GeneralRe: How to use contextmenustrip(windows) control in web pages(ASP)? Pin
blakshmi4-Nov-08 3:42
blakshmi4-Nov-08 3:42 
QuestionHtmlEncode & Db field length Pin
Blumen3-Nov-08 19:20
Blumen3-Nov-08 19:20 
AnswerRe: HtmlEncode & Db field length Pin
Abhishek Sur4-Nov-08 0:49
professionalAbhishek Sur4-Nov-08 0:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.