<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Datanoia.com &#187; Programación</title>
	<atom:link href="http://www.datanoia.com/category/programacion/feed" rel="self" type="application/rss+xml" />
	<link>http://www.datanoia.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 Dec 2011 05:48:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Twitter4J: Librería Java para la API de Twitter</title>
		<link>http://www.datanoia.com/twitter4j-libreria-java-para-la-api-de-twitter.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter4j-libreria-java-para-la-api-de-twitter</link>
		<comments>http://www.datanoia.com/twitter4j-libreria-java-para-la-api-de-twitter.html#comments</comments>
		<pubDate>Mon, 25 Jan 2010 05:08:40 +0000</pubDate>
		<dc:creator>aolinex</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.datanoia.com/?p=284</guid>
		<description><![CDATA[&#160; Twitter4J es una librería Java para poder interactuar con la API de Twitter. Con Twitter4J, puedes integrar tu aplicación Java con los servicios de Twitter. Si tienes algunos conocimientos de Java, implementar esta librería es bastante sencillo; solo agrega el archivo twitter4j-2.1.0-core.jar a la variable de entorno Classpath de tu Java Virtual machine. Toda<a href="http://www.datanoia.com/twitter4j-libreria-java-para-la-api-de-twitter.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Ftwitter4j-libreria-java-para-la-api-de-twitter.html%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FuQYFMB%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Twitter4J%3A%20Librer%C3%ADa%20Java%20para%20la%20API%20de%20Twitter%20%22%20%7D);"></div>
<p><a href="http://www.datanoia.com/wp-content/uploads/2010/01/twitter4j.png" target="_blank"><img class="aligncenter" title="twitter4j" src="http://www.datanoia.com/wp-content/uploads/2010/01/twitter4j.png" alt="twitter4j" width="374" height="110" /></a></p>
<p>&nbsp;</p>
<p>Twitter4J es una librería Java para poder interactuar con la <a href="http://groups.google.com/group/twitter-development-talk/web/api-documentation" target="_blank">API de Twitter</a>. Con Twitter4J, puedes integrar tu aplicación Java con los servicios de Twitter.</p>
<p>Si tienes algunos conocimientos de Java, implementar esta librería es bastante sencillo; solo agrega el archivo twitter4j-2.1.0-core.jar a la variable de entorno Classpath de tu Java Virtual machine.</p>
<p>Toda la documentación que necesitas lo encuentras en su <a href="http://twitter4j.org/en/javadoc/index.html" target="_blank">JavaDoc</a> (en inglés), puedes empezar por la clase <a href="http://twitter4j.org/en/javadoc/twitter4j/Twitter.html" target="_blank">twitter4j.Twitter</a>.<br />
<strong><br />
Características:</strong></p>
<ul>
<li>Trabaja sobre cualquier plataforma Java versión 1.4.2 o posterior.</li>
<li>Trabaja en la plataforma <a href="http://code.google.com/android/" target="_blank">Android</a> (a partir de la versión 2.1.0).</li>
<li>No necesitas archivos jar adicionales.</li>
<li>Soporta la autenticación <strong>OAuth</strong>.</li>
</ul>
<p>Descarga | <a href="http://twitter4j.org/en/index.html#download" target="_blank">Enlace </a><br />
Ejemplos de código | <a href="http://twitter4j.org/en/code-examples.html" target="_blank">Enlace</a></p>
<p>Via | <a href="http://blogfreakz.com/api/twitter4j-java-library-for-twitterapi/" target="_blank">BlogFreakz</a></p>
<p><map name='google_ad_map_284_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/284?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_284_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=284&amp;url= http%3A%2F%2Fwww.datanoia.com%2Ftwitter4j-libreria-java-para-la-api-de-twitter.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/twitter4j-libreria-java-para-la-api-de-twitter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Sitios Web para encontrar Ejemplos de Aplicaciones en Java</title>
		<link>http://www.datanoia.com/5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java</link>
		<comments>http://www.datanoia.com/5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java.html#comments</comments>
		<pubDate>Mon, 11 Jan 2010 04:14:52 +0000</pubDate>
		<dc:creator>aolinex</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.datanoia.com/?p=260</guid>
		<description><![CDATA[&#160; Cuando aprendemos a programar siempre buscamos diferentes recursos para poder aprender técnicas, herramientas, ejemplos, en Internet, es por eso que hoy compartiremos 5 sitios donde encontrarás bastantes ejemplos con código fuente de aplicaciones hechas en Java. Planet Source Code: &#160; &#160; &#160; &#160; &#160; Este sitio tiene una de las más largas colecciones de<a href="http://www.datanoia.com/5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252F5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%225%20Sitios%20Web%20para%20encontrar%20Ejemplos%20de%20Aplicaciones%20en%20Java%20%22%20%7D);"></div>
<p><img class="aligncenter" title="java cup" src="http://www.datanoia.com/wp-content/uploads/2010/01/java0.jpg" alt="java cup" width="201" height="201" /></p>
<p>&nbsp;</p>
<p style="text-align: justify;">Cuando aprendemos a programar siempre buscamos diferentes recursos para poder aprender técnicas, herramientas, ejemplos, en Internet, es por eso que hoy compartiremos 5 sitios donde encontrarás bastantes ejemplos con código fuente de aplicaciones hechas en Java.</p>
<h2><a href="http://www.planet-source-code.com/vb/default.asp?lngWId=2#categories" target="_blank">Planet Source Code:</a></h2>
<p>&nbsp;</p>
<p><img class="aligncenter" title="java1" src="http://www.datanoia.com/wp-content/uploads/2010/01/java11.png" alt="java1" width="145" height="97" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Este sitio tiene una de las más largas colecciones de aplicaciones Java. Encontrarás el código fuente de miles de aplicaciones Java, juegos, y utilidades. También hay categorías que incluyen seguridad, estructura de datos, y applets, entre otros.</p>
<p>Mientras te encuentres en el sitio, no dudes revisar su sección <a href="http://www.planet-source-code.com/vb/contest/AllTimeHallOfFame.asp?lngWId=2" target="_blank">Hall of Fame,</a> donde están las aplicaciones mejor programadas o mejor escritas, seleccionadas por los usuarios del sitio. También encontrarás aplicaciones según el tipo de nivel de dificultad.</p>
<h2><a href="http://www.freewarejava.com/" target="_blank">Freeware Java</a></h2>
<p>En este sitio encontrarás el código fuente de cientos de juegos y aplicaciones. Este sitio es ideal si estas buscando algún tipo de aplicación en alguna area en particular. En Freeware Java también encontrarás algunas ejemplos de Java applets donde hay código fuente para salas de chat, juegos, scripts para sitios web y más.</p>
<h2><a href="http://www.javagalaxy.com/" target="_blank">Java Galaxy</a></h2>
<p><img class="aligncenter" title="java2" src="http://www.datanoia.com/wp-content/uploads/2010/01/java2.jpg" alt="java2" width="110" height="49" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Este es otro sitio de recursos para satisfacer tus gustos de aprendizaje en Java. La característica de Java Galaxy respecto al resto de sitios, es que el código fuente de las aplicaciones que encuentres son más pequeños y simples. Si eres un nuevo programador en Java y buscas ejemplos sin mucha dificultad este sitio te va a interesar.</p>
<p>También encontrarás <a href="http://www.javagalaxy.com/jtest/" target="_blank">algunas prácticas</a> para medir tus conocimientos en Java (en inglés).</p>
<p>&nbsp;</p>
<h2><a href="http://www.java2s.com/" target="_blank">Java2s</a></h2>
<p>En este sitio aparte de encontrar ejemplos Java también encontrarás distintos tutoriales para aprender a programar con este lenguaje. También encontrarás ejemplos de otros lenguajes de programación como Csharp, PHP, Python,etc.</p>
<h2><a href="http://www.javadb.com/" target="_blank">Java DB</a></h2>
<p>&nbsp;</p>
<p><img class="aligncenter" title="javaDB" src="http://www.datanoia.com/wp-content/uploads/2010/01/javaDB.png" alt="javaDB" width="357" height="84" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>En Java DB encontrarás consejos y ejemplos para algún tema o resolver algún problema en especial. También encontrarás tutoriales de Java. Este sitio es ideal como para tener de guía si estás aprendiendo.</p>
<p>&nbsp;</p>
<p>Recuerda que nunca está demás ir de la mano con un libro. Si te incomoda que los sitios estén en inglés, te recomendaría que te pongas a estudiarlo pues estás en desventaja frente a muchos que conocen el idioma.</p>
<p>Fuente |<a href="http://www.makeuseof.com/tag/top-5-websites-for-java-application-examples/" target="_blank"> MakeUseOf</a></p>
<p><map name='google_ad_map_260_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/260?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_260_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=260&amp;url= http%3A%2F%2Fwww.datanoia.com%2F5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/5-sitios-web-para-encontrar-ejemplos-de-aplicaciones-en-java.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Instalar Java JDK, JRE en Ubuntu y configurar la variable de entorno JAVA_HOME</title>
		<link>http://www.datanoia.com/instalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=instalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home</link>
		<comments>http://www.datanoia.com/instalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 04:06:35 +0000</pubDate>
		<dc:creator>aolinex</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.datanoia.com/?p=189</guid>
		<description><![CDATA[Hay muchas maneras de instalar la plataforma Java en Ubuntu, la cual es necesaria tenerla instalada para realizar diversas tareas en nuestro sistema operativo y en la web (Java está en muchos lugares). Una de las maneras más sencillas de instalar es vía comandos desde el terminal. En éste post veremos como instalar Java JDK<a href="http://www.datanoia.com/instalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Finstalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Instalar%20Java%20JDK%2C%20JRE%20en%20Ubuntu%20y%20configurar%20la%20variable%20de%20entorno%20JAVA_HOME%22%20%7D);"></div>
<p><a href="http://www.java.com/" target="_blank"><img class="aligncenter" title="DukeWithHelmet" src="../wp-content/uploads/2009/09/DukeWithHelmet-150x150.png" alt="DukeWithHelmet" width="150" height="150" /></a></p>
<p style="text-align: justify;">Hay muchas maneras de instalar la plataforma Java en Ubuntu, la cual es necesaria tenerla instalada para realizar diversas tareas en nuestro sistema operativo y en la web (Java está en muchos lugares). Una de las maneras más sencillas de instalar es vía comandos desde el terminal.</p>
<p style="text-align: justify;">En éste post veremos como instalar Java <strong>JDK </strong>(Java Development Kit o Kit de desarrollo para Java), Java <strong>JRE</strong> (Java Runtime Environment o Entorno en tiempo de ejecución de Java) y como configurar la variable de entorno <strong>JAVA_HOME</strong>, necesaria para que Java funcione correctamente a la hora de compilar y ejecutar aplicaciones, hechas obviamente en Java.</p>
<ul style="text-align: justify;">
<li>Empezaremos instalando Java JDK y JRE desde el terminal (Aplicaciones → Accesorios→ Terminal), para eso ejecutamos el comando:</li>
</ul>
<blockquote>
<p style="text-align: justify;"><code>sudo aptitude install sun-java6-jdk sun-jav6-jre</code></p>
</blockquote>
<p>Tendremos que confirmar la instalación con la letra “s” o “y”, de sí o yes, respectivamente. Luego tendremos que aceptar las licencias, moviéndonos a través del contrato de licencia con las teclas ←,→,↓, PageUp, PageDown, y Enter para Aceptar. Recuerda que estamos usando el terminal.</p>
<ul>
<li>Después de instalar Java JDK y JRE, comprobaremos la instalación ejecutando en el terminal:</li>
</ul>
<blockquote><p><code>java -version</code></p></blockquote>
<p>Nos mostrará algo similar a:</p>
<p><img title="pentaho1" src="../wp-content/uploads/2009/09/pentaho1.png" alt="pentaho1" width="529" height="94" /></p>
<ul>
<li>Ahora configuraremos la variable de entorno JAVA_HOME, para eso abrimos el archivo /etc/profile desde el terminal, con algún editor de texto (si usas Kubuntu o no tienes instalado gedit, reemplaza gedit por kate o nano respectivamente):</li>
</ul>
<blockquote><p><code>sudo gedit /etc/profile</code></p></blockquote>
<p>Y en la parte final del archivo, agregamos las siguientes líneas:</p>
<blockquote><p><code>export JAVA_HOME=/usr/lib/jvm/java-6-sun<br />
export PATH=$PATH:$JAVA_HOME/bin</code></p></blockquote>
<ul>
<li>Guardamos y cerramos el archivo anterior. Reiniciamos el ordenador y revisamos si está correctamente establecido la variable de entorno con el comando:</li>
</ul>
<blockquote><p><code>echo $JAVA_HOME</code></p></blockquote>
<p>Nos debe mostrar algo similar a:</p>
<p><img title="pentaho2" src="../wp-content/uploads/2009/09/pentaho2.png" alt="pentaho2" width="341" height="34" /></p>
<ul>
<li>Y con eso ya tenemos instalado correctamente Java en Ubuntu. Para comprobar que todo esté correctamente instalado, podemos crear nuestra primera aplicación Hola Mundo:</li>
</ul>
<blockquote><p><code>gedit HolaMundo.java</code></p></blockquote>
<p>Copiamos y pegamos las siguientes líneas:</p>
<pre>public class HolaMundo{
public static void main(String[] args){
System.out.println("Hola Mundo! - http://datanoia.com");
}
}</pre>
<p>Guardamos y cerramos el archivo anterior. Compilamos y ejecutamos con el comando:</p>
<blockquote><p><code>javac HolaMundo.java; java HolaMundo</code></p></blockquote>
<p>Debemos obtener algo similar a:</p>
<p><img title="pentaho5" src="../wp-content/uploads/2009/09/pentaho5.png" alt="pentaho5" width="413" height="50" /></p>
<p>Via | <a href="http://www.mkyong.com/java/how-to-install-java-jdk-on-ubuntu-linux/" target="_blank">ProgrammerLife</a></p>
<p><map name='google_ad_map_189_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/189?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_189_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=189&amp;url= http%3A%2F%2Fwww.datanoia.com%2Finstalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/instalar-java-jdk-jre-en-ubuntu-y-configurar-la-variable-java_home.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clientes para MySQL</title>
		<link>http://www.datanoia.com/clientes-para-mysql.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clientes-para-mysql</link>
		<comments>http://www.datanoia.com/clientes-para-mysql.html#comments</comments>
		<pubDate>Wed, 16 Sep 2009 03:56:06 +0000</pubDate>
		<dc:creator>caezar</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.datanoia.com/?p=180</guid>
		<description><![CDATA[Mysql es un gestor de base de datos con bastante acogida y mucho uso en toda Internet, muchos de sus usuarios lo utilizan desde blogs, foros, portales, galerías, etc; además existen distintas aplicaciones web hechas en php y otros lenguajes que hacen uso de Mysql. Hay varias maneras de controlar, dar mantenimiento y hacer uso de<a href="http://www.datanoia.com/clientes-para-mysql.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Fclientes-para-mysql.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Clientes%20para%20MySQL%22%20%7D);"></div>
<p style="text-align: justify;">Mysql es un gestor de base de datos con bastante acogida y mucho uso en toda Internet, muchos de sus usuarios lo utilizan desde blogs, foros, portales, galerías, etc; además existen distintas aplicaciones web hechas en <strong>php y otros lenguajes </strong>que hacen uso de Mysql.</p>
<p style="text-align: justify;">Hay varias maneras de controlar, dar mantenimiento y hacer uso de Mysql a travez de los diversos programas cliente que podemos encontrar:</p>
<p><img class="aligncenter" title="adminer" src="../wp-content/uploads/2009/09/adminer.png" alt="adminer" width="372" height="77" /></p>
<p style="text-align: justify;"><strong>Adminer: </strong>Es un único archivo, que se ejecuta desde un servidor web con soporte para PHP, saca de apuros cuando se requiere un rápido acceso y no se cuenta con un cliente<br />
<a href="http://www.adminer.org/en/" target="_blank">http://www.adminer.org/en/</a></p>
<p><img class="aligncenter" title="logo_phpmyadmin" src="../wp-content/uploads/2009/09/logo_phpmyadmin.gif" alt="logo_phpmyadmin" width="200" height="180" /></p>
<p style="text-align: justify;">
<p style="text-align: justify;"><strong>PhpMyadmin:</strong> Cliente web, funciona dentro de un servidor que soporte PHP.<a href="http://www.phpmyadmin.net/home_page/downloads.php" target="_blank"></p>
<p>http://www.phpmyadmin.net/home_page/downloads.php</a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p><img class="aligncenter" title="mysql-gui-tools" src="../wp-content/uploads/2009/09/mysql-gui-tools.jpg" alt="mysql-gui-tools" width="150" height="115" /></p>
<p style="text-align: justify;"><strong>Mysql Administrator:</strong>Funciona como programa cliente de escritorio.<br />
<a href="http://dev.mysql.com/downloads/gui-tools/5.0.html" target="_blank">http://dev.mysql.com/downloads/gui-tools/5.0.html</a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
<p><img class="aligncenter" title="img3" src="../wp-content/uploads/2009/09/img3.jpg" alt="img3" width="459" height="280" /></p>
<p style="text-align: justify;"><strong>Navicat:</strong> <a href="http://www.navicat.com/en/products/navicat_mysql/mysql_overview.html" target="_blank">http://www.navicat.com/en/products/navicat_mysql/mysql_overview.html</a></p>
<p><map name='google_ad_map_180_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/180?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_180_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=180&amp;url= http%3A%2F%2Fwww.datanoia.com%2Fclientes-para-mysql.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/clientes-para-mysql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoogleMaps con Visual Studio 2008 (C#) – Parte 02</title>
		<link>http://www.datanoia.com/googlemaps-con-visual-studio-2008-c-%e2%80%93-parte-02.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=googlemaps-con-visual-studio-2008-c-%25e2%2580%2593-parte-02</link>
		<comments>http://www.datanoia.com/googlemaps-con-visual-studio-2008-c-%e2%80%93-parte-02.html#comments</comments>
		<pubDate>Sun, 13 Sep 2009 06:05:06 +0000</pubDate>
		<dc:creator>JoTa</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[Google Maps]]></category>

		<guid isPermaLink="false">http://fenix.aolinex.com/?p=101</guid>
		<description><![CDATA[Hola buenas noches, en esta segunda parte de googlemaps y visualstudio.net 2008(c#) vamos a mostrar como agregar un marcador de ubicación a nuestro mapa y también agregaremos una imagen a ese marcador. La Parte 01 la podemos ver en el sgt. link: “Parte 1“. Paso 01: Comenzamos creando el método “Marcador”, donde vamos poner a nuestro<a href="http://www.datanoia.com/googlemaps-con-visual-studio-2008-c-%e2%80%93-parte-02.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Fgooglemaps-con-visual-studio-2008-c-%2525e2%252580%252593-parte-02.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22GoogleMaps%20con%20Visual%20Studio%202008%20%28C%23%29%20%E2%80%93%20Parte%2002%22%20%7D);"></div>
<p style="text-align: justify;">Hola buenas noches, en esta segunda parte de googlemaps y visualstudio.net 2008(c#) vamos a mostrar como agregar un marcador de ubicación a nuestro mapa y también agregaremos una imagen a ese marcador. La Parte 01 la podemos ver en el sgt. link: “<a href="http://www.datanoia.com/googlemaps-con-visual-studio-2008-c-parte-01.html" target="_blank">Parte 1</a>“.</p>
<p style="text-align: justify;">Paso 01: Comenzamos creando el método “Marcador”, donde vamos poner a nuestro marcador en la coordenada:</p>
<div style="text-align: justify;">(-12.0876672627387, -77.0416259765625)</div>
<div style="text-align: justify;">mkrOpts.draggable: esta propiedad es para no poder mover el marcador.</div>
<div style="text-align: justify;">GmapPrueba.addGMarker(mkr): aquí estamos agregando el marcador a nuestro mapa en la coordenada indicada</div>
<p style="text-align: justify;"><img title="01" src="http://www.datanoia.com/wp-content/uploads/2009/09/011.jpg" alt="01" width="658" height="457" /></p>
<p style="text-align: justify;">Paso 02: Depuramos nuestra aplicación y vemos que se ha agregado un marcador a nuestra mapa, esa posición son las coordenadas que le hemos dado.</p>
<p style="text-align: justify;"><img title="02" src="http://www.datanoia.com/wp-content/uploads/2009/09/02.jpg" alt="02" width="412" height="585" /></p>
<p style="text-align: justify;">Paso 03: Ahora el siguiente paso es cuando demos click en nuestra marcador nos muestre una imagen, para ello creamos una carpeta a nuestra solución.</p>
<p style="text-align: justify;"><img title="03" src="http://www.datanoia.com/wp-content/uploads/2009/09/03.jpg" alt="03" width="414" height="376" /></p>
<p style="text-align: justify;">Paso 04: A esta carpeta que hemos creado le vamos a poner de nombre “Imagenes”</p>
<p style="text-align: justify;"><img title="04" src="http://www.datanoia.com/wp-content/uploads/2009/09/04.jpg" alt="04" width="256" height="189" /></p>
<p style="text-align: justify;">Paso 05: Ahora agregamos una imagen a esta carpeta que hemos creado, que sera la imagen que nos muestre al hacer click en el marcador</p>
<p style="text-align: justify;"><img title="05" src="http://www.datanoia.com/wp-content/uploads/2009/09/05.jpg" alt="05" width="252" height="205" /></p>
<p style="text-align: justify;">Paso 06: Vamos a agregar 3 lineas de código a nuestro método “Marcador”, creamos una variable string llamada “imagen”, en donde le vamos a dar la ruta de nuestra imagen que se encuentra en la carpeta “Imagenes”.</p>
<p style="text-align: justify;">GmapPrueba.Add: acá es donde vamos a darle la ruta de la imagen a nuestro marcador.</p>
<p style="text-align: justify;">GmapPrueba.addMarker: acá agregamos la imagen a las coordenadas del marcador.</p>
<div style="text-align: justify;"><img title="06" src="http://www.datanoia.com/wp-content/uploads/2009/09/061-1024x193.jpg" alt="06" width="655" height="123" /></div>
<p style="text-align: justify;">Paso 07: Depuramos nuestra solución</p>
<p style="text-align: justify;"><img title="07" src="http://www.datanoia.com/wp-content/uploads/2009/09/071.jpg" alt="07" width="393" height="576" /></p>
<p style="text-align: justify;">Paso 08: Ahora damos click en nuestro marcador y nos mostrara la imagen de la ruta que le hemos dado.</p>
<p style="text-align: justify;"><img title="08" src="http://www.datanoia.com/wp-content/uploads/2009/09/08.jpg" alt="08" width="381" height="571" /></p>
<p style="text-align: justify;">Gracias y Saludos.</p>
<p style="text-align: justify;"><strong>Descargar programa fuente:</strong> <a href="http://www.datanoia.com/foro/index.php?action=dlattach;topic=10.0;attach=1" target="_blank">GoogleMaps Para C#</a></p>
<p><map name='google_ad_map_101_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/101?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_101_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=101&amp;url= http%3A%2F%2Fwww.datanoia.com%2Fgooglemaps-con-visual-studio-2008-c-%25e2%2580%2593-parte-02.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/googlemaps-con-visual-studio-2008-c-%e2%80%93-parte-02.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crystal Report: Reporte Maestro / Detalle</title>
		<link>http://www.datanoia.com/crystal-report-reporte-maestro-detalle.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=crystal-report-reporte-maestro-detalle</link>
		<comments>http://www.datanoia.com/crystal-report-reporte-maestro-detalle.html#comments</comments>
		<pubDate>Mon, 07 Sep 2009 05:29:44 +0000</pubDate>
		<dc:creator>risharp</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[reportes]]></category>

		<guid isPermaLink="false">http://fenix.aolinex.com/?p=62</guid>
		<description><![CDATA[Explicaremos como crear un reporte Web en Crystal Report de tipo Master/Detail o Cabecera/Detalle.  En este ejemplo tendremos en la cabecera una Orden de Compra con  datos, como:  Número de Orden,  fecha en que fue realizada,  cliente, medio de envío;  y  en el Detalle tendremos los productos  que fueron pedidos en la Orden de Compra,<a href="http://www.datanoia.com/crystal-report-reporte-maestro-detalle.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Fcrystal-report-reporte-maestro-detalle.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Crystal%20Report%3A%20Reporte%20Maestro%20%2F%20Detalle%22%20%7D);"></div>
<p style="text-align: justify;">Explicaremos como crear un reporte Web en Crystal Report de tipo Master/Detail o Cabecera/Detalle.  En este ejemplo tendremos en la cabecera una<strong> Orden de Compra</strong> con  datos, como:  Número de Orden,  fecha en que fue realizada,  cliente, medio de envío;  y  en el <strong>Detalle</strong> tendremos los productos  que fueron pedidos en la Orden de Compra, así como su precio respectivo.</p>
<p style="text-align: justify;">Necesitaremos la base de datos Northwind y Visual Studio 2005 ó 2008.</p>
<p style="text-align: justify;"><strong>Paso 1.- </strong> En SQL SERVER ejecutar el siguiente código:</p>
<pre>USE NORTHWIND;

GO

CREATE PROC OrdenMaestro

@OrderID INT

AS

SELECT Orders.OrderID, Customers.ContactName, Customers.Address, Customers.City,

CONVERT(NVARCHAR(12),Orders.OrderDate,103)AS Date, Shippers.CompanyName,

(Employees.LastName+', '+Employees.FirstName)AS FullName, CONVERT(NVARCHAR(12),Orders.RequiredDate,103)AS [Fecha Requerida]

FROM Orders INNER JOIN Employees on Orders.EmployeeID = Employees.EmployeeID INNER JOIN Customers ON

Customers.CustomerID = Orders.CustomerID INNER JOIN Shippers ON Shippers.ShipperID = Orders.ShipVia

WHERE Orders.OrderID= @OrderID

CREATE PROC OrdenMaestro

@OrderID INT

AS

SELECT Orders.OrderID, Customers.ContactName, Customers.Address, Customers.City,

CONVERT(NVARCHAR(12),Orders.OrderDate,103)AS Date, Shippers.CompanyName

(Employees.LastName+', '+Employees.FirstName)AS FullName,

CONVERT(NVARCHAR(12),Orders.RequiredDate,103)AS [Fecha Requerida]

FROM Orders INNER JOIN Employees on Orders.EmployeeID = Employees.EmployeeID INNER JOIN Customers ON

Customers.CustomerID = Orders.CustomerID INNER JOIN Shippers ON Shippers.ShipperID = Orders.ShipVia

WHERE Orders.OrderID= @OrderID</pre>
<p style="text-align: justify;">Lo que hace el código SQL anterior es crear un<strong> <em>Store Procedure</em></strong> que recibirá  un número de orden determinado (parámetro de entrada)  para  así ver los datos de dicha orden.</p>
<p style="text-align: justify;">
<p style="text-align: justify;">Ahora el siguiente código  crea un<em> Store Procedure </em>que mostrará los productos que fueron solicitados en la Orden.</p>
<pre>USE NORTHWIND;

GO

CREATE PROC OrdenDetalle

AS

SELECT [Order Details].OrderID, Products.ProductName,Total=ROUND(([order details].UnitPrice*[order details].Quantity)-([order details].UnitPrice*[order details].Quantity)*[order details].Discount,2)

,[Order Details].Quantity,[Order Details].Discount

FROM [Order Details] INNER JOIN Products ON [Order Details].ProductID = Products.ProductID</pre>
<p style="text-align: justify;"><strong>Paso 2.- </strong>Bien una vez creados los dos procedimientos almacenados, vamos al Visual Studio, y creamos un nuevo sitio Web.</p>
<p style="text-align: justify;">Agregaremos un <em>clase</em> llamada “Conexion”:</p>
<div><a href="http://www.datanoia.com/wp-content/uploads/2009/09/13.PNG" target="_blank"><img class="aligncenter" title="1" src="http://www.datanoia.com/wp-content/uploads/2009/09/13.PNG" alt="Haz clic para agrandar" width="217" height="420" /></a>Haz clic para agrandar</div>
<p style="text-align: justify;">Hacemos clic en “SI” cuando nos salga el siguiente mensaje:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/Pregunta.PNG" target="_blank"><img title="Pregunta" src="http://www.datanoia.com/wp-content/uploads/2009/09/Pregunta.PNG" alt="Pregunta" width="609" height="124" /></a></p>
<p style="text-align: justify;">En la clase Conexion.cs agregaremos el siguiente código:</p>
<pre>public class Conexion

{

private string servidor = "NOMBREDETUSERVIDORSQL";

private string basededatos = "Northwind";

private string usuario = "TUUSUARIO";

private string password = "";

public string Usuario

{

get { return usuario; }

set { usuario = value; }

}

public string Password

{

get { return password; }

set { password = value; }

}

public string Basededatos

{

get { return basededatos; }

set { basededatos = value; }

}

public string Servidor

{

get { return servidor; }

set { servidor = value; }

}

}</pre>
<div style="text-align: justify;"><strong>Paso 3.-</strong> Agregamos un documento “CrystalReport” lo llamamos <strong>OrdenReporte.rpt</strong><a href="http://www.datanoia.com/wp-content/uploads/2009/09/ReporteCrear.PNG" target="_blank"><img title="ReporteCrear" src="http://www.datanoia.com/wp-content/uploads/2009/09/ReporteCrear.PNG" alt="ReporteCrear" width="678" height="455" /></a></div>
<div style="text-align: justify;"><strong>Paso 4.- </strong>Nos aparecerá la siguiente pantalla, aceptamos:</div>
<div style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/Galeria.PNG" target="_blank"><img title="Galeria" src="http://www.datanoia.com/wp-content/uploads/2009/09/Galeria.PNG" alt="Galeria" width="362" height="440" /></a></div>
<p style="text-align: justify;"><strong>Paso 5.-</strong> Expandimos hasta OLEDB.</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/OLEDB.PNG" target="_blank"><img title="OLEDB" src="http://www.datanoia.com/wp-content/uploads/2009/09/OLEDB.PNG" alt="OLEDB" width="283" height="305" /></a>Paso 6.- Se abrirá la siguiente pantalla:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/native.PNG" target="_blank"><img title="native" src="http://www.datanoia.com/wp-content/uploads/2009/09/native.PNG" alt="native" width="454" height="472" /></a></p>
<p style="text-align: justify;">Paso 7.- Damos la información de nuestra conexión y damos clic en finalizar.<a href="http://www.datanoia.com/wp-content/uploads/2009/09/Servidor.PNG" target="_blank"><img title="Servidor" src="http://www.datanoia.com/wp-content/uploads/2009/09/Servidor.PNG" alt="Servidor" width="451" height="469" /></a><strong>Paso 8.- </strong>Ahora buscamos nuestro Store Procedure “OrdenMaestro” y lo ponemos en la derecha, al hacer esto nos aparecerá una ventana para darle un valor al parámetro, damos clic en aceptar y luego siguiente:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/store.PNG" target="_blank"><img title="store" src="http://www.datanoia.com/wp-content/uploads/2009/09/store.PNG" alt="store" width="641" height="593" /></a></p>
<p style="text-align: justify;"><strong>Paso 9.-</strong> Pasamos todos los campos que queremos que se muestren, en este caso pasaré todos, luego presionamos finalizar.</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/store21.PNG" target="_blank"><img title="store2" src="http://www.datanoia.com/wp-content/uploads/2009/09/store21.PNG" alt="store2" width="637" height="564" /></a></p>
<p style="text-align: justify;">Bien se creará el reporte:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/reporteOrden.PNG" target="_blank"><img title="reporteOrden" src="http://www.datanoia.com/wp-content/uploads/2009/09/reporteOrden.PNG" alt="reporteOrden" width="789" height="298" /></a></p>
<p style="text-align: justify;"><strong>Paso 10.</strong>-  Alargamos el espacio de “Detalles” y hacemos clic derecho y agregamos un Subinforme</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/sub.PNG" target="_blank"><img title="sub" src="http://www.datanoia.com/wp-content/uploads/2009/09/sub.PNG" alt="sub" width="857" height="519" /></a></p>
<p style="text-align: justify;">Paso 11.- Cuando agreguemos el Subinforme se abrirá la siguiente ventana, agregamos un nombre y hacemos clic en: “Asistente de Informes”:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/SubDetalle.PNG" target="_blank"><img title="SubDetalle" src="http://www.datanoia.com/wp-content/uploads/2009/09/SubDetalle.PNG" alt="SubDetalle" width="513" height="383" /></a></p>
<p style="text-align: justify;">Paso 12.-  Se abrirá una nueva ventana, en ésta buscaremos nuestro segundo Store Procedure llamado: “OrdenDetalle”:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/derecha.PNG" target="_blank"><img title="derecha" src="http://www.datanoia.com/wp-content/uploads/2009/09/derecha.PNG" alt="derecha" width="641" height="579" /></a>Paso 13.- En el siguiente paso arrastramos a la derecha los campos que, queremos que se muestren y ponemos finalizar:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/derechaerecha.PNG" target="_blank"><img title="derechaerecha" src="http://www.datanoia.com/wp-content/uploads/2009/09/derechaerecha.PNG" alt="derechaerecha" width="642" height="586" /></a>Paso 14. Hacemos clic en ACEPTAR y el SubInforme se agregará a nuestro reporte principal:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/Subinform2.PNG" target="_blank"><img title="Subinform2" src="http://www.datanoia.com/wp-content/uploads/2009/09/Subinform2.PNG" alt="Subinform2" width="513" height="383" /></a>Paso 15.-<strong> Bien ahora tenemos que hacer algo muy importante:</strong></p>
<p style="text-align: justify;"><strong>Tenemos que enlazar los dos reportes, deben tener claro que cada uno de los Store Procedure tienen relación; es decir, la cabecera poseé un campo llamado OrdenID y el segundo Store Procedure también poseé dicho campo; necesitamos esto para mostrar los datos de la Orden y en el detalle tienen que mostrarse solamente los detalles de dicha orden. Entonces vamos a enlazar los reportes de la siguiente manera:</strong></p>
<ul style="text-align: justify;">
<li><strong>Hagamos clic Derecho en el SubReport, y seleccionamos “Cambiar vínculos del subinforme”.</strong></li>
</ul>
<p style="text-align: justify;"><strong><a href="http://www.datanoia.com/wp-content/uploads/2009/09/enlace1.PNG" target="_blank"><img title="enlace1" src="http://www.datanoia.com/wp-content/uploads/2009/09/enlace1.PNG" alt="enlace1" width="815" height="498" /></a></strong></p>
<ul style="text-align: justify;">
<li>Ahora buscamos el campo OrdenID de nuestro reporte principal y hacemos clic en el botón “&gt;”, ponemos aceptar.</li>
</ul>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/enlace5.PNG" target="_blank"><img title="enlace5" src="http://www.datanoia.com/wp-content/uploads/2009/09/enlace5.PNG" alt="enlace5" width="494" height="343" /></a></p>
<p style="text-align: justify;"><strong>Paso 16.-</strong> Agregaremos un componente CrystalReportViewer, un label, textbox y un botón:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/botones.PNG" target="_blank"><img title="botones" src="http://www.datanoia.com/wp-content/uploads/2009/09/botones.PNG" alt="botones" width="611" height="514" /></a></p>
<p style="text-align: justify;"><strong>Paso 17.-</strong> Hagamos doble clic en el botón y agreguemos el siguiente código:</p>
<pre>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;

//Referencias

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

using CrystalDecisions.ReportSource;

public partial class _Default : System.Web.UI.Page

{

ParameterDiscreteValue OrdenIDDV = new ParameterDiscreteValue(); //parametro de entrada

Conexion con = new Conexion();

ReportDocument Report = new ReportDocument();

protected void Page_Load(object sender, EventArgs e)

{

}

protected void Button1_Click(object sender, EventArgs e)

{

string reportPath = Server.MapPath("OrdenReporte.rpt");

Report.Load(reportPath);

Report.DataSourceConnections[0].SetConnection(con.Servidor, con.Basededatos, con.Usuario, con.Password);

int OrdenID = int.Parse(TextBox1.Text);

OrdenIDDV.Value = OrdenID;

Report.SetParameterValue("@OrderID", OrdenIDDV);

CrystalReportViewer1.ReportSource = Report;

}

protected void Button1_Unload(object sender, EventArgs e)

{

Report.Dispose();

CrystalReportViewer1.Dispose();

}</pre>
<p style="text-align: justify;">Corremos la página:</p>
<div style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/ReporteFinal.PNG" target="_blank"><img title="ReporteFinal" src="http://www.datanoia.com/wp-content/uploads/2009/09/ReporteFinal.PNG" alt="Haga clic para maximizar" width="646" height="462" /></a>Haga clic para maximizar</div>
<p style="text-align: justify;">Espero les sea útil les dejo el <a title="Proyecto" href="http://www.datanoia.com/?attachment_id=1303" target="_blank">Proyecto</a>.</p>
<p style="text-align: justify;">Buen Día.</p>
<p><map name='google_ad_map_62_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/62?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_62_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=62&amp;url= http%3A%2F%2Fwww.datanoia.com%2Fcrystal-report-reporte-maestro-detalle.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/crystal-report-reporte-maestro-detalle.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Consumir Servicio Web desde Netbeans</title>
		<link>http://www.datanoia.com/consumir-servicio-web-desde-netbeans.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=consumir-servicio-web-desde-netbeans</link>
		<comments>http://www.datanoia.com/consumir-servicio-web-desde-netbeans.html#comments</comments>
		<pubDate>Thu, 03 Sep 2009 05:14:04 +0000</pubDate>
		<dc:creator>risharp</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://fenix.aolinex.com/?p=37</guid>
		<description><![CDATA[Una tecnología muy usada desde hace ya varios años son los Servicios Web. Explicaremos como consumir un Servicio Web escrito en C# desde una aplicación web en Netbeans en Java. En Visual Studio: Paso 1.- Nos vamos a Archivo &#62; Nuevo &#62; Sitio Web y elegimos Servicio Web ASP.NET, damos clic en “Examinar” y nos<a href="http://www.datanoia.com/consumir-servicio-web-desde-netbeans.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Fconsumir-servicio-web-desde-netbeans.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Consumir%20Servicio%20Web%20desde%20Netbeans%22%20%7D);"></div>
<p style="text-align: justify;">Una tecnología muy usada desde hace ya varios años son los Servicios Web. Explicaremos como consumir un Servicio Web escrito en C# desde una aplicación web en Netbeans en Java.</p>
<p style="text-align: justify;">En Visual Studio:</p>
<p style="text-align: justify;"><strong>Paso 1.- </strong>Nos vamos a Archivo &gt; Nuevo &gt; Sitio Web y elegimos Servicio Web ASP.NET, damos clic en “Examinar” y nos aparecerá la siguiente pantalla.</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/iis.PNG" target="_blank"><img title="iis" src="http://www.datanoia.com/wp-content/uploads/2009/09/iis-300x223.PNG" alt="iis" width="300" height="223" /></a></p>
<p style="text-align: justify;"><strong>Paso 2.- </strong>Hacer clic en “Crear nueva  Aplicación Web” (es el primer ícono de la parte superior derecha), luego hacer clic en “Abrir”  y aceptamos.</p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1052" rel="attachment wp-att-1052" target="_blank"><img title="vercodigo" src="http://www.datanoia.com/wp-content/uploads/2009/09/vercodigo.PNG" alt="vercodigo" width="284" height="493" /></a><strong> </strong></p>
<p style="text-align: justify;"><strong>Paso 3.-</strong> Agregamos el siguiente código:</p>
<pre>[WebMethod]

public string MetodoWS() {

return "Hola ASP.NET me estás consumiendo";

}</pre>
<div style="text-align: justify;">[WebMethod]</div>
<div style="text-align: justify;">public string MetodoWS() {</div>
<div style="text-align: justify;">return “Hola ASP.NET me estás consumiendo”;</div>
<div style="text-align: justify;">}</div>
<p style="text-align: justify;">Y presionamos F5, se creará un archivo de configuración “web.config”.</p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1061" rel="attachment wp-att-1061" target="_blank"><img title="webconfig" src="http://www.datanoia.com/wp-content/uploads/2009/09/webconfig1.PNG" alt="webconfig" width="482" height="225" /></a></p>
<p style="text-align: justify;"><strong>Paso 4.</strong>- Generamos y publicamos nuestro WebService:</p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1054" rel="attachment wp-att-1054" target="_blank"><img title="1" src="http://www.datanoia.com/wp-content/uploads/2009/09/1.PNG" alt="1" width="220" height="475" /></a></p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1055" rel="attachment wp-att-1055" target="_blank"><img title="2" src="http://www.datanoia.com/wp-content/uploads/2009/09/2.PNG" alt="2" width="219" height="476" /></a></p>
<p style="text-align: justify;">.</p>
<p style="text-align: justify;"><strong>Paso 5.-</strong> Nos mostrará la siguiente pantalla, vamos clic en “Aceptar”.</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/3.PNG" target="_blank"><img title="3" src="http://www.datanoia.com/wp-content/uploads/2009/09/3-300x200.PNG" alt="3" width="300" height="200" /></a></p>
<p style="text-align: justify;">.</p>
<p style="text-align: justify;">Y probamos:</p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1059" rel="attachment wp-att-1059" target="_blank"><img title="4" src="http://www.datanoia.com/wp-content/uploads/2009/09/4.PNG" alt="4" width="204" height="304" /></a></p>
<p style="text-align: justify;"><strong>Paso 6.</strong>- Se abrirá la página del web service, ahora hacemos clic en <strong>“Descripción del servicio” y copiamos la dirección que aparecerá en la URL en mi caso es:</strong></p>
<p style="text-align: justify;"><strong>“<a href="http://localhost/WebService1/Service.asmx?WSDL" target="_blank">http://localhost/WebService1/Service.asmx?WSDL</a>“ que viene a ser un archivo XML. </strong></p>
<div style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/ws.PNG" target="_blank"><img title="ws" src="http://www.datanoia.com/wp-content/uploads/2009/09/ws-300x214.PNG" alt="ws" width="300" height="214" /></a>(Click para agrandar la imagen)</div>
<p style="text-align: justify;">.</p>
<p style="text-align: justify;"><strong>Paso 7.-</strong> En Netbeans crearemos un proyecto Web, Archivo&gt;New Project&gt; Java WebApplication</p>
<div style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/nb.PNG" target="_blank"><img title="nb" src="http://www.datanoia.com/wp-content/uploads/2009/09/nb.PNG" alt="nb" width="546" height="491" /></a>Click para agrandar la imagen</div>
<p style="text-align: justify;"><strong>Paso 8.-</strong> Vamos a WebPages y agregaremos un <strong>“Web Service Client”</strong> si no lo encuentran vayan a “others”, copiamos la dirección de hace un momento en WSDL, finalizamos.</p>
<p style="text-align: justify;"><strong><a href="http://fenix.aolinex.com/?attachment_id=1067" rel="attachment wp-att-1067" target="_blank"><img title="client2" src="http://www.datanoia.com/wp-content/uploads/2009/09/client2.PNG" alt="client2" width="513" height="391" /></a><br />
</strong></p>
<p style="text-align: justify;"><strong><br />
</strong></p>
<p style="text-align: justify;"><strong>Paso 9.-</strong> Ahora en nuestra página JSP en algún lugar en blanco hacer clic derecho y seleccionar:  Web Services Client Resources &gt; Call Web Service Operation</p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1068" rel="attachment wp-att-1068" target="_blank"><img title="wsclientRe" src="http://www.datanoia.com/wp-content/uploads/2009/09/wsclientRe.PNG" alt="wsclientRe" width="607" height="419" /></a></p>
<p style="text-align: justify;">Seleccionamos, el primero:</p>
<p style="text-align: justify;"><a href="http://fenix.aolinex.com/?attachment_id=1069" rel="attachment wp-att-1069" target="_blank"><img title="operation" src="http://www.datanoia.com/wp-content/uploads/2009/09/operation.PNG" alt="operation" width="423" height="509" /></a></p>
<p style="text-align: justify;"><strong>Paso 10.-</strong> Se creará automaticamente código para poder hacer llamada a los métodos del WebService a consumirse.</p>
<pre>&lt;%-- start web service invocation --%&gt;&lt;hr/&gt;

&lt;%

try {

&lt;span style="white-space:pre"&gt; &lt;/span&gt;org.tempuri.Service service = new org.tempuri.Service();

org.tempuri.ServiceSoap port = service.getServiceSoap();

// TODO process result here

java.lang.String result = port.metodoWS();

out.println("Result = "+result);

} catch (Exception ex) {

// TODO handle custom exceptions here

}

%&gt;

&lt;%-- end web service invocation --%&gt;&lt;hr/&gt;</pre>
<p style="text-align: justify;">Modificaremos un poco el código para mostrar el resultado en una etiqueta HTML.</p>
<pre>&lt;body&gt;

&lt;%-- start web service invocation --%&gt;&lt;hr/&gt;

&lt;%

String resultado="";

try {

org.tempuri.Service service = new org.tempuri.Service();

org.tempuri.ServiceSoap port = service.getServiceSoap();

// TODO process result here

java.lang.String result = port.metodoWS();

resultado = result;

} catch (Exception ex) {

// TODO handle custom exceptions here

}

%&gt;

&lt;%-- end web service invocation --%&gt;&lt;hr/&gt;

&lt;p&gt;&lt;%=resultado%&gt;&lt;/p&gt;

&lt;/body&gt;</pre>
<p style="text-align: justify;">Corremos nuestra página JSP:</p>
<p style="text-align: justify;"><a href="http://www.datanoia.com/wp-content/uploads/2009/09/WSWS.PNG" target="_blank"><img title="WSWS" src="http://www.datanoia.com/wp-content/uploads/2009/09/WSWS.PNG" alt="WSWS" width="583" height="281" /></a></p>
<p style="text-align: justify;">Espero les sirva de ayuda. Buen Día.</p>
<p><map name='google_ad_map_37_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/37?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_37_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=37&amp;url= http%3A%2F%2Fwww.datanoia.com%2Fconsumir-servicio-web-desde-netbeans.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/consumir-servicio-web-desde-netbeans.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GoogleMaps con Visual Studio 2008 (C#) – Parte 01</title>
		<link>http://www.datanoia.com/googlemaps-cparte-01.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=googlemaps-cparte-01</link>
		<comments>http://www.datanoia.com/googlemaps-cparte-01.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 00:00:00 +0000</pubDate>
		<dc:creator>JoTa</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[Google Maps]]></category>

		<guid isPermaLink="false">http://fenix.aolinex.com/?p=10</guid>
		<description><![CDATA[Como ustedes saben Google tiene entre sus servicios gratiutos a Google Maps una poderosa aplicación que muestra imagenes de mapas satelitales de cualquier parte del mundo. Explicaremos como incrustar un mapa de Google Maps en una página web aspx. Paso 1.- Comenzamos agregando un nuevo tab donde pondremos el .dll de GoogleMaps Agregamos un nuevo tab Paso 2.-<a href="http://www.datanoia.com/googlemaps-cparte-01.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Fgooglemaps-cparte-01.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22GoogleMaps%20con%20Visual%20Studio%202008%20%28C%23%29%20%E2%80%93%20Parte%2001%22%20%7D);"></div>
<p>Como ustedes saben <strong>Google</strong> tiene entre sus servicios gratiutos a Google Maps una poderosa aplicación que muestra imagenes de mapas satelitales de cualquier parte del mundo. Explicaremos como incrustar un mapa de Google Maps en una página web aspx.</p>
<p><strong>Paso 1.- </strong> Comenzamos agregando un nuevo tab donde pondremos el <a href="http://www.datanoia.com/wp-content/uploads/2009/09/Archivos/GMaps.dll" target="_blank">.dll de GoogleMaps</a></p>
<div><img title="01" src="http://www.datanoia.com/wp-content/uploads/2009/08/014.jpg" alt="01" width="299" height="265" />Agregamos un nuevo tab</div>
<p><strong>Paso 2.-</strong> Damos click derecho y seleccionamos “choose items” para agregar el dll de GoogleMaps, lo buscamos y lo agregamos.Vamos a gregar el dll de googlemaps a nuestro nuevo tab</p>
<div><a href="http://www.datanoia.com/wp-content/uploads/2009/08/042.jpg" target="_blank"><img title="04" src="http://www.datanoia.com/wp-content/uploads/2009/08/042.jpg" alt="04" width="474" height="379" /></a>Buscamos nuestro dll, lo seleccionamos ypresionamos en el boton &#8220;Open&#8221;</div>
<p>&nbsp;</p>
<div><img title="05" src="http://www.datanoia.com/wp-content/uploads/2009/08/052.jpg" alt="05" width="192" height="235" />Se agregaron los controles de googlemaps a nuestro tab</div>
<p><strong>Paso 3.-</strong> Para este primer ejemplo, vamos a usar el control GMap, lo arrastramos hasta nuestra pantalla…</p>
<p>&nbsp;</p>
<div><a href="http://www.datanoia.com/wp-content/uploads/2009/08/061.jpg" target="_blank"><img title="06" src="http://www.datanoia.com/wp-content/uploads/2009/08/061.jpg" alt="06" width="569" height="320" /></a>Arrastramos el control &#8220;Gmap&#8221; hacia nuestra pantalla para nuestro ejemplo</div>
<p><strong>Paso 4.-</strong> Corremos la aplicacion y vemos que nos muestra un error, esto ocurre porque no tenemos una “Key”.</p>
<div><img title="07" src="http://www.datanoia.com/wp-content/uploads/2009/08/07-1024x321.jpg" alt="07" width="607" height="179" />Este error nos aparece, ya que no tenemos una key de googlemaps, lo que haremos ahora es obtener una key.</div>
<p>Ingresamos a esta web para obtener nuestra Key “<a href="http://code.google.com/intl/es/apis/maps/signup.html" target="_blank">http://code.google.com/intl/es/apis/maps/signup.html</a>“, copiamos la direccion que esta en el cuadro rojo.</p>
<p><strong>Paso 05.-</strong> Cuando estemos en la web mencionada, en la parte de abajo hay un recuadro para ingresar una url, ahi colocamos la direccion que copiamos y damos click en el botón “Generar clave de API”</p>
<div><img title="08" src="http://www.datanoia.com/wp-content/uploads/2009/08/08.jpg" alt="08" width="607" height="183" />En esta pagina obtendremos nuestra key, pero para ello, debemos tener una cuenta gmail, ya que ahi, nos enviara la key</div>
<p><strong>Paso 06.-</strong> Nos aparece la pagina de gmail para loguearnos, lo hacemos y luego nos obtendremos la key que necesitamos.</p>
<p><img title="09" src="http://www.datanoia.com/wp-content/uploads/2009/08/09.jpg" alt="09" width="611" height="260" /></p>
<p><strong>Paso 7.-</strong> Ingresamos al webconfig de nuestra aplicacion para colocar nuestra key (la obtenida en el paso anterior), debemos ponerla en el “appSettings” de esta forma:</p>
<pre>&lt;appSettings&gt;
&lt;add key="googlemaps.subgurim.net" value="ABQIAAAA89923VOr7Zlagkq6PzSl1hTFz8_PmpUdau86ETNxVP9oKgr3JRQiGtvIqP8-E_e3PvJF1lwKB0frew"/&gt;
&lt;/appSettings&gt;</pre>
<div><img title="10" src="http://www.datanoia.com/wp-content/uploads/2009/08/10-1024x588.jpg" alt="10" width="597" height="293" />En el webconfig dentro del appSettings colocaremos la key que nos han enviado.</div>
<p><strong>Paso 8.-</strong> Corremos nuestra aplicación y nos mostrará la region de España por defecto</p>
<div><img title="11" src="http://www.datanoia.com/wp-content/uploads/2009/08/11.jpg" alt="11" width="599" height="339" />Nos muestra en el control gmap la region de Espana</div>
<p><strong>Paso 9.-</strong> Como yo me ubico en estos momentos en Lima, deseo que aparezca dicha provincia por defecto. Por tal motivo debemos crear un método que lo llamaremos “MostrarLima” y lo pondremos en el Load() de nuestra página. No olvidar agregar “using Subgurim.Controles” para poder usar los métodos de googlemaps. Tal como muestra la siguiente imagen:</p>
<p><img title="12" src="http://www.datanoia.com/wp-content/uploads/2009/08/12-1024x589.jpg" alt="12" width="617" height="352" /></p>
<div>Éste es el código de la clase Default.aspx.cs:</div>
<div>
<pre>using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Subgurim.Controles;

namespace SolicionGoogleMaps
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
MostrarLima();
}
}

public void MostrarLima()
{
GMapPrueba.Height = 600;
GMapPrueba.Width = 400;
GMapPrueba.setCenter(new GLatLng(-12.0876672627387, -77.0416259765625), 12);
GMapPrueba.enableHookMouseWheelToZoom = true;
GMapPrueba.enableGKeyboardHandler = true;
}
}
}</pre>
</div>
<div>Como observamos, GMapPrueba.Height = 600 quiere decir 600 píxeles de altura para el control GMapPrueba,  y GMapPrueba.Width = 400 de ancho quiere decir lo mismo, pero de ancho. Con GMapPrueba.enableHookMouseWheelToZoom = true , aparecerá un scroll con el cual podremos acercarnos y alejarnos de la imagen.</div>
<div>.</div>
<div><strong>Paso 10.-</strong> Corremos nuestra aplicación y nos mostrará la provincia de Lima por defecto como ven en la imagen:</div>
<div>.</div>
<p><img title="13" src="http://www.datanoia.com/wp-content/uploads/2009/08/13.jpg" alt="13" width="721" height="624" /></p>
<p>Espero sirva de ayuda este ejemplo. Buen Día.</p>
<p><strong>Enlaces de Interés:</strong></p>
<p><a href="http://www.datanoia.com/wp-content/uploads/2009/09/Archivos/GMaps.dll" target="_blank">Dll Google Maps</a> | <a href="http://www.datanoia.com/wp-content/uploads/2009/09/Archivos/SolicionGoogleMaps.rar" target="_blank">Solucion del Proyecto en C#</a></p>
<p><map name='google_ad_map_10_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/10?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_10_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=10&amp;url= http%3A%2F%2Fwww.datanoia.com%2Fgooglemaps-cparte-01.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/googlemaps-cparte-01.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reportes con Crystal Report en Windows Form y parámetros StoreProcedure</title>
		<link>http://www.datanoia.com/reportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=reportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure</link>
		<comments>http://www.datanoia.com/reportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure.html#comments</comments>
		<pubDate>Sat, 22 Aug 2009 06:22:32 +0000</pubDate>
		<dc:creator>caezar</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[Crystal Report]]></category>
		<category><![CDATA[reportes]]></category>
		<category><![CDATA[StoreProcedure]]></category>
		<category><![CDATA[Windows Form]]></category>

		<guid isPermaLink="false">http://www.datanoia.com/?p=166</guid>
		<description><![CDATA[Existen varias formas de crear reportes en Crystal Report, una en particular que me parece tiene una alta mantenibilidad es la de crear código dinamico, es decir parámetros, conexiones, que puedan ser cambiados directamente en el código de nuestras clases. Explicaré a usar el asistente para crear reportes rapidamente y luego a modificar el código<a href="http://www.datanoia.com/reportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Freportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure.html%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FsmYg1U%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Reportes%20con%20Crystal%20Report%20en%20Windows%20Form%20y%20par%C3%A1metros%20StoreProcedure%22%20%7D);"></div>
<p style="text-align: justify;">Existen varias formas de crear reportes en Crystal Report, una en particular que me parece tiene una alta mantenibilidad es la de crear código dinamico, es decir parámetros, conexiones,  que puedan ser cambiados directamente en el código de nuestras clases.</p>
<p style="text-align: justify;">Explicaré a usar el asistente para crear reportes rapidamente y luego a modificar el código para que sea todo dinámico.</p>
<p style="text-align: justify;">Bien a programar:</p>
<p style="text-align: justify;">Necesitará la base de datos Northwind de SQL Server 2005 si es que desea probar el tutorial.</p>
<p style="text-align: justify;"><strong>Paso 1.- </strong>Primero crearemos un procedimiento almacedado con parámetros de entrada en SQL Server para luego mostrarlo en un reporte. Abra el SQL Server 2005 y en la base de datos Northwind ejecute el siguiente código:</p>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">USE NORTHWIND;</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">GO</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">CREATE PROC ObtenerTotalMesYear</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">@Fecha nvarchar(10)</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">AS</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">SELECT Mes=DateName( month , DateAdd( month ,CAST(SUBSTRING(CONVERT(NVARCHAR(10),OrderDate,111),6,2) AS INT) , 0 ) &#8211; 1 ),</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">Total=ROUND(SUM(([order details].UnitPrice*[order details].Quantity)-([order details].UnitPrice*[order details].Quantity)*[order details].Discount),2)</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">FROM [order details] INNER JOIN Orders on [order details].OrderID = Orders.OrderID</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">WHERE DATENAME(yy,Orders.OrderDate) =@Fecha</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">GROUP BY SUBSTRING(CONVERT(NVARCHAR(10),Orders.OrderDate,111),6,2)</div>
<div id="_mcePaste" style="position: absolute; overflow-x: hidden; overflow-y: hidden; width: 1px; height: 1px; top: 139px; left: -10000px;">ORDER BY SUBSTRING(CONVERT(NVARCHAR(10),Orders.OrderDate,111),6,2)</div>
<p><span style="color: #800000;">USE NORTHWIND;</span></p>
<p><span style="color: #800000;">GO</span></p>
<p><span style="color: #800000;">CREATE PROC ObtenerTotalMesYear</span></p>
<p><span style="color: #800000;">@Fecha nvarchar(10)</span></p>
<p><span style="color: #800000;">AS</span></p>
<p><span style="color: #800000;">SELECT Mes=DateName( month , DateAdd( month ,CAST(SUBSTRING(CONVERT(NVARCHAR(10),OrderDate,111),6,2) AS INT) , 0 ) &#8211; 1 ),</span></p>
<p><span style="color: #800000;">Total=ROUND(SUM(([order details].UnitPrice*[order details].Quantity)-([order details].UnitPrice*[order details].Quantity)*[order details].Discount),2)</span></p>
<p><span style="color: #800000;">FROM [order details] INNER JOIN Orders on [order details].OrderID = Orders.OrderID</span></p>
<p><span style="color: #800000;">WHERE DATENAME(yy,Orders.OrderDate) =@Fecha</span></p>
<p><span style="color: #800000;">GROUP BY SUBSTRING(CONVERT(NVARCHAR(10),Orders.OrderDate,111),6,2)</span></p>
<p><span style="color: #800000;">ORDER BY SUBSTRING(CONVERT(NVARCHAR(10),Orders.OrderDate,111),6,2)</span></p>
<p>Lo que hace este procedimiento es mostrar las ventas totales de cada uno de los meses, según el año ingresado, pregunten si tienen dudas acerca del código anterior.</p>
<p><strong>Paso 2.- </strong>Abrimos el Visual Studio y creamos un nuevo proyecto de Aplicación para Windows, asignamos un nombre al mismo.</p>
<p><a href="http://web.archive.org/web/20100730070849/http://yfrog.com/0c57788233p" onclick="javascript:pageTracker._trackPageview('/outbound/article/yfrog.com');"></a></p>
<p><a href="http://web.archive.org/web/20100730070849/http://yfrog.com/0c57788233p" onclick="javascript:pageTracker._trackPageview('/outbound/article/yfrog.com');"> </a></p>
<p><a href="http://web.archive.org/web/20100730070849/http://yfrog.com/0c57788233p" onclick="javascript:pageTracker._trackPageview('/outbound/article/yfrog.com');"><img class="aligncenter" src="http://web.archive.org/web/20100730070849im_/http://img12.imageshack.us/img12/9600/57788233.png" alt="" width="563" height="408" /></a><strong> </strong></p>
<p><strong> </strong>Haga clic derecho en el Proyecto&gt;Agregar&gt;Nuevo Elemento y escoja el reporte Crystal.</p>
<p>Asignele un nombre: <em>&#8220;ReporteVentas&#8221; </em>y haga click en agregar.<span id="more-492"></span></p>
<p><a rel="attachment wp-att-501" href="http://www.datanoia.com/?attachment_id=501" ><img class="aligncenter size-full wp-image-501" title="3" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/31.PNG" alt="3" width="679" height="415" /></a></p>
<p><strong>Paso 3 .-</strong> Se abrirá la siguiente pantalla, usaremos el asistente de informes. Presionamos aceptar.</p>
<p><a rel="attachment wp-att-508" href="http://www.datanoia.com/?attachment_id=508" ><img class="aligncenter size-full wp-image-508" title="Asistente" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Asistente.PNG" alt="Asistente" width="360" height="438" /></a></p>
<p><strong>Paso 4.- </strong>En la siguiente pantalla, despliegue <em>crear nueva conexión </em>y luego <em>OLE DB (ADO), </em>se abrirá un formulario para seleccionar un proveedor de SGBD.<a rel="attachment wp-att-509" href="http://www.datanoia.com/?attachment_id=509" ><img class="aligncenter size-full wp-image-509" title="Conectando" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Conectando.PNG" alt="Conectando" width="639" height="444" /></a></p>
<p><strong>Paso 5.- </strong>Seleccione la opción <em>SQL NATIVE CLIENT  y haga clic en siguiente.</em></p>
<p><em> </em></p>
<p><em><a rel="attachment wp-att-510" href="http://www.datanoia.com/?attachment_id=510" ><img class="aligncenter size-full wp-image-510" title="proveedor" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/proveedor.PNG" alt="proveedor" width="452" height="470" /></a></em></p>
<p><em> </em></p>
<p><strong>Paso 6.- </strong>Seleccione su Servidor de Base de datos, marque el check de seguridad Integrada, y seleccione la base de datos Northwind y luego presione finalizar.</p>
<p><strong><a rel="attachment wp-att-511" href="http://www.datanoia.com/?attachment_id=511" ><img class="aligncenter size-full wp-image-511" title="Servidor" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Servidor.PNG" alt="Servidor" width="451" height="469" /></a></strong></p>
<p><strong> </strong></p>
<p><strong>Paso 7.- </strong>Expanda el servidor y ubique la base de datos Northwind, despliegue <em>dbo </em>y en procedimientos almacenados, busque el procedimiento que creamos <em>ObtenerTotalMesYear. </em>Seleccionelo  y marquelo a la derecha con el botón &#8220;&gt;&#8221;.</p>
<p><a rel="attachment wp-att-512" href="http://www.datanoia.com/?attachment_id=512" ><img class="aligncenter size-full wp-image-512" title="Store" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Store.PNG" alt="Store" width="641" height="446" /></a></p>
<p><strong>Paso 8.- </strong>En la siguiente ventana presione aceptar, luego siguiente.</p>
<p><a rel="attachment wp-att-513" href="http://www.datanoia.com/?attachment_id=513" ><img class="aligncenter size-full wp-image-513" title="Param" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Param.PNG" alt="Param" width="511" height="452" /></a></p>
<p><strong>Paso 9. </strong>Despliegue el árbol de campos disponibles, seleccione los campos que desee  mostrar y paselos a la derecha.  No vamos a personalizar más el reporte, presionamos Finalizar.</p>
<p><a rel="attachment wp-att-517" href="http://www.datanoia.com/?attachment_id=517" ><img class="aligncenter size-full wp-image-517" title="Campos" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Campos.PNG" alt="Campos" width="639" height="443" /></a></p>
<p><strong>Paso 10. </strong>Se observará la siguiente pantalla, acomode los campos a su gusto:</p>
<p><a rel="attachment wp-att-518" href="http://www.datanoia.com/?attachment_id=518" ><img class="aligncenter size-full wp-image-518" title="Reporte" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Reporte.PNG" alt="Reporte" width="771" height="522" /></a><strong> </strong></p>
<p><strong>Paso 11. </strong>Arrastre desde<em> campos de parámetro</em>s el valor que se ingresa desde pantalla, para que se muestre en el reporte el año que ingresamos:</p>
<p><a rel="attachment wp-att-519" href="http://www.datanoia.com/?attachment_id=519" ><img class="aligncenter size-full wp-image-519" title="ReportePersonalizado" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/ReportePersonalizado.PNG" alt="ReportePersonalizado" width="821" height="547" /></a></p>
<p>Veamos una vista previa del informe, ingrese por ejemplo 1996 cuando le pida ingresar un parámetro.</p>
<p><a rel="attachment wp-att-520" href="http://www.datanoia.com/?attachment_id=520" ><img class="aligncenter size-full wp-image-520" title="vista" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/vista.PNG" alt="vista" width="796" height="545" /></a></p>
<p><strong>Paso 12. </strong>Bien es hora de programar, lo anterior funciona pero no es dinámico, imagine que el servidor de base de datos cambia de lugar, tendriamos que modificar cada uno de nuestros reportes, crearemos una sola conexión:</p>
<p>Agregaremos una clase llamada conexión:</p>
<pre class="brush: javascript; ">

private string servidor = &quot;JPANTOJA\\SQLEXPRESS&quot;;

private string basededatos = &quot;Northwind&quot;;

private string usuario = &quot;PREMIER\\rmauricio&quot;;

private string password = &quot;&quot;;

public string Password

{

get { return password; }

set { password = value; }

}

public string Servidor

{

get { return servidor; }

set { servidor = value; }

}

public string Basededatos

{

get { return basededatos; }

set { basededatos = value; }

}

public string Usuario

{

get { return usuario; }

set { usuario = value; }

}
</pre>
<p>Dirigirse al  formulario y agregar un componente <em>Crystal Report Viewer</em> y los demás componentes. Al comboBox lo llenamos con los años: 1996, 1997, 1998.</p>
<p><a rel="attachment wp-att-535" href="http://www.datanoia.com/?attachment_id=535" ><img class="aligncenter size-full wp-image-535" title="formulario" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/formulario.PNG" alt="formulario" width="664" height="485" /></a></p>
<p>En el formulario escribir el siguiente código, no olviden agregar las referencias para Crystal Report.</p>
<pre class="brush: javascript; ">

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

//Referencias

using CrystalDecisions.CrystalReports.Engine;

using CrystalDecisions.Shared;

using CrystalDecisions.ReportSource;

namespace ReporteVentas

{

public partial class Form1 : Form

{

ReporteVentas report = new ReporteVentas();

ParameterDiscreteValue FechaDV = new ParameterDiscreteValue(); //parametro de entrada

Conexion con = new Conexion();

public void CargaReporte(string FechaParam)

{

FechaDV.Value = FechaParam;

report.SetParameterValue(&quot;@Fecha&quot;, FechaDV);//Asignando el parametro

//de entrada con el parametro del storeprocedure

crystalReportViewer1.ReportSource = report; //cargando el reporte

}

public Form1()

{

InitializeComponent();

report.DataSourceConnections[0].SetConnection(con.Servidor, con.Basededatos, con.Usuario, con.Password);//Cargando Conexion

}

private void button1_Click(object sender, EventArgs e)

{ //Ejecutando reporte

if (comboBox1.SelectedItem != null)

{

CargaReporte(comboBox1.SelectedItem.ToString());

}

}

private void Form1_FormClosed(object sender, FormClosedEventArgs e)

{ //Liberando recursos

report.Dispose();

crystalReportViewer1.Dispose();

}

}

}
</pre>
<p>Por si no lo recuerdan, el método  Form1_FormClosed fue agregado de la siguiente forma:</p>
<p>Dando doble clic en Form Closed.</p>
<p><a rel="attachment wp-att-549" href="http://www.datanoia.com/?attachment_id=549" ><img class="aligncenter size-full wp-image-549" title="closed" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/closed.PNG" alt="closed" width="283" height="351" /></a></p>
<p>Ahora ejecutamos el programa, seleccionamos un año y presionamos el botón mostrar.</p>
<p><a rel="attachment wp-att-544" href="http://www.datanoia.com/?attachment_id=544" ><img class="aligncenter size-full wp-image-544" title="Crystal" src="http://web.archive.org/web/20100730070849im_/http://www.datanoia.com/wp-content/uploads/2009/08/Crystal.PNG" alt="Crystal" width="661" height="483" /></a></p>
<p>Acá tienen un ejemplo para Web <a href="http://web.archive.org/web/20100730070849/http://www.datanoia.com/reporte-web-con-crystal-report-usando-store-procedure.html" >http://www.datanoia.com/reporte-web-con-crystal-report-usando-store-procedure.html</a></p>
<p><a href="http://web.archive.org/web/20100730070849/http://www.datanoia.com/reportes-crystal-report-en-windows-form-con-parametros-storeprocedure.html" ></a>¡Espero les haya sido de ayuda! Buen día.</p>
<p><map name='google_ad_map_166_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/166?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_166_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=166&amp;url= http%3A%2F%2Fwww.datanoia.com%2Freportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/reportes-con-crystal-report-en-windows-form-y-parametros-storeprocedure.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Struts en Netbeans 6.5</title>
		<link>http://www.datanoia.com/struts-en-netbeans-6-5.html?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=struts-en-netbeans-6-5</link>
		<comments>http://www.datanoia.com/struts-en-netbeans-6-5.html#comments</comments>
		<pubDate>Wed, 19 Aug 2009 21:52:14 +0000</pubDate>
		<dc:creator>risharp</dc:creator>
				<category><![CDATA[Destacados]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://fenix.aolinex.com/?p=129</guid>
		<description><![CDATA[Uno de los Frameworks más maduros y robustos del medio sin duda es Struts, basado en el patrón MVC (Módelo, Vista, Controlador) es uno de los Frameworks más usados en el mundo de Java. Aquí un tutorial básico en donde validaremos a un usuario. Pueden descargar el ejemplo: Proyecto Struts 6.5 Ir a Archivo&#62;Proyecto Nuevo<a href="http://www.datanoia.com/struts-en-netbeans-6-5.html">&#160;&#160;[ Read More ]</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.datanoia.com%252Fstruts-en-netbeans-6-5.html%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Struts%20en%20Netbeans%206.5%22%20%7D);"></div>
<p>Uno de los Frameworks más maduros y robustos del medio sin duda es Struts, basado en el patrón MVC (Módelo, Vista, Controlador) es uno de los Frameworks más usados en el mundo de Java.</p>
<p>Aquí un tutorial básico en donde validaremos a un usuario.</p>
<p>Pueden descargar el ejemplo: <a href="http://fenix.aolinex.com/?attachment_id=249" rel="attachment wp-att-249">Proyecto Struts 6.5</a></p>
<p>Ir a Archivo&gt;Proyecto Nuevo y seleccionar una nueva aplicación Web.</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/struts-en-netbeans-6-5.html/tutorial-aprende-a-instalar-ubuntu-11-04-%e2%80%9cnatty-narwhal%e2%80%9d-paso-a-paso" rel="attachment wp-att-108"><img class="aligncenter size-full wp-image-108" title="Struts-NuevoProyecto1" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-NuevoProyecto1.PNG" alt="Struts-NuevoProyecto1" width="725" height="492" /></a></p>
<p>Asignar un nombre al proyecto, luego siguiente.</p>
<p style="text-align: center;"><a href="http://feedproxy.google.com/~r/datanoia/~3/NJSQjRpUID8/gana-espacio-en-firefox4-reduciendo-la-barra-de-complementos-con-barlesque.html/110-revision" rel="attachment wp-att-120"><img class="aligncenter size-full wp-image-120" title="Struts Proyecto" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-NombreProjecto2.PNG" alt="Struts Proyecto" width="730" height="493" /></a></p>
<p>Asigne un servidor de aplicaciones, en este caso he optado por Apache Tomcat, aunque pueden usar Glasfish que viene instalado con el NetBeans.</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/struts-en-netbeans-6-5.html/facebook-es-el-iphone-de-las-redes-sociales" rel="attachment wp-att-125"><img class="aligncenter size-full wp-image-125" title="Struts-ServerApache3" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-ServerApache3.PNG" alt="Struts-ServerApache3" width="790" height="495" /></a></p>
<p>Marcar el Framework de Struts y luego terminar.</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/?attachment_id=160" rel="attachment wp-att-160"><img class="aligncenter size-full wp-image-160" title="Struts-FrameworkStruts4" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-FrameworkStruts4.PNG" alt="Struts-FrameworkStruts4" width="788" height="494" /></a></p>
<p>En <em>Source Packages</em> crear los siguientes paquetes: Controller y Model, no creamos el paquete View ya que son representadas por <em>“Web Pages”</em> en donde tenemos nuestras páginas web.</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/?attachment_id=168" rel="attachment wp-att-168"><img class="aligncenter size-full wp-image-168" title="Paquetes" src="http://www.datanoia.com/wp-content/uploads/2009/08/Paquetes.png" alt="Paquetes" width="236" height="483" /></a></p>
<p>Bien, ahora agregaremos una página JSP de nombre: “Login”</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/?attachment_id=173" rel="attachment wp-att-173"><img class="aligncenter size-full wp-image-173" title="Struts-NuevoJSP8" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-NuevoJSP8.PNG" alt="Struts-NuevoJSP8" width="697" height="453" /></a></p>
<p>Agregar los siguientes librerias de Struts en Login.jsp</p>
<pre class="brush: java; ">&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
&lt;%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %&gt;

&lt;%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %&gt;
&lt;%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %&gt;
&lt;h1&gt;Inicio Sesión&lt;/h1&gt;</pre>
<p>En el paquete Model crearemos una clase llamada Users donde tendremos las entidades del negocio.</p>
<pre class="brush: java; ">package Model;

public class Users {
private String nombre;
private String clave;

public Users() {
}

public String getClave() {
return clave;
}

public void setClave(String clave) {
this.clave = clave;
}

public String getNombre() {
return nombre;
}

public void setNombre(String nombre) {
this.nombre = nombre;
}

}</pre>
<p>Para crear las entidades de una manera más rápida</p>
<p>Defina las siguientes variables, seleccionalas, haga click derecho, Reestructurar&gt;Encapsular Campos</p>
<pre class="brush: java; ">private String nombre;
private String clave;</pre>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/?attachment_id=194" rel="attachment wp-att-194"><img class="aligncenter size-full wp-image-194" title="Struts-Encapsular7" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-Encapsular7.PNG" alt="Struts-Encapsular7" width="829" height="459" /></a></p>
<p>En el paquete Controller hacemos click derecho &gt;nuevo&gt; otros&gt; y en la categoría Struts elegir el archivo Struts ActionForm Bean y creamos la clase llamada LoginActionFormBean.java</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/?attachment_id=205" rel="attachment wp-att-205"><img class="aligncenter size-full wp-image-205" title="Struts-StrutsAction9" src="http://www.datanoia.com/wp-content/uploads/2009/08/Struts-StrutsAction9.PNG" alt="Struts-StrutsAction9" width="727" height="495" /></a></p>
<p>Escribir el siguiente código en la clase LoginActionFormBean.java, esta clase se encargá de manejar las validaciones que son enviadas desde el formulario. Por ejemplo se encargá de manejar si algún campo está vacío, o si cumple cierto número de carácteres.</p>
<pre class="brush: java; ">package Controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
*
* @author Richard
*/
public class LoginActionFormBean extends org.apache.struts.action.ActionForm {

private String usuario;
private String pwd;

public String getPwd() {
return pwd;
}

public void setPwd(String pwd) {
this.pwd = pwd;
}

public String getUsuario() {
return usuario;
}

public void setUsuario(String usuario) {
this.usuario = usuario;
}

/**
*
*/
public LoginActionFormBean() {
super();
// TODO Auto-generated constructor stub
}

public ActionErrors validate(ActionMapping mapping,HttpServletRequest request)
{
ActionErrors errors = new ActionErrors();

if(usuario.length()&lt;1 ||usuario==null)
errors.add("usu", new ActionMessage("errors.usuario"));
else
{
if(pwd.length()&lt;=0)
errors.add("pwd", new ActionMessage("errors.clave"));

}
mapping.getInputForward();

return errors;
}
}</pre>
<p>Si se produce algún error se mostrarán mensajes que son prestablecidos en el archivo <em>ApplicationResource.properties</em> del paquete com.myapp.struts, este archivo se creó automaticamente al crear la aplicación Web.</p>
<p>La modificaremos con el siguiente código:</p>
<pre class="brush: java; "># -- standard errors --
errors.header=&lt;UL&gt;
errors.prefix=&lt;LI&gt;
errors.suffix=&lt;/LI&gt;

errors.footer=&lt;/UL&gt;
# -- validator --
errors.usuario=Debe ingresar el Nombre del Usuario
errors.clave=Debe Ingresar la clave del Usuario
errors.impedir=Usuario inexistente
# -- other --
errors.cancel=Operation cancelled.
errors.detail={0}
errors.general=The process did not complete. Details should follow.
errors.token=Request could not be completed. Operation is not in sequence.
# -- welcome --
welcome.title=Struts Application
welcome.heading=Struts Applications in Netbeans!
welcome.message=It's easy to create Struts applications with NetBeans.</pre>
<p>Ahora nuevamente agregar un archivo Struts en el paquete Controller, sólo que ahora del tipo Struts Action, le pondremos de nombre LoginAction.</p>
<p>Escribir en Action Path: “/Login” que será una especie de url, luego hacer clic en siguiente.</p>
<p style="text-align: center;"><a href="http://fenix.aolinex.com/?attachment_id=235" rel="attachment wp-att-235"><img class="aligncenter size-full wp-image-235" title="1" src="http://www.datanoia.com/wp-content/uploads/2009/08/1.PNG" alt="1" width="513" height="312" /></a></p>
<p style="text-align: center;">En la siguiente pantalla presione Browse y elija nuestra página Login.jsp.<a href="http://fenix.aolinex.com/?attachment_id=236" rel="attachment wp-att-236"><img class="aligncenter size-full wp-image-236" title="2" src="http://www.datanoia.com/wp-content/uploads/2009/08/2.PNG" alt="2" width="516" height="283" /></a></p>
<p>Esta clase se encargá de comunicarse con la lógica del negocio que se encuentra en el paquete Modelo y comprobar por ejemplo si el archivo existe en una base de datos, si no es así mostrará en pantalla mensajes, que como sabemos están preestablecidos en nuestro archivo properties.</p>
<p>Añadir el siguiente código a la clase LoginAction:</p>
<pre class="brush: java; ">package Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMessage;
/**import org.apache.struts.action.ActionMessage;
*
* @author richard
*/
public class LoginAction extends org.apache.struts.action.Action {
private Controller.LoginActionFormBean formulario;

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
//Obtengo el Formulario
formulario=(Controller.LoginActionFormBean) form;
Model.Users us=new Model.Users();
us.setNombre(formulario.getUsuario());
us.setClave(formulario.getPwd());
ActionForward retorno=new ActionForward();

if(us.getNombre().equals("risharp")&amp;&amp; us.getClave().equals("123456"))
retorno=mapping.findForward("welcome");
else
{

ActionErrors errors = new ActionErrors();
errors.add("no_existe", new ActionMessage("errors.impedir"));

saveErrors(request, errors);
retorno=mapping.getInputForward();
}

return retorno;
}
}</pre>
<p>Ahora revisar el archivo “struts-config” ubicado en WEB-INF</p>
<p>Vemos que se han creado las siguientes líneas de código:</p>
<pre class="brush: java; ">&lt;form-beans&gt;
&lt;form-bean name="Login" type="Controller.LoginActionFormBean"/&gt;

&lt;/form-beans&gt;</pre>
<pre class="brush: java; ">&lt;action-mappings&gt;
&lt;action input="/Login.jsp" name="Login" path="/Login" scope="session" type="Controller.LoginAction"/&gt;

&lt;action path="/Welcome" forward="/welcomeStruts.jsp"/&gt;
&lt;/action-mappings&gt;</pre>
<p>Por último agregamos el siguiente código en Login.jsp:</p>
<pre class="brush: java; ">&lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;

&lt;%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %&gt;
&lt;%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %&gt;
&lt;%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %&gt;

&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"&gt;

&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
&lt;title&gt;www.datanoia.com&lt;/title&gt;

&lt;/head&gt;
&lt;body&gt;
&lt;html:form action="Login"&gt;
Usuario:&lt;html:text property="user"&gt;&lt;/html:text&gt;&lt;br /&gt;
&lt;html:errors property="UserError"/&gt;&lt;br/&gt;

Clave:&lt;html:text property="password"&gt;&lt;/html:text&gt;&lt;br /&gt;
&lt;html:errors property="PasswordError"/&gt;&lt;br/&gt;

&lt;html:errors property="no_existe"/&gt;&lt;br /&gt;

&lt;html:submit value="Confirmar"&gt;&lt;/html:submit&gt;
&lt;/html:form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>Observemos que nuestro formulario está invocando a “Login”</p>
<pre class="brush: java; ">&lt;html:form action="Login"&gt;</pre>
<p>Definido en:</p>
<pre class="brush: java; ">&lt;form-beans&gt;
&lt;form-bean name="Login" type="Controller.LoginActionFormBean"/&gt;
&lt;/form-beans&gt;</pre>
<p>Luego probamos corremos nuestra página Login.jsp</p>
<p><map name='google_ad_map_129_e6f9cc4188fca22c'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/129?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_129_e6f9cc4188fca22c' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=129&amp;url= http%3A%2F%2Fwww.datanoia.com%2Fstruts-en-netbeans-6-5.html' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.datanoia.com/struts-en-netbeans-6-5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

