150bryant Posted March 6, 2014 Report Posted March 6, 2014 http://forums.asp.net/t/1808924.aspx?How+to+create+a+flipcart+like+panel+for+showing+products+in+gridview using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Microsoft.Reporting.WebForms;using System.IO;public partial class _Default : System.Web.UI.Page{private DataTable LoadSalesData(){// Load data from XML file.DataSet dataSet = new DataSet();dataSet.ReadXml(@"c:\Reports\data.xml");return dataSet.Tables[0];}protected void Page_Load(object sender, EventArgs e){this.ReportViewer1.ProcessingMode = ProcessingMode.Local;this.ReportViewer1.LocalReport.ReportPath =@"c:\Reports\Report1.rdl";ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Sales", LoadSalesData()));}protected void Button1_Click(object sender, EventArgs e){Warning[] warnings;string[] streamids;string mimeType;string encoding;string extension;byte[] bytes = ReportViewer1.LocalReport.Render("Excel", null, out mimeType, out encoding,out extension,out streamids, out warnings);FileStream fs = new FileStream(@"c:\output.xls",FileMode.Create);fs.Write(bytes, 0, bytes.Length);fs.Close();Label1.Text = "Report exported to output.xls";}}
150bryant Posted March 6, 2014 Report Posted March 6, 2014 this to Excel..CSV excel are almost same kind..
150bryant Posted March 6, 2014 Report Posted March 6, 2014 http://stackoverflow.com/questions/3494009/creating-a-custom-export-to-excel-for-reportviewer-rdlc
150bryant Posted March 6, 2014 Report Posted March 6, 2014 http://stackoverflow.com/questions/16143737/custom-export-reportviewer-to-excel-file
150bryant Posted March 6, 2014 Report Posted March 6, 2014 Finally i got it -- export to excel from Report viewer... string mimeType; string encoding; string fileNameExtension; Warning[] warnings; String[] streamids; byte[] exportBytes = RequestOverviewReportViewer.LocalReport.Render("Excel", null, out mimeType, out encoding, out fileNameExtension, out streamids, out warnings); HttpContext.Current.Response.Buffer = true; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = mimeType; HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=ExportedReport." + fileNameExtension); HttpContext.Current.Response.BinaryWrite(exportBytes); HttpContext.Current.Response.Flush(); HttpContext.Current.Response.End(); http://social.msdn.microsoft.com/Forums/vstudio/en-US/76362c4b-002d-4b94-a365-0c753dde2314/report-viewer-export-to-excel?forum=netfxbcl
Yuvatha Posted March 6, 2014 Author Report Posted March 6, 2014 brother excel/doc/pdf default ga untundi rdlc lo...ma yedavalki txt/csv kavalanta...
150bryant Posted March 6, 2014 Report Posted March 6, 2014 brother excel/doc/pdf default ga untundi rdlc lo...ma yedavalki txt/csv kavalanta... excel save it as CSV man
Yuvatha Posted March 6, 2014 Author Report Posted March 6, 2014 excel save it as CSV man problem is...rdlc lo save options direct ga excel file ochestundi..it is not giving a save as option where you can set file type as csv/txt.
150bryant Posted March 6, 2014 Report Posted March 6, 2014 problem is...rdlc lo save options direct ga excel file ochestundi..it is not giving a save as option where you can set file type as csv/txt. excel file vachinaaka excel ni open chesi....save as kottu..
Yuvatha Posted March 6, 2014 Author Report Posted March 6, 2014 excel file vachinaaka excel ni open chesi....save as kottu.. thanks. baga cheppavu..users ki ilage cheptava nuvu
150bryant Posted March 6, 2014 Report Posted March 6, 2014 thanks. baga cheppavu..users ki ilage cheptava nuvu im tryin to help...i dont kno wat u are referring to.. im not an expert or atleast knowlegeable in this stuff
Yuvatha Posted March 6, 2014 Author Report Posted March 6, 2014 im tryin to help...i dont kno wat u are referring to.. im not an expert or atleast knowlegeable in this stuff bro..nenu ninnu emi anatledu...aa option users ki chepalem kada antuna...like save into a format n change it back ani
Recommended Posts