المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Problem while exporting a aspx page to pdf



C# Programming
05-01-2013, 03:11 PM
i have designed a table as shown below. the are two literal controls as i am binding the datatable to the literal contol creating a tabular structre in the page load itself. The data is displayed correctly in default.aspx page. i want to export this aspx page to pdf . I using Itextsharp.dll.

On button click i have written code. The PDF is generated but it is getting distorted. Not getting generated as per the displayed aspx page.

Default.aspx and cs file is pasted below.

Customer Details

now the cs file is as below

public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string Qexp1 = "select * from emp"; string dconn = ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString; OracleConnection oraconn = new OracleConnection(dconn); oraconn.Open(); OracleCommand oracmd = new OracleCommand("select * from emp", oraconn); oracmd.CommandType = CommandType.Text; DataTable dt = new DataTable(); OracleDataReader oda = oracmd.ExecuteReader(); dt.Load(oda); litvac.Text = "Value Of Account [Fig. are in lacs]"; litvac.Text += "EMPEname"; for (int k = 0; k <span class="code-keyword">