16,012,116 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Swetha Bisa (Top 18 by date)
Swetha Bisa
24-Jul-13 10:10am
View
protected void btnpdf_Click(object sender, EventArgs e)
{
ExportToPdf(DivPDf, lblF.Text);
}
public void ExportToPdf(Control DivPDf, string fileName)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=" + fileName + ".pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
HtmlForm frm = new HtmlForm();
DivPDf.Parent.Controls.Add(frm);
frm.Attributes["runat"] = "server";
frm.Controls.Add(DivPDf);
frm.RenderControl(hw);
DivPDf.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0.0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
byte[] byteArr = Encoding.ASCII.GetBytes(sw.ToString());
MemoryStream stream = new MemoryStream(byteArr);
StreamReader stre = new StreamReader(stream);
pdfDoc.Open();
htmlparser.Parse(stre);
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Verifies that the control is rendered */
return;
}
these are the code snippets im using
Swetha Bisa
24-Jul-13 10:06am
View
ya its exporting to pdf but my problem is in pdf document im not getting the table which im getting in preview, im getting the labels scattered through out the page
Swetha Bisa
24-Jul-13 10:05am
View
hai sarin,
can u please let me know how the above mentioned code snippet is used??
Swetha Bisa
24-Jul-13 8:08am
View
hai sarin,
thanks for the reply, but i want to generate it as a salary slip, so how can i generate a pdf document.
Swetha Bisa
16-Jul-13 6:17am
View
hai prakash,
thanks for your reply but it dint help me... :(
Swetha Bisa
16-Jul-13 3:37am
View
yes but if im having 31 columns it is showing 32 which is also showing that it is the exceeding column in grid and with a empty space in the middle.
Swetha Bisa
16-Jul-13 3:28am
View
i already did it rohan but im getting a column of empty space in the grid
Swetha Bisa
16-Jul-13 3:21am
View
whole list
Swetha Bisa
16-Jul-13 3:18am
View
hai rohan
my question is i had a radio button list with 4 list items binded dynamically to a gridview in a loop. Now according to condition i want to hide the radiobutton list. is it possible to hide??
for eg:
if it is today i want to show the radiobuttonlist
and if it is yesterday or lastmonth i want to hide it
Swetha Bisa
2-May-13 7:25am
View
actually i want to bind checkboxes dynamically to gridview using datatable. dates of month should also bind as header in each row and ids of employees to the left
Swetha Bisa
1-May-13 7:31am
View
I want web.config code for this
Swetha Bisa
1-May-13 7:30am
View
we observed that but we didn't get you.........
Swetha Bisa
1-May-13 7:23am
View
But i didn't use create user wizard,
i have to redirect to another page based on role which has been retrieved from Database
Swetha Bisa
30-Apr-13 10:19am
View
hello Satyendra
Thanks.I have placed my textbox in gridview,so i need to autogenerate the textboxes with numbers in the sequence as (1,2,3....). also i should store these values in database..
Thanks in advance
Swetha Bisa
30-Apr-13 5:46am
View
yes you are corrrect...
Swetha Bisa
30-Apr-13 5:22am
View
6rows will be there and columns will be auto generated
Swetha Bisa
30-Apr-13 3:48am
View
actually i have a grid view with some textboxes, there i have to enter time in one textbox if i give time in text box it should take time in ascending order only. for eg: 1st time if i give 8:30 and next time if i give 8:20 it should take 8:30 and after 08:30 values,
it should not accept below it
Swetha Bisa
30-Apr-13 3:21am
View
actually i have a grid view with some textboxes, there i have to enter time in one textbox if i give time in text box it should take time in ascending order only. for eg: 1st time if i give 8:30 and next time if i give 8:20 it should take 8:30 and after 08:30 values,
it should not accept below it
Show More