|
 |
|
|
Hi I have used code given by you in my application but it shows me following error Control '_ctl0_Ultrawebgrid1' of type 'UltraWebGrid' must be placed inside a form tag with runat=server
but HTML view of aspx file contain all in DIV tag
can you guide me?
I am using infragistics ultrawebgrid..its working fine for data count less than 10000 but when it goes up its showing error for object instance and array bound sometime.Thats why I was looking for some another way to do exporting.
Please help me
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
hii malik...i m absolutely new to this field...i need more guidance regarding how to export grid data into excel....thru C#. as u had provided the C# code for it...bt i m not clear how to use it n chk it. waiting for reply...
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I wish to ask whether the source code can be move a class and call the method out? I have move to a class for the excel_view method but my "Context" is not declare but i already have added the Imports System.Web.HttpResponse
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
Hi All,
I have tried this application, its working fine. but only when page is stand alone page.
I my actual application, I am using master page, so when i tried to export data from one of the content page. It's giving error like, GridView must be placed beteen <form> tag, which is not there in case of master-content architecture.
can anybody help me out with this?
Thanks in advance,
Jay Khanpara</form>
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
I am using Response.ContentType = "application/vnd.ms-excel"
to export large amount of data to excel with ASP. It creates multiple worksheets too. This is being used for daily production data. So the amount of worksheets can add up quick. Now, I am running into a problem. An Excel file that usually is a 1 MB is now 7MB when it opens as an .xml in the browser.
This takes up a lot of server resources to open such a big file. How can I reduce this?
PLEASE HELP!!!!!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
i use ur code i show normal new Internet Explorer open and show records normally. i want show the datas in Excel sheet.
plz tel the solution... thanks
Deepi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
When i use this code on local system it works..but when i try to link it with a centralized database and deploy my application on a server this code fails..please give a suggestion.
thanx in advance Nilesh
hi
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
|
 |
|
|
Hi,
I need to process the data which is in text file and export the formatted data to Excel in ASP .net 2.0. I managed to export to excel with single worksheet. I need to know how to add multiple worksheets to spread the data accordingly.
Thanks, Uma Ramiya
|
| Sign In·View Thread·PermaLink | 1.50/5 (2 votes) |
|
|
|
 |
|
|
Hi,
i need asp page report all into excel and pdf formats. and also asp report can i view and edit that page using asp\how?
laksh
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
yeh this is possible and you can search grid editing on the same site for this. if unable then please let me know i will guide u. sorry for late reply regards
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
hello I used your code in c# ( Iconverted to c# ) nd test it but I can't have any data in excel file! I only have this text in .xls file : ""+ Report_Title + "" please tell me why!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
i tested it in C# myself i imported the reference of GridToExcel and copy the same dabase and wrote the following code in my C# application and it was fine with me
GridToExcel.DataGrid abc = new GridToExcel.DataGrid(); abc.Excel_View("select * from sales", "Test Report", "Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" + Server.MapPath("db.mdb") + "'");
please try this and if you want to convert the "Excel_View" to C# then let me know.
Regards
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |
|
|
i also have converted the ddl's function "excel_view" please check and try now
void Excel_View(string Query, string Report_Title, string Connection_String) { OleDbConnection conn = new OleDbConnection(Connection_String); conn.Open(); System.Web.UI.WebControls.DataGrid dg = new System.Web.UI.WebControls.DataGrid(); OleDbDataAdapter da = new OleDbDataAdapter(Query, conn); DataSet ds; ds = new DataSet(); da.Fill(ds); dg.DataSource = ds; dg.DataBind();
dg.Font.Name = "Verdana"; dg.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid; dg.HeaderStyle.BackColor = System.Drawing.Color.Blue; dg.HeaderStyle.ForeColor = System.Drawing.Color.White; dg.HeaderStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center; dg.HeaderStyle.Wrap = false; dg.HeaderStyle.Font.Bold = true;
Response.Buffer = true; Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = "application/vnd.ms-excel"; EnableViewState = true; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); dg.RenderControl(hw); Response.Write(DateTime.Now); Response.Write("<b><center><font size=3 face=Verdana color=#0000FF>" + Report_Title + "</font></center></b>"); Context.Response.Write(tw.ToString()); Context.Response.Flush(); Response.Close(); Response.End(); da.Dispose(); da = null; ds.Dispose(); ds = null; conn.Close(); conn.Dispose(); conn = null; }
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
yes! it works well.thanks. now I have another problem,please help me. my data is in persian(farsi) language.I set the font in datagrid but in Excel file data doesnt display correctly.how can I solve this problem?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
can you please provide me the code how you display that in datagrid then i might be able to do some thing other wise i have no diea.
Regards
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
private void Excel_View( String Query, String Report_Title, String Connection_String ) { DataSet DS; SqlDataAdapter DA; SqlCommandBuilder Cmd; System.IO.StringWriter tw; System.Web.UI.HtmlTextWriter hw; System.Web.UI.WebControls.DataGrid dg;
//defin and open new database connection DA = new SqlDataAdapter(Query, ocLConnect ); Cmd = new SqlCommandBuilder( DA ); DS = new DataSet();
DA.Fill(DS); dg = new DataGrid(); dg.DataSource = DS; dg.DataBind();
dg.Font.Name = "Tahoma"; dg.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Right; dg.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid; dg.HeaderStyle.BackColor = System.Drawing.Color.Blue; dg.HeaderStyle.ForeColor = System.Drawing.Color.White; dg.HeaderStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Center; dg.HeaderStyle.Wrap = false; dg.HeaderStyle.Font.Bold = true; //export to excel Response.Buffer = true; Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = "application/vnd.ms-excel"; EnableViewState = true; tw = new System.IO.StringWriter(); hw = new HtmlTextWriter(tw); dg.RenderControl(hw); Response.Write(DateTime.Now); Response.Write(""+ Report_Title + ""); Context.Response.Write(tw.ToString()); Context.Response.Flush(); Response.Close(); Response.End(); DA.Dispose(); DA = null; DS.Dispose(); DS = null; }
private void ExpButton_Click(object sender, System.Web.UI.ImageClickEventArgs e) { Excel_View( "Exec SFExternalOrderList ", "TestReport", "" ); }
when I use a simple query like "select * from tblTest" it works well and there isn't problem with language but in this sample that I use an stored procedure I have problem! those data that are in farsi language don't show correctly!
thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
There is no issue in code so please check that your excel support farsi language or not and i think u need to install some plugin for this.
Regards
|
| Sign In·View Thread·PermaLink | 3.00/5 (1 vote) |
|
|
|
 |
|
|
I don't think that for Excel , because as I said when I use a simple query there isn't any problem with farsi language!
|
| Sign In·View Thread·PermaLink | 2.00/5 (1 vote) |
|
|
|
 |