Convert Web Page to PDF in ASP.net & iTextshrap Step 1 Download iTextSharp dll from below link's Download iTextSharp dll iTextsharp_Dll Download Step 2 Create a sample website in .net . Add reference the downloaded dll . Step 3 Create a page and design you report in this web page and put one button for Export to pdf . Step 4 C# Add namespaces below . using System.IO; using iTextSharp.text; using iTextSharp.text.html.simpleparser; using iTextSharp.text.pdf; using System.Text; Copy and Paste below code in Export Button click event . Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); ...
Step 1 Create Class file as Pivot.cs and copy the below text and save in your file . using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; /// <summary> /// Pivots the data /// </summary> public class Pivot { private DataTable _SourceTable = new DataTable(); private IEnumerable<DataRow> _Source = new List<DataRow>(); public Pivot(DataTable SourceTable) { _SourceTable = SourceTable; _Source = SourceTable.Rows.Cast<DataRow>(); } /// <summary> /// Pivots the DataTable based on provided RowField, DataField, Aggregate Function and ColumnFields.// /// </summary> /// <param name="rowField">The column name of the Source Table which you want to spread into rows</param> /// <param name="dataField">...
How to Display Page Wise Total Amount And Grand Total Amount in Last page SSRS & RDLC Report Step 1 Go to Project Menu >> Add Page Footer After click on the Add Footer Menu footer automatically add in the report. See Figure 1 Figure 1 Step 2 Add new TextBox for display page wise total and edit expression of TextBox . See Figure 2 Figure 2 Add this expression for page total TextBox =Sum(ReportItems!TotalAmount.Value) Step 3 Add new TextBox for display Grand Total in Last Page of RDLC report and edit expression of TextBox . See Figure 3 Figure 3 =IIF( Globals.PageNumber =Globals.TotalPages,Sum(Fields!TotalAmount.Value, "DataSet1"), "") Step 4 Run the application and test the reports Thanks Smruti
Comments
Post a Comment