|
From: <sv...@de...> - 2005-06-14 23:14:22
|
Author: pcamacho
Date: 2005-06-14 19:14:25 -0400 (Tue, 14 Jun 2005)
New Revision: 1327
Modified:
humano2/trunk/web/portal/site/downloadView.aspx.cs
Log:
FIX: bug #203.
Modified: humano2/trunk/web/portal/site/downloadView.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/portal/site/downloadView.aspx.cs 2005-06-14 22:21:3=
1 UTC (rev 1326)
+++ humano2/trunk/web/portal/site/downloadView.aspx.cs 2005-06-14 23:14:2=
5 UTC (rev 1327)
@@ -24,6 +24,8 @@
using System.Text;
=20
using Humano2.Components.WebTools;
+using Humano2.Core;
+using Humano2.Core.Db;
=20
namespace Portal.site
{
@@ -65,6 +67,7 @@
else
{
DataTable resp =3D dbAdapter.GetDataTableView(viewTable, iniClass);
+ =20
StringBuilder sb =3D new StringBuilder();
int rows, cols;
int div =3D Convert.ToInt32(Request.QueryString["separador"]);
@@ -85,10 +88,21 @@
=20
rows =3D resp.Rows.Count;
cols =3D resp.Columns.Count;
-
- for(int i =3D 0;i <=3D rows - 1;i++)
+ =20
+ absCrud crud =3D Factory.Crud();
+ absComplex complex =3D crud.GetCore().Complex;
+ //Add the name of columns
+ foreach (DataColumn col in resp.Columns)=20
+ {
+ string colName =3D col.ColumnName;
+ string userColName =3D complex.ConvertSysAttNameToUs=
erAttName(colName);
+ sb.Append(userColName + sep);
+ }
+ sb.Append("\n");
+ =20
+ for(int i=3D0;i<rows;i++)
{
- for(int j =3D 0; j <=3D cols - 1; j++)
+ for(int j=3D0;j<cols;j++)
{
data =3D resp.Rows[i][j].ToString();
if(data.IndexOf(sep) !=3D -1) { // If the data contains the delimi=
ter, add a delimter.
@@ -111,7 +125,6 @@
Response.AddHeader("Content-Disposition", "attachment;filename=3Dvie=
w.csv");=20
Response.Write(sb.ToString());=20
}
- =09
}=20
}
}
|