Servicios Profesionales (consultoras que apoyan el proyecto Mundo Support GX)

Para informarse sobre las soluciones y servicios en:
 - Genexus Software Factory.
 - Búsqueda, Selección & Outsourcing de RRHH.
 - Gerenciamiento externo de Proyectos.
 - Asistencia técnica.
 - Software ERP.

Click Aquí o escriba a mundosupport@gmail.com.

         
             

Bienvenido a Mundo Support

Te damos la bienvenida a Mundo Support GX!!!!!

Como usuario visitante podrás consultar libremente los artículos y comentarios publicados; además de escribir comentarios que aporten y enriquezcan a los artículos.

Si deseas redactar artículos, entradas o consultas te invitamos a que nos escribas a mundosupport@gmail.com y recibirás un correo invitándote a ser redactor contribuyente.

Gracias y esperamos contribuir en tu camino por el mundo Genexus y la programación.



viernes, 9 de mayo de 2008

XLS.Varios - Al abrir archivo con excel los números aparecen en notación científica (exponencial)

Problema: números aparecen en notación científica (exponencial) en documento excel en archivo generado desde Genexus.

Este archivo es generado como una archivo con Tags HTML y grabado con extensión xls.

Que es el formato científico:
El formato Científico muestra un número en notación exponencial, sustituyendo parte del número con E+n, donde E (que significa Exponente) multiplica el número anterior por 10 a la enésima potencia. Por ejemplo, un formato científico con dos decimales muestra 12345678901 como 1.23E+10, que es 1,23 veces 10 a la décima potencia.

Respuesta:
La respuesta es que excel utiliza el formato General.

El formato General usa la notación exponencial para los números grandes (de 12 dígitos o más).

Para quitar la notación exponencial en los números grandes, puede aplicar un formato numérico diferente, como Número. Esto es en forma manual.

Otra alternativa es agregar algún caracter (apóstrofe, # o lo que sea) al tag html que contienen el número para que excel lo tome como texto.

El html quedaría así:

<Table>
<Tr>
<Td>'123456789011111</td>
<Td>'123456789011111</td>

</Tr>
</Table>


y se vería como la Imagen 1.



Por otro lado si lo que se desea mostrar son número de tarjeta de crédito, podría grabarse el número con los espacios intermedios. De esa forma excel lo entiende como caracter y lo muestra bien.

El html quedaría así:


<Table>
<Tr>
<Td>1234 5678 9011 1111</td>
<Td>1234 5678 9011 1111 </td>

</Tr>
</Table>



Y se vería como la Imagen 2.



Por lo menos con esto queda claro el motivo por el cual sucede esto, y solo resta encontrar otras alternativas de solución si esta no satisface.

Bienvenidos comentarios para resolver este tema!

View in english http://worldsupport.blogspot.com/2008/05/xlsvarios-when-opening-file-with-excel.html

lunes, 5 de mayo de 2008

Web.Varios - Como cerrar ventana del objeto llamador













Una forma es incluir el siguiente código js:

<script >
try {
var op = window.opener;
op.opener = self;
op.close();
}
catch(e)
{}
</script>

Incluirlo en un textblock o variable con Formato HTML, y asignarlo en el start del objeto web llamado.



Web.Error - Timeout en Websession con .NET

Luego de pasar un determinado tiempo las variables websession pierden su valor. Esto se debe a que caducan, por defecto tienen un timeout de 20 minutos, pero este valor puede ser configurable.

Para modificarlo editar el web.config y setear en la seccion de configuration/system.web:
<sessionState mode="InProc"
cookieless="false"
timeout="20"/>
el default es 20 minutos.

Mas informacion en http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/deployguide/iisdg_net_mshe.asp

En w2003Server es posible configurar el timeout por directorio virtual. para ello en las propiedades del directorio virtual, configurar tab virtualdirectory\Configuration\options\Enabled Session State

Nota: en la documentacion la seccion session state se cierra con </sessionState>, pero lo corecto es sin cerrarlo, algo como
<sessionState mode="InProc" stateConnectionString="tcpip=27.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20" />


Configuring ASP.NET Applications to Use the Appropriate Session

StateYou can configure ASP.NET session state persistence in the <sessionState> section of the Machine.config file for all of the ASP.NET applications on the Web server, or you can configure it in the Web.config file for each ASP.NET application. If the <sessionState> section of the Web.config file for an ASP.NET application is empty, the session state configuration for the application is inherited from the <sessionState> section of the Machine.config file.

If the <sessionState> section does not exist in the Machine.config file or the Web.config file, the following is the default session state behavior:

The session time-out value for an ASP.NET session state is 20 minutes.
The session state is maintained within all of the applications running in the same application pool.
The session state is only maintained on the local Web server (where the session state mode attribute is set to InProc), not across multiple servers in a Web farm.
In addition to the configuration settings that are specific to the mode you selected for maintaining session state, the following attributes need to be configured:

The cookieless attribute. This attribute determines whether or not the session identifier is transferred between the Web server and the client by using cookies. When the cookieless attribute is set to True, cookies are not used to convey session identifiers. When the cookieless attribute is set to False, cookies are used to convey session identifiers. The default setting is False.
The timeout attribute. This attribute specifies the number of minutes that a session is considered valid. When the time specified in the timeout attribute expires, the session is disconnected. The default time-out limit is 20 minutes.
Configure the session state settings in the <sessionState> section for the mode that you selected.

Session state is maintained in-process
To maintain session state in-process, you can either delete the <sessionState> section or configure the <sessionState> section in the Machine.config file or the Web.config file.

The following is an example of the configuration when maintaining session state in-process:

<configuration>
<system.web>
<sessionState
mode="InProc"
cookieless="true"
timeout="20"
</sessionState>
</system.web>
</configuration>
Session state is maintained out-of-process with the ASP.NET state service
To configure ASP.NET to maintain session state with the ASP.NET state service, modify the following attributes in addition to the mode attribute:

The stateConnectionString attribute. This attribute specifies the IP address and port number where the ASP.NET state service is running. The format for this attribute is "tcpip=server:port", where server is the IP address or host name of the server, and port is the TCP port number that the ASP.NET state service is configured to use. The default port number is 42424.
The stateNetworkTimeout attribute. This optional attribute specifies the length of time, in seconds, that the TCP/IP network connection between the Web server and the server running the ASP.NET state service can be idle before the session is abandoned. The default time-out limit is 10 seconds.
The following is an example of the configuration when maintaining session state out-of-process with the ASP.NET state service:

<configuration>
<system.web>
<sessionState
mode="StateServer"
cookieless="true"
timeout="20"
stateConnectionString="tcpip=127.0.0.1:42424"
stateNetworkTimeout=”10”
</sessionState>
</system.web>
</configuration>
Session state is maintained out-of-process with a computer running Microsoft SQL Server
To configure ASP.NET to maintain session state with a computer running SQL Server, modify the sqlConnectionString attribute in addition to the mode attribute. The sqlConnectionString attribute specifies the ODBC data connection string used for establishing the connection to the computer running SQL Server.

The format for the sqlConnectionString attribute is "data source=odbc_connection_string", where odbc_connection_string is any valid ODBC data connection string that is valid for the computer running SQL Server. For more information about creating ODBC data connection strings for Microsoft SQL Server, see the MSDN Online link on the Web Resources page at http://www.microsoft.com/windows/reskits/webresources, and then search for "How to allocate handles and connect to SQL Server (ODBC)".

The following is an example of the configuration when maintaining session state out-of-process with a computer running SQL Server:

<configuration>
<system.web>
<sessionState
mode="SQLServer"
cookieless="true"
timeout="20"
sqlConnectionString="data source=localhost;
Integrated Security=SSPI;
Initial Catalog=northwind"
</sessionState>
</system.web>
</configuration>


 

Web.Error - SQL Server does not exist or access denied.

Se puede dar el error mencionado al querer acceder a una base de datos SQL Server desde una aplicación Web .NET con ADO.NET como método de conexión. Generalmente este problema se da al ejecutar una aplicación Web, no con las aplicaciones Win. Además se da al querer ejecutar la aplicación Web, no con la reorganización, porque aunque la aplicación sea Web, la reorganización es una aplicación Win.


Si se está en las condiciones antes mencionadas, a continuación se mencionan varios puntos para verificar, y algunas soluciones.

**** En las DBMS Options de GX: ****
- En la propiedad Server Name usar la IP en lugar de usar el nombre del servidor.
- Chequear que el nombre de la base de datos haya quedado correctamente escrito en Database Name
- En el archivo web.config agregar el impersonate y configurar el usuario de red junto con el dominio, esto es, dentro de la sección <system.web> del web.config agregar la siguiente línea:
<identity impersonate="true" username="dominio\usuario" password="password"/>

- Si el SQL Server está en distinta máquina que el servidor Web, entonces se puede verificar esto: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q315159
Entonces para eso, se puede cambiar el web.config de la siguiente manera:
Cambiar la línea
<add key="Connection-Default-Opts" value=";Integrated Security=no;" /> por
<add key="Connection-Default-Opts" value=";Integrated Security=no;Network Library =dbmssocn" />

Esto hace que se comunique via TCP/IP con la BD. Aunque se puede configurar desde la opción SQL Server / Client Network Utility / Alias agregándolo en el web.config también tendría que funcionar.

**** En el Enterprise Manager, donde está dada de alta la instancia del servidor SQL Server remoto, verificar los siguientes puntos: ****
- Botón derecho sobre el nombre de la instancia / Properties / Security / Ver si en Authentication está seleccionado: SQL Server and Windows
- Por defecto si no se especifica nada en las "Additional connection string attributes" intenta conectarse al puerto 1433, ver si está configurado ese puerto, Properties de la instancia / General / Network configuration / Marcar TCP/IP y dentro de los Enabled protocols / Properties debe decir 1433
- La instancia debe tener el mismo nombre que la máquina donde está el SQL Server, es decir la instancia que se ve en el Enterprise Manager no puede tener distinto nombre que la máquina remota donde está instalado el SQL Server.

Si se está haciendo una conexión a un SQL Server pero a otro puerto que no sea el default de SQL Server (1433) se debe especificar en las DBMS OPTIONS en la propiedad "Server Name": SERVER,PORT y en la propiedad:
"Additional connection string attributes" no se debe especificar nada.

Puede ser que haya un firewall y no se tenga el puerto definido en la instancia habilitado, para saber esto se puede hacer un telnet al servidor indicando el puerto, por ejemplo desde una ventana de comandos ejecutar:
telnet <nombre de servidor> 1433
si no da ningún mensaje se accede bien al servidor, si se da un error es porque no está habilitado el puerto 1433, en ese caso hay que habilitarlo.

Hay más puntos para verificar en: http://support.microsoft.com/?id=328306

**** Para chequear que la instancia del SQL Server está correcta, se pueden ejecutar las siguientes sentencias desde el Query Analizer (esto puede estar mal si se renombró en algún momento la instancia del SQL Server): ****
1 - Check sp_helperserver at SQL Query Analyzer: it should return one row with id =0 and name= instance name. Check 'select @@servername' at SQL Query Analyzer: if it returns the same instance name, go to step B; otherwise:
2 - drop the wrong instance name and add the correct name:
a - sp_dropserver 'old_name', 'droplogins'
b - go
c - sp_addserver 'new_name', 'local'
d - go
3 - Restart SQL server service and check 'select @@servername' again.

Más info en: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q303774

**** En el Directorio Virtual: ****
En este caso hay 3 máquinas involucradas, la del cliente, la del servidor de base de datos y la del servidor Web. Cuando se usa la autenticación por defecto en el directorio virtual, las credenciales para autenticar sirven sólo en una conexión, o sea, no se delegan (saltan sólo una vez). El problema es que para conectarse al servidor web se autentica con un token que luego no sale el de la maquina que tiene el servidor de base de datos, sino que sale el token del usuario con el que se logueó el ASPNET.
Si funciona si el servidor web está en la misma máquina que el cliente.
Una solución es usar un mecanismo de autenticación que soporte delegación, puede ser basic o kerberos. Lo que hay que tener en cuenta en estos casos es que el usuario y password van “clear text”.

Para esto seguir los siguientes pasos:
- Cambiar en el IIS, en el directorio virtual, que se conecte con Basic Authentication, ahi se van a habilitar 2 campos, para agregar el dominio y el realm. También hay que deshabilitar el Anonymous Access (primer check). Esto se configura en el directorio virtual / botón derecho / propiedades / Tab directory security / botón Edit / marcar el check basic authentication y desmarcar el Anonymous Access.
Cuando se ejecute el web panel va a aparecer una ventana para ingresar el usuario y password, habría que usar los mismo que se usan para conectarse a la red.
También en este caso se tiene que configurar el impersonate en el web.config con el usuario de red <dominio>\usuario y password. Luego de esto reiniciar el IIS.

Documento que explica como configurar esto: http://support.microsoft.com/default.aspx?scid=kb;en-us;810572

La explicación anterior también puede aplicarse cuando hay un firewall instalado en el servidor de base de datos y hace que no llegue el usuario a la base de datos, en ese caso también se pueden seguir los pasos mencionados arriba y ver si el usuario llega correctamente.

**** Para saber que usuario está llegando a la base de datos, seguir los siguiente pasos: ****
- En el Enterprise Manager, donde está definida la instancia del servidor de base de datos, seleccionar la opción: Management/Current Activity/Process Info. Ahi aparecen todos los procesos que estás ejecutando y que usuario se utiliza para la conexión de cada base de datos. Seguramente el proceso que tenga el número mayor es el que se está usando para esta conexión. Ver que usuario que aparece ahí.

Que opinás del material expuesto en el Blog?