<?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"
	>

<channel>
	<title>Flex Pernambuco</title>
	<atom:link href="http://www.flexpernambuco.com.br/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.flexpernambuco.com.br</link>
	<description></description>
	<pubDate>Mon, 16 Aug 2010 18:58:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Código Fonte - E-Solicite</title>
		<link>http://www.flexpernambuco.com.br/?p=20</link>
		<comments>http://www.flexpernambuco.com.br/?p=20#comments</comments>
		<pubDate>Mon, 16 Aug 2010 18:58:28 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[e-solicite]]></category>

		<category><![CDATA[sem categoria]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=20</guid>
		<description><![CDATA[Pessoal,
Após muitos pedidos para liberação do código fonte da aplicação E-Solicite desenvolvida em Flex e PHP o código encontra-se no google code e pode ser acessado através do site: http://code.google.com/p/esolicite/
Importante deixar claro que esta aplicação foi desenvolvida a alguns anos atrás com intuito de aprendizagem e prova de conceito, portanto não está desenvolvida da melhor maneira, padrões [...]]]></description>
			<content:encoded><![CDATA[<p>Pessoal,</p>
<p>Após muitos pedidos para liberação do código fonte da aplicação E-Solicite desenvolvida em Flex e PHP o código encontra-se no google code e pode ser acessado através do site: <a href="http://code.google.com/p/esolicite/">http://code.google.com/p/esolicite/</a></p>
<p><a href="http://code.google.com/p/esolicite/"></a>Importante deixar claro que esta aplicação foi desenvolvida a alguns anos atrás com intuito de aprendizagem e prova de conceito, portanto não está desenvolvida da melhor maneira, padrões de desenvolvimento, não possui documentação e não daremos suporte a dúvidas e configuração ou desenvolvimento.</p>
<p>O código está bem simples, utilizando módulos, temas e php.</p>
<p>Infelizmente não tive muito tempo para continuar seu desenvolvimento, porém espero que ajude a comunidade e aos iniciantes nessa fantástica tecnologia.</p>
<p>A demo do sistema pode ser acessada em : <a href="http://www.flexpernambuco.com.br/?p=10">www.flexpernambuco.com.br/?p=10</a></p>
<p>Enjoy it!</p>
<p>Juliano</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=20</wfw:commentRss>
		</item>
		<item>
		<title>Certificação Oficial FLEX 3 - Liberada</title>
		<link>http://www.flexpernambuco.com.br/?p=19</link>
		<comments>http://www.flexpernambuco.com.br/?p=19#comments</comments>
		<pubDate>Fri, 07 Nov 2008 17:58:24 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Dicas]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=19</guid>
		<description><![CDATA[Pessoal,
Finalmente ontem a ADOBE liberou a certificação oficial para o Flex 3 + AIR.
Ta ai uma otima oportunidade para todos!!!
Custa $150,00 dólares.
Aqui o site do Guia de Estudo:
http://partners.adobe.com/public/en/ace/ACE_Exam_Guide_FlexAIR.pdf
Aqui o site com os valores e local para inscrição e compra do exame:
http://partners.adobe.com/public/ace/main.html
Boa Sorte!!
Juliano
]]></description>
			<content:encoded><![CDATA[<p>Pessoal,<br />
Finalmente ontem a ADOBE liberou a certificação oficial para o Flex 3 + AIR.<br />
Ta ai uma otima oportunidade para todos!!!</p>
<p>Custa $150,00 dólares.</p>
<p>Aqui o site do Guia de Estudo:<br />
<a href="http://partners.adobe.com/public/en/ace/ACE_Exam_Guide_FlexAIR.pdf" target="_blank">http://partners.adobe.com/public/en/ace/ACE_Exam_Guide_FlexAIR.pdf</a></p>
<p>Aqui o site com os valores e local para inscrição e compra do exame:<br />
<a href="http://partners.adobe.com/public/ace/main.html" target="_blank">http://partners.adobe.com/public/ace/main.html</a></p>
<p>Boa Sorte!!</p>
<p>Juliano</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=19</wfw:commentRss>
		</item>
		<item>
		<title>MasterTextInput v0.2 - Open Source</title>
		<link>http://www.flexpernambuco.com.br/?p=18</link>
		<comments>http://www.flexpernambuco.com.br/?p=18#comments</comments>
		<pubDate>Fri, 17 Oct 2008 07:23:48 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[MasterTextInput]]></category>

		<category><![CDATA[componentes]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=18</guid>
		<description><![CDATA[Liberada a versão v0.2 do MasterTextInput.
Agora com a funcionalidade de Máscara implementada através da propriedade InputMask.
Foi liberada também uma aplicação de exemplo, com exemplos de todas as funcionalidades.
A aplicação de exemplo e o fonte podem ser acessados clicando aqui
Site do projeto: http://code.google.com/p/mastertextinput/
Espero que gostem&#8230;

]]></description>
			<content:encoded><![CDATA[<p>Liberada a versão <strong><span style="font-size: 12pt; font-family: Arial; color: blue;">v0.2</span></strong> do <strong><span style="font-size: 12pt; font-family: Arial; color: blue;">MasterTextInput</span></strong>.</p>
<p>Agora com a funcionalidade de Máscara implementada através da propriedade InputMask.</p>
<p>Foi liberada também uma aplicação de exemplo, com exemplos de todas as funcionalidades.</p>
<p>A aplicação de exemplo e o fonte podem ser acessados <a href="http://www.flexpernambuco.com.br/exemplos/MasterTextInputExample/MasterTextInputExample.html" target="_blank">clicando aqui</a><br />
Site do projeto: <a href="http://code.google.com/p/mastertextinput/" target="_blank">http://code.google.com/p/mastertextinput/</a><br />
Espero que gostem&#8230;</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="460" height="600" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="filters" /><param name="quality" value="high" /><param name="bgcolor" value="#869ca7" /><param name="allowScriptAccess" value="sameDomain" /><param name="src" value="http://www.flexpernambuco.com.br/exemplos/MasterTextInputExample/MasterTextInputExample.swf" /><embed id="filters" type="application/x-shockwave-flash" width="460" height="600" src="http://www.flexpernambuco.com.br/exemplos/MasterTextInputExample/MasterTextInputExample.swf" allowscriptaccess="sameDomain" bgcolor="#869ca7" quality="high"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=18</wfw:commentRss>
		</item>
		<item>
		<title>MasterTextInput v0.1 - Open Source</title>
		<link>http://www.flexpernambuco.com.br/?p=17</link>
		<comments>http://www.flexpernambuco.com.br/?p=17#comments</comments>
		<pubDate>Thu, 16 Oct 2008 04:38:25 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<category><![CDATA[MasterTextInput]]></category>

		<category><![CDATA[componentes]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=17</guid>
		<description><![CDATA[Pessoal,
 
 Desenvolvi um componente para Flex chamado MasterTextInput. Totalmente Open Source e projeto criado no Google Code. 
O MasterTextInput estende as características de um TextInput com novas funcionalidades e facilidades implementada para nos ajudar no nosso dia-a-dia.
 
 Segue a lista das Funcionalidades já desenvolvidas nesta versão v0.1:
 
== AUTO TEXT CASE TYPE ==
Desc: [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoPlainText"><span style="font-family: Arial;">Pessoal,</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"><span> </span>Desenvolvi um componente para Flex chamado </span><strong><span style="font-size: 12pt; font-family: Arial; color: blue;">MasterTextInput</span></strong><span style="font-family: Arial;">. Totalmente <strong>Open Source</strong> e projeto criado no Google Code. </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;">O MasterTextInput estende as características de um TextInput com novas funcionalidades e facilidades implementada para nos ajudar no nosso dia-a-dia.</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"><span> </span>Segue a lista das Funcionalidades já desenvolvidas nesta versão v0.1:</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><strong><span style="font-size: 12pt; font-family: Arial;">== AUTO TEXT CASE TYPE ==</span></strong></p>
<p class="MsoPlainText"><strong><span style="font-family: Arial;">Desc:</span></strong><span style="font-family: Arial;"> Transformar automaticamente o texto digitado em minúscula ou maiúscula.</span><strong><span style="font-family: Arial;"><br />
Propriedade:</span></strong><span style="font-family: Arial;"> capsType()</span><strong><span style="font-family: Arial;"><br />
Valores:</span></strong><span style="font-family: Arial;"><br />
</span><span style="font-family: Arial;">- normal : Sem case [DEFAULT]</span><span style="font-family: Arial;"><br />
- lowercase : Transforma em Minúscula</span><span style="font-family: Arial;"><br />
- upercase : Transforma em Maiúscula<br />
- init : Transforma a primeira letra de cada palavra em Maiúscula o resto em minúscula.</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><strong><span style="font-size: 12pt; font-family: Arial;">== AUTO TAB ON &lt;ENTER&gt; KEY PRESS ==</span></strong></p>
<p class="MsoPlainText"><strong><span style="font-family: Arial;">Desc:</span></strong><span style="font-family: Arial;"> Automaticamente coloca o foco no próximo componente ao pressionar a tecla &lt;ENTER&gt;. Realiza a mesma função da tecla &lt;TAB&gt;</span><strong><span style="font-family: Arial;"><br />
Propriedade:</span></strong><span style="font-family: Arial;"> nextFocusOnEnter()</span><strong><span style="font-family: Arial;"><br />
Valores:</span></strong><span style="font-family: Arial;"><br />
- true : Ativa função [DEFAULT]<br />
- false : Inativa função</span><strong><span style="font-family: Arial;"><br />
Eventos:</span></strong><span style="font-family: Arial;"><br />
- enterPressed : Disparado ao pressionar a tecla &lt;ENTER&gt;. Pode ser usado para implementações customizadas.</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><strong><span style="font-size: 12pt; font-family: Arial;">== AUTO RESTRICT ==</span><span style="font-family: Arial;"><br />
Desc:</span></strong><span style="font-family: Arial;"> Restrições de input de texto já implementadas.</span><strong><span style="font-family: Arial;"><br />
Propriedade:</span></strong><span style="font-family: Arial;"> onlyRestrict()</span><strong><span style="font-family: Arial;"><br />
Valores:<br />
</span></strong><span style="font-family: Arial;">- none : Não realiza restrição [DEFAULT]<br />
</span><span style="font-family: Arial;">- number : Aceita apenas caracteres numéricos<span><br />
</span>- alphabetic : Aceita apenas texto<br />
- alphabeticNoSpecial : Aceita apenas texto, porém não aceita caracteres especiais como : @ - / * &amp; &#8230;</span><strong><span style="font-family: Arial;"><br />
Observação:</span></strong><span style="font-family: Arial;"> Para restrições customizadas pode-se continuar utilizando a propriedade restrict().</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><strong><span style="font-size: 12pt; font-family: Arial;">== EMBEDED VALIDATORS ==</span><span style="font-family: Arial;"><br />
Desc:</span></strong><span style="font-family: Arial;"> Validação embutida. Não será mais necessário criar &lt;Validators&gt; por fora para cada campo. Já existirá as validações automáticas apenas setando uma propriedade do MasterTextInput. As mensagens de Validação já são automaticamente traduzidas para o Português/Inglês/Espanhol sem a necessidade de nenhum tipo de implementação.</span><strong><span style="font-family: Arial;"><br />
Propriedade:</span></strong><span style="font-family: Arial;"> validator()</span><strong><span style="font-family: Arial;"><br />
Valores:</span></strong><span style="font-family: Arial;"><br />
</span><span style="font-family: Arial;">- none : Sem validação automática [DEFAULT]<br />
</span><span style="font-family: Arial;">- email : Validação de E-mail</span><span style="font-family: Arial;"><br />
- phone : Validação de telefone</span><span style="font-family: Arial;"><br />
- number : Validação de número</span><span style="font-family: Arial;"><br />
- string : Validação de string<br />
- date : Validação de data</span><strong><span style="font-family: Arial;"><br />
Observações:<br />
</span></strong><span style="font-family: Arial;">- Todas as propriedades específicas de cada validador também existe no MasterTextInput. Como por exemplo FormatInput para validador de data, MaxValue para Number, MaxLenght para String e assim para todas as outras propriedades padrões dos validadores.<br />
</span><span style="font-family: Arial;">- Existe um objeto Publico chamado &#8220;currentValidator&#8221; ele irá sempre apontar para o validador atual do seu MasterTextInput, assim você poderá via AS modificar qualquer característica do validador dinamicamente, associar ele a um Array para validação agrupada e qualquer outra função.</span><span style="font-family: Arial;"><br />
- As propriedades Trigger() e TriggerEvent() existem no MasterTextInput para que seja possível definir quando será disparada a validação do campo. O momento padrão é ao sair o foco do componente.<br />
- Todas as validações estão com as características implementadas por DEFAULT do Brasil, como por exemplo, a formatação da data como DD/MM/YYYY, separador decimal como (,) separador de milhar como (.) e assim sucessivamente.</span><strong><span style="font-family: Arial;"><br />
Propriedade:</span></strong><span style="font-family: Arial;"> ValidationLanguage()</span><strong><span style="font-family: Arial;"><br />
Desc:</span></strong><span style="font-family: Arial;"> Esta propriedade terá a língua que será mostrada as mensagens de validação dos Validadores do MasterTextInput.</span><strong><span style="font-family: Arial;"><br />
Valores:</span></strong><span style="font-family: Arial;"><br />
- portuguese : Todas as mensagens de validação ficam em Português. [DEFAULT]<br />
- english : Mensagens de validação em inglês.</span><span style="font-family: Arial;"><br />
- spanish : Mensagens de validação em espanhol.</span><strong><span style="font-family: Arial;"><br />
Observações:</span></strong><span style="font-family: Arial;"><br />
- Pode-se modificar a linguagem dinamicamente setando este propriedade via Action Script.</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><strong><span style="font-size: 12pt; font-family: Arial;">== CLEAR BUTTON ==</span><span style="font-family: Arial;"><br />
Desc:</span></strong><span style="font-family: Arial;"> Mostrará um botão com um ícone em &#8220;X&#8221; no momento em que algum texto for digitado no MasterTextInput. Ao clicar o botão o campo será limpo.</span><strong><span style="font-family: Arial;"><br />
Propriedade:</span></strong><span style="font-family: Arial;"> showClearButton()</span><strong><span style="font-family: Arial;"><br />
Valores:<br />
</span></strong><span style="font-family: Arial;">- true : Mostra botão [DEFAULT]<br />
- false : Não mostra botão</span></p>
<p><strong><span style="font-family: Arial;">Implementações em andamento para versão v0.2:<br />
== Auto Formatadores ==</span></strong><span style="font-family: Arial;"><br />
- Formatar DATA</span><span style="font-family: Arial;"><br />
- Formatar CEP</span><span style="font-family: Arial;"><br />
- Formatar CNPJ</span><span style="font-family: Arial;"><br />
- Formata CPF</span><span style="font-family: Arial;"><br />
- Formatar Telefone</span><span style="font-family: Arial;"><br />
- Formatação customizada : ###.###.##-##</span><span style="font-family: Arial;"><br />
== Validadores para CPF, CNPJ e IP ==<br />
</span><span style="font-family: Arial;">== Undo e Redo ==<br />
== Label Prompt ==</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;">Peço a quem estiver interessado, realizar o download no site do projeto.<br />
Favor realizem testes e contribuam com novas idéias para serem implementadas afim de deixar este componente bem completo.</span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;">Site do Projeto: <a href="http://code.google.com/p/mastertextinput/">http://code.google.com/p/mastertextinput/</a></span><span style="font-family: Arial;"><br />
Site Flexpernambuco: <a href="../">http://www.flexpernambuco.com.br/</a><br />
Sugestões enviar para: <a href="mailto:juliano.mendes@flexpernambuco.com.br">juliano.mendes@flexpernambuco.com.br</a></span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
<p class="MsoPlainText"><span><span style="font-family: Arial;"> </span></span></p>
<p class="MsoPlainText"><span style="font-family: Arial;">Espero que gostem!</span><a name="_MailAutoSig"></a></p>
<p><a name="_MailAutoSig">Abraços,</a><span><span style="font-family: Arial;"><br />
Juliano Mendes</span></span></p>
<p class="MsoPlainText">
<p class="MsoPlainText"><span style="font-family: Arial;"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=17</wfw:commentRss>
		</item>
		<item>
		<title>Flex in a Week</title>
		<link>http://www.flexpernambuco.com.br/?p=16</link>
		<comments>http://www.flexpernambuco.com.br/?p=16#comments</comments>
		<pubDate>Wed, 20 Aug 2008 12:49:01 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Dicas]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=16</guid>
		<description><![CDATA[
Esse eu recomendo a todos.
A ADOBE lançou um programa de treinamento online baseado em videos.  Este treinamento é grátis e visa ajudar desenvolvedores a acelerar seus estudos em Flex.
São vários video aulas liberadas e divididas em 5 dias, incluindo exercícios e soluções.
Simplemente fantástico para quem estiver começando no Flex.

Apenas deixo aqui avisado que todas as [...]]]></description>
			<content:encoded><![CDATA[<p><img style="vertical-align: top;" src="http://www.flexpernambuco.com.br/uploads/img/flex_inaweek.jpg" alt="" width="248" height="148" /><br />
Esse eu recomendo a todos.</p>
<p>A ADOBE lançou um programa de treinamento online baseado em videos.  Este treinamento é grátis e visa ajudar desenvolvedores a acelerar seus estudos em Flex.</p>
<p>São vários video aulas liberadas e divididas em 5 dias, incluindo exercícios e soluções.</p>
<p>Simplemente fantástico para quem estiver começando no Flex.</p>
<ul>
<li>Apenas deixo aqui avisado que todas as aulas são em Inglês.</li>
</ul>
<p>O treinamento pode ser acessado aqui:<br />
<a href="http://www.adobe.com/devnet/flex/videotraining/" target="_blank">http://www.adobe.com/devnet/flex/videotraining/</a></p>
<p>Juliano</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=16</wfw:commentRss>
		</item>
		<item>
		<title>Efeitos Glow</title>
		<link>http://www.flexpernambuco.com.br/?p=15</link>
		<comments>http://www.flexpernambuco.com.br/?p=15#comments</comments>
		<pubDate>Mon, 18 Aug 2008 03:22:05 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Exemplos]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=15</guid>
		<description><![CDATA[Olá amigos,
Um simples exemplo de efeitos de rollOver e rollOut em imagens.

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;mx:Application xmlns:mx=&#34;http://www.adobe.com/2006/mxml&#34; layout=&#34;absolute&#34; width=&#34;415&#34; height=&#34;380&#34; backgroundGradientAlphas=&#34;[1.0, 1.0]&#34; backgroundGradientColors=&#34;[#000000, #000000]&#34; viewSourceURL=&#34;srcview/index.html&#34;&#62;
	&#60;mx:Image x=&#34;10&#34; y=&#34;10&#34; source=&#34;assets/img/e-solicite.png&#34; scaleContent=&#34;true&#34; width=&#34;48&#34; height=&#34;48&#34; rollOverEffect=&#34;{rollOverEffect}&#34; rollOutEffect=&#34;{rollOutEffect}&#34;/&#62;
	&#60;mx:Image x=&#34;66&#34; y=&#34;10&#34; source=&#34;assets/img/32_home.png&#34; scaleContent=&#34;true&#34; width=&#34;32&#34; height=&#34;32&#34; rollOverEffect=&#34;{rollOverEffect}&#34; rollOutEffect=&#34;{rollOutEffect}&#34;/&#62;
	&#60;mx:Image x=&#34;106&#34; y=&#34;10&#34; source=&#34;assets/img/32_logoff.png&#34; scaleContent=&#34;true&#34; width=&#34;32&#34; height=&#34;32&#34; rollOverEffect=&#34;{rollOverEffect}&#34; rollOutEffect=&#34;{rollOutEffect}&#34;/&#62;
&#160;
  &#60;mx:Script&#62;
  	&#60;!&#91;CDATA&#91;
&#160;
		import mx.effects.Glow;
		import mx.effects.Effect;
&#160;
  		private [...]]]></description>
			<content:encoded><![CDATA[<p>Olá amigos,</p>
<p>Um simples exemplo de efeitos de rollOver e rollOut em imagens.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Application xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;absolute&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;415&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;380&quot;</span> backgroundGradientAlphas<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[1.0, 1.0]&quot;</span> backgroundGradientColors<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;[#000000, #000000]&quot;</span> viewSourceURL<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;srcview/index.html&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Image x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> source<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;assets/img/e-solicite.png&quot;</span> scaleContent<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;48&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;48&quot;</span> rollOverEffect<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{rollOverEffect}&quot;</span> rollOutEffect<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{rollOutEffect}&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Image x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;66&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> source<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;assets/img/32_home.png&quot;</span> scaleContent<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;32&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;32&quot;</span> rollOverEffect<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{rollOverEffect}&quot;</span> rollOutEffect<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{rollOutEffect}&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Image x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;106&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> source<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;assets/img/32_logoff.png&quot;</span> scaleContent<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;32&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;32&quot;</span> rollOverEffect<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{rollOverEffect}&quot;</span> rollOutEffect<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{rollOutEffect}&quot;</span><span style="color: #339933;">/&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
  	<span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span>CDATA<span style="color: #009900;">&#91;</span>
&nbsp;
		import mx<span style="color: #339933;">.</span>effects<span style="color: #339933;">.</span>Glow<span style="color: #339933;">;</span>
		import mx<span style="color: #339933;">.</span>effects<span style="color: #339933;">.</span>Effect<span style="color: #339933;">;</span>
&nbsp;
  		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> get rollOverEffect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>Effect <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> effect<span style="color: #339933;">:</span>Glow <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Glow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>blurXTo <span style="color: #339933;">=</span> effect<span style="color: #339933;">.</span>blurYTo <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>alphaFrom <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>alphaTo <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0.6</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>color <span style="color: #339933;">=</span> 0xFFFFFF<span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> effect<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> get rollOutEffect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>Effect <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> effect<span style="color: #339933;">:</span>Glow <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Glow<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>blurXTo <span style="color: #339933;">=</span> effect<span style="color: #339933;">.</span>blurYTo <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>alphaFrom <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0.6</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>alphaTo <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
			effect<span style="color: #339933;">.</span>color <span style="color: #339933;">=</span> 0xFFFFFF<span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span> effect<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
  	<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>	
<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Application<span style="color: #339933;">&gt;</span></pre></div></div>

<p>O exemplo pode ser acessado <a href="http://www.flexpernambuco.com.br/exemplos/exemploEfeito/exemploEfeito.html" target="_blank">clicando aqui</a><br />
O código está habilitado.</p>
<p>Abraços,</p>
<p>Juliano Mendes</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="200" height="100" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="id" value="filters" /><param name="quality" value="high" /><param name="bgcolor" value="#869ca7" /><param name="allowScriptAccess" value="sameDomain" /><param name="src" value="http://www.flexpernambuco.com.br/exemplos/exemploEfeito/exemploEfeito.swf" /><embed id="filters" type="application/x-shockwave-flash" width="200" height="100" src="http://www.flexpernambuco.com.br/exemplos/exemploEfeito/exemploEfeito.swf" allowscriptaccess="sameDomain" bgcolor="#869ca7" quality="high"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=15</wfw:commentRss>
		</item>
		<item>
		<title>Liberada Documentação e Especificação do Flex 4</title>
		<link>http://www.flexpernambuco.com.br/?p=14</link>
		<comments>http://www.flexpernambuco.com.br/?p=14#comments</comments>
		<pubDate>Tue, 29 Jul 2008 09:50:49 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Dicas]]></category>

		<category><![CDATA[Documentação]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=14</guid>
		<description><![CDATA[Ae Pessoal,
Finalmente foi liberada a especificação e documentação da nova versão do Flex 4 denominada &#8220;Gumbo&#8221;.
Segue os links:
ASDoc
MXML 2009 - novo MXML
Gumbo SDK

Vamos correr atrás e ficar sempre atualizado!
Boa Sorte!!!
Abraços,
Juliano
]]></description>
			<content:encoded><![CDATA[<p>Ae Pessoal,</p>
<p>Finalmente foi liberada a especificação e documentação da nova versão do Flex 4 denominada &#8220;Gumbo&#8221;.</p>
<p>Segue os links:</p>
<p><a href="http://livedocs.adobe.com/flex/gumbo/langref/" target="_blank">ASDoc</a><a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo" target="_blank"><br />
</a><a href="http://opensource.adobe.com/wiki/display/flexsdk/MXML+2009" target="_blank">MXML 2009 - novo MXML</a><a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo" target="_blank"><br />
</a><a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo">Gumbo SD</a><a href="http://opensource.adobe.com/wiki/display/flexsdk/Gumbo" target="_blank">K<br />
</a></p>
<p>Vamos correr atrás e ficar sempre atualizado!</p>
<p>Boa Sorte!!!</p>
<p>Abraços,</p>
<p>Juliano</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=14</wfw:commentRss>
		</item>
		<item>
		<title>Relatórios usando FlexReport</title>
		<link>http://www.flexpernambuco.com.br/?p=13</link>
		<comments>http://www.flexpernambuco.com.br/?p=13#comments</comments>
		<pubDate>Wed, 09 Jul 2008 22:54:49 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=13</guid>
		<description><![CDATA[Olá amigos,
Atendendo a vários pedidos, estou iniciando uma série de posts de como criar Relatórios no Flex utilizando o FlexReport.
Para que o exemplo funcione você deve ter baixado a lib do FlexReport clicando aqui e também a lib AlivePDF clicando aqui.
No exemplo utilizo Flex+PHP+Mysql porém sem a utilização de AMFPHP.
Segue a estrutura do projeto no [...]]]></description>
			<content:encoded><![CDATA[<p>Olá amigos,</p>
<p>Atendendo a vários pedidos, estou iniciando uma série de posts de como criar Relatórios no Flex utilizando o FlexReport.<br />
Para que o exemplo funcione você deve ter baixado a lib do FlexReport <a href="http://www.kemelyon.com/bts/" target="_blank">clicando aqui</a> e também a lib AlivePDF <a href="http://alivepdf.bytearray.org/" target="_blank">clicando aqui</a>.<br />
No exemplo utilizo Flex+PHP+Mysql porém sem a utilização de AMFPHP.</p>
<p>Segue a estrutura do projeto no FlexBuilder:<br />
<img style="vertical-align: text-bottom;" src="http://www.flexpernambuco.com.br/uploads/post/flexreport/screen01.jpg" alt="Estrutura" width="269" height="256" /></p>
<ul>
<li><strong>/assets/img</strong> &#8211;&gt; contém o logo que será mostrado no cabeçalho do relatório;</li>
<li> <strong>/database </strong>&#8211;&gt; contém os arquivos .php do projeto</li>
<li> <strong>/libs </strong>&#8211;&gt; contém as bibliotecas utilizadas no projeto, neste caso AlivePDF</li>
<li><strong>/libs/reports</strong> &#8211;&gt; contém os arquivos do FlexReport</li>
<li> <strong>/reports </strong>&#8211;&gt; contém todos os arquivos dos nossos relatórios e objetos customizados do FlexReport</li>
</ul>
<p>A seguir vamos explicar todos os componentes distribuídos pelo FlexReport que serão utilizados na criação de um relatório:</p>
<ul>
<li>Body &#8211;&gt; componente que indica o corpo do relatório;</li>
<li>Page &#8211;&gt; componente que indica a página do relatório;</li>
<li>Preview &#8211;&gt; componente de pré-visualização de um relatório, contém todos os controles de Zoom de página, movimentação entre páginas e thumbs das páginas;</li>
<li>PrintComponent &#8211;&gt; herda de um Canvas, utilizado para impressão no relatório de outros componentes MXML dentro dele.</li>
<li>PrintTextArea &#8211;&gt; componente utilizado para imprimir textos dentro do relatório;</li>
<li>Report &#8211;&gt; componente principal que indica um relatório;</li>
<li>ReportDatagris &#8211;&gt; componente utilizado para impressão de uma grid no relatório.</li>
</ul>
<p>Os fontes destes componentes encontram-se na pasta /org/print do FlexReport e podem ser modificados a fim de implementar alguma nova funcionalidade ou fazer a tradução para o português de seus componentes.</p>
<p>Um relatório básico é composto das seguintes partes:<br />
- Um Cabeçalho (Header);<br />
- Body (Corpo do relatório);<br />
- Rodapé (Footer).</p>
<p>Vamos então criar templates para o Cabeçalho e Rodapé dos relatórios. Estes componentes serão reutilizados em todos os nossos relatórios.</p>
<p>Vamos criar o arquivo Header.mxml e digitar o código a seguir:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>PrintComponent xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;libs.reports.org.print.*&quot;</span> 
	xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> 
	width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;400&quot;</span> 
	height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;78&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
    	<span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span>CDATA<span style="color: #009900;">&#91;</span>
&nbsp;
		    <span style="color: #009900;">&#91;</span>Bindable<span style="color: #009900;">&#93;</span>
		    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">var</span> title<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Título do Relatório&quot;</span><span style="color: #339933;">;</span>
    		<span style="color: #009900;">&#91;</span>Bindable<span style="color: #009900;">&#93;</span>
    		<span style="color: #009900;">&#91;</span>Embed<span style="color: #009900;">&#40;</span>source<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/assets/img/eSolicite48x48.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span> 
		    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">var</span> logo<span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">Class</span><span style="color: #339933;">;</span>
&nbsp;
    	<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;E-Solicite&quot;</span> color<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#000000&quot;</span> fontWeight<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;bold&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;16&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> left<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Página: {pageNumber}&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;12&quot;</span> right<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Image x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;23&quot;</span> source<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{logo}&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{title}&quot;</span> color<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#000000&quot;</span> fontWeight<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;bold&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;12&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;32&quot;</span> left<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;47&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{date} as {time}&quot;</span> color<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#000000&quot;</span> fontWeight<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;normal&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;12&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;51&quot;</span> left<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;47&quot;</span><span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>PrintComponent<span style="color: #339933;">&gt;</span></pre></div></div>

<p>screen Header:<br />
<img style="vertical-align: text-bottom;" src="http://www.flexpernambuco.com.br/uploads/post/flexreport/screen02.jpg" alt="" width="417" height="98" /></p>
<p>Então vamos criar o arquivo Footer.mxml e digitar o código a seguir:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>PrintComponent xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;libs.reports.org.print.*&quot;</span> 
	xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> 
	width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;400&quot;</span> 
	height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;30&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;E-Solicite&quot;</span> color<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#000000&quot;</span> fontWeight<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;bold&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;16&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> left<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Página {pageNumber}&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;12&quot;</span> right<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>PrintComponent<span style="color: #339933;">&gt;</span></pre></div></div>

<p>screen Footer:<br />
<img style="vertical-align: text-bottom;" src="http://www.flexpernambuco.com.br/uploads/post/flexreport/screen03.jpg" alt="" width="415" height="46" /></p>
<p>Com o nosso template do cabeçalho e rodapé criados, agora vamos criar o template do relatório:</p>
<p>Nosso template do relatório será composto de um Cabeçalho, Corpo e Rodapé e será um componente do tipo Report. Dentro do nosso corpo vamos adicionar um componente do tipo ReportDataGrid.<br />
Vamos então criar o arquivo rListagem.mxml com o seguinte código:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>Report xmlns<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;libs.reports.org.print.*&quot;</span> xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;595&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;842&quot;</span> xmlns<span style="color: #339933;">:</span>report<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;*&quot;</span> xmlns<span style="color: #339933;">:</span>reports<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;reports.*&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;!--</span> REPORT LAYOUT <span style="color: #339933;">--&gt;</span>
	<span style="color: #339933;">&lt;</span>reports<span style="color: #339933;">:</span><span style="color: #990000;">Header</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;header&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;100%&quot;</span> showInAllPages<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">/&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>Body width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;100%&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;100%&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>ReportDataGrid id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;grid&quot;</span> sizeToPage<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> <span style="color: #990000;">wordWrap</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;100%&quot;</span> fontSize<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;9&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;/</span>Body<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>reports<span style="color: #339933;">:</span>Footer width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;100%&quot;</span> showInFirstPage<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> showInMiddlePages<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> showInLastPage<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span><span style="color: #339933;">/&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span>CDATA<span style="color: #009900;">&#91;</span>
			<span style="color: #000000; font-weight: bold;">public</span> override <span style="color: #000000; font-weight: bold;">function</span> loadData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> void
			<span style="color: #009900;">&#123;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>Report<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Screen Template:<br />
<img style="vertical-align: text-bottom;" src="http://www.flexpernambuco.com.br/uploads/post/flexreport/screen04.jpg" alt="" width="513" height="387" /></p>
<p>Vamos agora criar nosso componente de previsualização. Vamos criar o arquivo ReportPreview.mxml com o seguinte código:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Canvas xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> 
	creationComplete<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;initApplication()&quot;</span> 
	xmlns<span style="color: #339933;">:</span>ns1<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;libs.reports.org.print.*&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span>CDATA<span style="color: #009900;">&#91;</span> 
			import libs<span style="color: #339933;">.</span>reports<span style="color: #339933;">.</span>org<span style="color: #339933;">.</span>doc<span style="color: #339933;">.</span>PaperFormat<span style="color: #339933;">;</span>
			import libs<span style="color: #339933;">.</span>reports<span style="color: #339933;">.</span>org<span style="color: #339933;">.</span><span style="color: #990000;">print</span><span style="color: #339933;">.</span>Report<span style="color: #339933;">;</span>
			import libs<span style="color: #339933;">.</span>reports<span style="color: #339933;">.</span>templates<span style="color: #339933;">.</span>dataproviders<span style="color: #339933;">.</span>DemoReportDP<span style="color: #339933;">;</span>
			import libs<span style="color: #339933;">.</span>reports<span style="color: #339933;">.</span>org<span style="color: #339933;">.</span>doc<span style="color: #339933;">.</span>Document<span style="color: #339933;">;</span>
&nbsp;
	        <span style="color: #009900;">&#91;</span>Bindable<span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">var</span> doc<span style="color: #339933;">:</span>Document <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	        <span style="color: #009900;">&#91;</span>Bindable<span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">var</span> datasourceText<span style="color: #339933;">:</span>ReportDPText<span style="color: #339933;">;</span>
	        <span style="color: #009900;">&#91;</span>Bindable<span style="color: #009900;">&#93;</span> <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">var</span> title<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
	        <span style="color: #666666; font-style: italic;">/** Função que receberá o Relatório a ser impresso **/</span>
	        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> execute<span style="color: #009900;">&#40;</span>report<span style="color: #339933;">:</span>Report <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void
	        <span style="color: #009900;">&#123;</span>
	         	<span style="color: #666666; font-style: italic;">/** Criando a instancia do documento **/</span>
	         	<span style="color: #666666; font-style: italic;">/** Pode-se passar o formato do papel do relatório **/</span>
	         	doc <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Document<span style="color: #009900;">&#40;</span>report<span style="color: #339933;">,</span> datasourceText<span style="color: #339933;">,</span> PaperFormat<span style="color: #339933;">.</span>A4<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	         	<span style="color: #666666; font-style: italic;">/** Script php de geração do PDF **/</span>
	         	doc<span style="color: #339933;">.</span>pdfScript <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://www.flexpernambuco.com.br/solicite/libs/create.php&quot;</span><span style="color: #339933;">;</span>
	         	doc<span style="color: #339933;">.</span>pdfEnabled <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	        	doc<span style="color: #339933;">.</span>title <span style="color: #339933;">=</span> title<span style="color: #339933;">;</span>
&nbsp;
	        	printPreview<span style="color: #339933;">.</span>doc <span style="color: #339933;">=</span> doc<span style="color: #339933;">;</span>
	        <span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> initApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void
			<span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>ns1<span style="color: #339933;">:</span>Preview id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;printPreview&quot;</span> left<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span> right<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span> top<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span> bottom<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>ns1<span style="color: #339933;">:</span>Preview<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Canvas<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Em nosso exemplo temos uma tela de listagem referente a tabela Tipos de Solicitação. Vamos agora implementar o exemplo.</p>
<p>Parte de acesso ao banco de dados:<br />
arquivo config.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #666666; font-style: italic;">//**********************************************//</span>
<span style="color: #666666; font-style: italic;">// Constantes de Banco de Dados:</span>
<span style="color: #666666; font-style: italic;">// Nao esqueca de mudar esses dados ao publicar no servidor</span>
<span style="color: #666666; font-style: italic;">//**********************************************//</span>
<span style="color: #990000;">DEFINE</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'NOMESERV'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'localhost'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">DEFINE</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'NOMEUSU'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'root'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">DEFINE</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'SENHADB'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">DEFINE</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'NOMEDB'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'myDB'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">//**********************************************//</span>
<span style="color: #666666; font-style: italic;">// Database Query:</span>
<span style="color: #666666; font-style: italic;">//**********************************************//</span>
<span style="color: #000033;">$con</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span>NOMESERV<span style="color: #339933;">,</span>NOMEUSU<span style="color: #339933;">,</span>SENHADB<span style="color: #009900;">&#41;</span> OR <span style="color: #990000;">DIE</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Impossivel Conectar ao Banco de Dados&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">@</span><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span>NOMEDB<span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;ACESSO BLOQUEADO!! Nao foi possivel selecionar o Banco de Dados $query.&quot;</span> <span style="color: #339933;">.</span> NOMEDB<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Arquivo GetListTipoSolicitacao.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #666666; font-style: italic;">/** Conexao com o banco de dados **/</span>
    <span style="color: #b1b100;">require</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
    <span style="color: #666666; font-style: italic;">/** Variavel que retorna o XML ao Front-end **/</span>
	<span style="color: #000033;">$return</span> <span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">/** Inicio do XML **/</span>
	<span style="color: #000033;">$return</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;?xml version='1.0' encoding='iso-8859-1'?&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;root&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/** Realiza a conexao com o banco **/</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$con</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">/** Cursor **/</span>
		<span style="color: #000033;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Select cd_tipo_solicitacao, &quot;</span>
		       <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;       ds_tipo_solicitacao  &quot;</span>
		       <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;  From tipo_solicitacao     &quot;</span>
		       <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; Where 1 = 1 &quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">/** FILTROS **/</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$_POST</span><span style="color: #009900;">&#91;</span>ds_tipo_solicitacao<span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		  <span style="color: #000033;">$sql</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; And ds_tipo_solicitacao LIKE '%&quot;</span><span style="color: #339933;">.</span><span style="color: #000033;">$_POST</span><span style="color: #009900;">&#91;</span>ds_tipo_solicitacao<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;%' &quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$_POST</span><span style="color: #009900;">&#91;</span>cd_tipo_solicitacao<span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		  <span style="color: #000033;">$sql</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; And cd_tipo_solicitacao = &quot;</span><span style="color: #339933;">.</span><span style="color: #000033;">$_POST</span><span style="color: #009900;">&#91;</span>cd_tipo_solicitacao<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/** Ordernacao **/</span>
		<span style="color: #000033;">$sql</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; order by ds_tipo_solicitacao &quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">/** Executa a Query **/</span>
		<span style="color: #000033;">$query</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000033;">$totRows</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_num_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$totRows</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	        <span style="color: #666666; font-style: italic;">/** Realiza um Loop em todos os registros e monta o XML **/</span>
			<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #000033;">$record</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$query</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;tipo_solicitacao&gt;&quot;</span><span style="color: #339933;">;</span>
					<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;cd_tipo_solicitacao&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000033;">$record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cd_tipo_solicitacao</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/cd_tipo_solicitacao&gt;&quot;</span><span style="color: #339933;">;</span>
					<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;ds_tipo_solicitacao&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000033;">$record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ds_tipo_solicitacao</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/ds_tipo_solicitacao&gt;&quot;</span><span style="color: #339933;">;</span>
				<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/tipo_solicitacao&gt;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
	  <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">/** retorna um Erro no XML **/</span>
		<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;error_text&gt;Problemas com a conexao ao banco de dados&lt;/error_text&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/** Finaliza o XML **/</span>
	<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;message_text&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000033;">$totRows</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/message_text&gt;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000033;">$return</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;&lt;/root&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #990000;">mysql_free_result</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$query</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">print</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$return</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Arquivo reportFlex.mxml: Application do nosso exemplo:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Application xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;absolute&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;!--</span> HTTP Server <span style="color: #339933;">-</span> Get information from Database <span style="color: #339933;">--&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>HTTPService resultFormat<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;e4x&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;listTipoSolicitacao&quot;</span> showBusyCursor<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> url<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://localhost/reportFlex/database/GetListTipoSolicitacao.php&quot;</span> method<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;POST&quot;</span> fault<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;falhouHTTP(event);&quot;</span> result<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;resultadoHTTP(event.result);&quot;</span><span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>request<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>cd_tipo_solicitacao<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span>cd_tipo_solicitacao<span style="color: #339933;">.</span>text<span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>cd_tipo_solicitacao<span style="color: #339933;">&gt;</span>
            <span style="color: #339933;">&lt;</span>ds_tipo_solicitacao<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#123;</span>ds_tipo_solicitacao<span style="color: #339933;">.</span>text<span style="color: #339933;">.</span>toUpperCase<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">&lt;/</span>ds_tipo_solicitacao<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>request<span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>HTTPService<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
    	<span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span>CDATA<span style="color: #009900;">&#91;</span>
			import mx<span style="color: #339933;">.</span>rpc<span style="color: #339933;">.</span>events<span style="color: #339933;">.</span>FaultEvent<span style="color: #339933;">;</span>
			import mx<span style="color: #339933;">.</span>controls<span style="color: #339933;">.</span>Alert<span style="color: #339933;">;</span>
			import reports<span style="color: #339933;">.</span>ReportPreview<span style="color: #339933;">;</span>
			import reports<span style="color: #339933;">.</span>rListagem<span style="color: #339933;">;</span> 
			import mx<span style="color: #339933;">.</span>containers<span style="color: #339933;">.</span>Box<span style="color: #339933;">;</span>	
			import mx<span style="color: #339933;">.</span>managers<span style="color: #339933;">.</span>PopUpManager<span style="color: #339933;">;</span>
&nbsp;
    		<span style="color: #666666; font-style: italic;">/** responsavel por mostrar o erro, caso ocorra no HTTP server **/</span>
			<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> falhouHTTP<span style="color: #009900;">&#40;</span>faultEvent<span style="color: #339933;">:</span>FaultEvent<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span>
					Alert<span style="color: #339933;">.</span>show<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Requisição falhou: ['</span> <span style="color: #339933;">+</span> faultEvent<span style="color: #339933;">.</span>fault<span style="color: #339933;">.</span>faultCode <span style="color: #339933;">+</span> <span style="color: #0000ff;">'='</span> <span style="color: #339933;">+</span> faultEvent<span style="color: #339933;">.</span>fault<span style="color: #339933;">.</span>name <span style="color: #339933;">+</span> <span style="color: #0000ff;">']'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Erro'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">/** preenche a grid com o resultado XML do HTTP server **/</span>
			<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> resultadoHTTP<span style="color: #009900;">&#40;</span>resultObject<span style="color: #339933;">:</span>Object<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #b1b100;">for</span> <span style="color: #990000;">each</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">var</span> message<span style="color: #339933;">:</span>String in resultObject<span style="color: #339933;">.</span>message_text<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			        <span style="color: #666666; font-style: italic;">/** atualiza status **/</span>
			        gridStatus<span style="color: #339933;">.</span>text <span style="color: #339933;">=</span> message <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; registro(s) retornados...&quot;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">/** Imprime relatório de listagem **/</span>
			<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> executaRelatorio<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void<span style="color: #009900;">&#123;</span>
&nbsp;
			   <span style="color: #000000; font-weight: bold;">var</span> titleW<span style="color: #339933;">:</span>Box <span style="color: #339933;">=</span> Box<span style="color: #009900;">&#40;</span>PopUpManager<span style="color: #339933;">.</span>createPopUp<span style="color: #009900;">&#40;</span>this<span style="color: #339933;">,</span>Box<span style="color: #339933;">,</span><span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			   <span style="color: #666666; font-style: italic;">// Objeto de Previsualização do Laudo</span>
			   <span style="color: #000000; font-weight: bold;">var</span> report<span style="color: #339933;">:</span>ReportPreview <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ReportPreview<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			   <span style="color: #666666; font-style: italic;">// Nosso relatório</span>
			   <span style="color: #000000; font-weight: bold;">var</span> listagem<span style="color: #339933;">:</span>rListagem <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> rListagem<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			   <span style="color: #666666; font-style: italic;">// Popup</span>
			   titleW<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> Application<span style="color: #339933;">.</span>application<span style="color: #339933;">.</span>width<span style="color: #339933;">;</span>
			   titleW<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> Application<span style="color: #339933;">.</span>application<span style="color: #339933;">.</span>height<span style="color: #339933;">;</span>
			   report<span style="color: #339933;">.</span>width <span style="color: #339933;">=</span> titleW<span style="color: #339933;">.</span>width<span style="color: #339933;">;</span>
			   report<span style="color: #339933;">.</span>height <span style="color: #339933;">=</span> titleW<span style="color: #339933;">.</span>height<span style="color: #339933;">;</span>
&nbsp;
			   titleW<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>report<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			   report<span style="color: #339933;">.</span>addChild<span style="color: #009900;">&#40;</span>listagem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			   <span style="color: #666666; font-style: italic;">// Atibuindo as informações da Grid para a Grid </span>
			   <span style="color: #666666; font-style: italic;">// do nosso Relatório</span>
			   listagem<span style="color: #339933;">.</span>grid<span style="color: #339933;">.</span>dataProvider <span style="color: #339933;">=</span> grid<span style="color: #339933;">.</span>dataProvider<span style="color: #339933;">;</span>
			   listagem<span style="color: #339933;">.</span>grid<span style="color: #339933;">.</span>columns <span style="color: #339933;">=</span> grid<span style="color: #339933;">.</span>columns<span style="color: #339933;">;</span>
			   listagem<span style="color: #339933;">.</span><span style="color: #990000;">header</span><span style="color: #339933;">.</span>title <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Relatório: Listagem de Tipos de Solicitação&quot;</span><span style="color: #339933;">;</span>
&nbsp;
			   report<span style="color: #339933;">.</span>execute<span style="color: #009900;">&#40;</span>listagem<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   
			<span style="color: #009900;">&#125;</span>
&nbsp;
    	<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>
    <span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>DataGrid dataProvider<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;{listTipoSolicitacao.lastResult.tipo_solicitacao}&quot;</span> x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;57&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;447&quot;</span> height<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;193&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;grid&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>columns<span style="color: #339933;">&gt;</span>
  	  	    <span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>DataGridColumn visible<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> headerText<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Código&quot;</span> dataField<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cd_tipo_solicitacao&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;80&quot;</span><span style="color: #339933;">/&gt;</span>
			<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>DataGridColumn visible<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;true&quot;</span> headerText<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Descrição&quot;</span> dataField<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ds_tipo_solicitacao&quot;</span><span style="color: #339933;">/&gt;</span>
		<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>columns<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>DataGrid<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Button x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;379&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;27&quot;</span> label<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Atualizar&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;btnAtualizar&quot;</span> click<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;listTipoSolicitacao.send()&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Button x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;284&quot;</span> label<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Visualizar relatório&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;btnPreview&quot;</span> click<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;executaRelatorio();&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>TextInput x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;27&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;83&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;cd_tipo_solicitacao&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>TextInput x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;101&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;27&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;270&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;ds_tipo_solicitacao&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Código&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;83&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;258&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;447&quot;</span> id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;gridStatus&quot;</span><span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Label x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;101&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;10&quot;</span> text<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Descrição&quot;</span> width<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;270&quot;</span><span style="color: #339933;">/&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Application<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Espero que todos gostem e que este exemplo ajude.</p>
<p>O exemplo pode ser acessado <a href="http://www.flexpernambuco.com.br/exemplos/reportFlex/reportFlex.html" target="_blank">clicando aqui</a><br />
O código do exemplo pode ser baixado <a href="http://www.flexpernambuco.com.br/exemplos/reportFlex/reportFlex.zip" target="_blank">clicando aqui</a></p>
<p>Abraços,</p>
<p>Juliano Mendes</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=13</wfw:commentRss>
		</item>
		<item>
		<title>Relatórios em PDF usando PHP e Flex</title>
		<link>http://www.flexpernambuco.com.br/?p=12</link>
		<comments>http://www.flexpernambuco.com.br/?p=12#comments</comments>
		<pubDate>Mon, 07 Jul 2008 03:22:53 +0000</pubDate>
		<dc:creator>ricardo.cerqueira</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=12</guid>
		<description><![CDATA[Olá amigos,
Nesse post vou mostrar como faço meus relatórios em PHP e consigo acessar através do Flex, bem estou levando em consideração que você conheça a classe FPDF, que pode ser baixada clicando aqui, e também conheça o AMFPHP que é responsável pela conexão entre Flex e PHP que pode ser baixado clicando aqui, e [...]]]></description>
			<content:encoded><![CDATA[<p>Olá amigos,</p>
<p>Nesse post vou mostrar como faço meus relatórios em PHP e consigo acessar através do Flex, bem estou levando em consideração que você conheça a classe FPDF, que pode ser baixada <a href="http://www.fpdf.org" target="_blank">clicando aqui</a>, e também conheça o AMFPHP que é responsável pela conexão entre Flex e PHP que pode ser baixado <a href="http://www.amfphp.org" target="_blank">clicando aqui</a>, e que você já tenha uma conexão com algum banco de dados, neste exemplo vou usar o MySQL.</p>
<p>Então vamos criar o arquivo reports.php e digitar o código em PHP:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;pdf.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> reports <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">function</span> reports<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;root&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;senha&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;meubanco&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">function</span> meuRelatorio<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000033;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;select * from clientes order by nome&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000033;">$pdf</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PDF<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'L'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Listagem dos clientes&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Open</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">AddPage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFont</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Arial'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'B'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Cell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Id&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Cell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Nome&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetX</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">-10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">line</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">25</span><span style="color: #339933;">,</span> <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">GetX</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">25</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetXY</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">27</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">SetFont</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Arial'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 	 		
&nbsp;
      <span style="color: #000033;">$ds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000033;">$rs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_object</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$ds</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
         <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Cell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #000033;">$rs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID_CLIENTE</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Cell</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span> <span style="color: #000033;">$rs</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">NOME</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #000033;">$arquivo</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;tmp/relatorio_&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">session_id</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.pdf&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000033;">$pdf</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">Output</span><span style="color: #009900;">&#40;</span> <span style="color: #000033;">$arquivo</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'F'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">return</span> <span style="color: #000033;">$arquivo</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Até aí o fizemos é o seguinte, conectamos ao banco, montamos o relatório em pdf, gravamos o arquivo com um nome temporário usando a session_id, e retornamos o nome do arquivo para o flex, ok?</p>
<p>Agora vamos ao Flex, faremos uma aplicação simples apenas com um botão para chamar o metodo “meuRelatorio” e abrir o PDF em outra janela, então vamos lá.</p>
<p>Para manter uma conexão com o PHP eu uso um package que nomeio de ConexaoRemota, então crie um arquivo chamado ConexaoRemota.as com o seguinte conteúdo:</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">package</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">flash.net.NetConnection</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">flash.net.ObjectEncoding</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">flash.events.SecurityErrorEvent</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ConexaoRemota <span style="color: #000000; font-weight: bold;">extends</span> NetConnection <span style="color: #009900;">&#123;</span>
               <span style="color: #000000; font-weight: bold;">public</span> function ConexaoRemota<span style="color: #009900;">&#40;</span>strURL<span style="color: #339933;">:</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                     objectEncoding <span style="color: #339933;">=</span> ObjectEncoding.<span style="color: #006633;">AMF0</span><span style="color: #339933;">;</span>
&nbsp;
                     <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>strURL<span style="color: #009900;">&#41;</span>
                     	connect<span style="color: #009900;">&#40;</span>strURL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
               <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Agora inicie uma nova aplicação no Flex, e digite o seguinte código:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #339933;">&lt;</span>?xml version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;1.0&quot;</span> encoding<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Application xmlns<span style="color: #339933;">:</span>mx<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;absolute&quot;</span> creationComplete<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;initApp()&quot;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;!</span><span style="color: #009900;">&#91;</span>CDATA<span style="color: #009900;">&#91;</span>
		<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Script<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>mx<span style="color: #339933;">:</span>Button x<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;26&quot;</span> y<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;25&quot;</span> label<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Visualizar relatório&quot;</span> click<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;abrePDF()&quot;</span><span style="color: #339933;">/&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>mx<span style="color: #339933;">:</span>Application<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Na Tag script digite o seguinte código:</p>

<div class="wp_syntax"><div class="code"><pre class="php">import mx<span style="color: #339933;">.</span>controls<span style="color: #339933;">.</span>Alert<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">var</span> gateway<span style="color: #339933;">:</span>ConexaoRemota<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> initApp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span>
	gateway <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ConexaoRemota<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://127.0.0.1/relatorios/amfphp/gateway.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// caminho do arquivo gateway.php do AMFPHP</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> abrePDF<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span>
	gateway<span style="color: #339933;">.</span>call<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;reports.meuRelatorio&quot;</span><span style="color: #339933;">,</span><span style="color: #000000; font-weight: bold;">new</span> Responder<span style="color: #009900;">&#40;</span>onResultPDF<span style="color: #339933;">,</span>onFaultAmf<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// chama o método meuRelatorio lá do arquivo reports.php</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onFaultAmf<span style="color: #009900;">&#40;</span>result<span style="color: #339933;">:*</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span>
	Alert<span style="color: #339933;">.</span>show<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Erro no processamento!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> onResultPDF<span style="color: #009900;">&#40;</span>result<span style="color: #339933;">:*</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>void <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #990000;">file</span><span style="color: #339933;">:</span>FileReference<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">var</span> urlString<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://127.0.0.1/relatorios/amfphp/services/&quot;</span><span style="color: #339933;">+</span>result<span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// local que criou o arquivo PDF</span>
	<span style="color: #000000; font-weight: bold;">var</span> request<span style="color: #339933;">:</span>URLRequest <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> URLRequest<span style="color: #009900;">&#40;</span>urlString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	navigateToURL<span style="color: #009900;">&#40;</span>request<span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;_blank&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">// abre o PDF em outra janela</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Pronto! basta rodar sua aplicação e vê se funciona rsss, bem espero que tenha ficado claro pra vocês, abaixo você encontra a aplicação rodando para testar.</p>
<p>Espero ver os comentários de vocês sobre este post.</p>
<p>Abraços,</p>
<p>Ricardo Cerqueira<br />
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="filters" width="450" height="200" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"><param name="movie" value="http://www.rcerqueira.com/livedemo/relatorio.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#869ca7" /><param name="allowScriptAccess" value="sameDomain" /><embed src="http://www.rcerqueira.com/livedemo/relatorio.swf" quality="high" bgcolor="#869ca7" width="100%" height="100%" name="filters" align="middle" play="true" loop="false"	quality="high" allowScriptAccess="sameDomain"	type="application/x-shockwave-flash"	pluginspage="http://www.adobe.com/go/getflashplayer"><br /></embed></p>
<p>	</object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=12</wfw:commentRss>
		</item>
		<item>
		<title>Flex Builder</title>
		<link>http://www.flexpernambuco.com.br/?p=11</link>
		<comments>http://www.flexpernambuco.com.br/?p=11#comments</comments>
		<pubDate>Fri, 04 Jul 2008 13:13:42 +0000</pubDate>
		<dc:creator>flexpernambuco</dc:creator>
		
		<category><![CDATA[Dicas]]></category>

		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.flexpernambuco.com.br/?p=11</guid>
		<description><![CDATA[Para quem ainda tem dúvidas de como baixar a IDE de desenvolvimento do Flex, chamada Flex Builder ai vai os links.
A IDE não é Free. Ela é trial por 60 dias. Porém ela é Totalmente Free para estudantes e instituições de ensino.
Para download acesse: http://www.adobe.com/products/flex/
Para que a Adobe libere uma licença, você deve provar que [...]]]></description>
			<content:encoded><![CDATA[<p>Para quem ainda tem dúvidas de como baixar a IDE de desenvolvimento do Flex, chamada Flex Builder ai vai os links.</p>
<p>A IDE não é Free. Ela é trial por 60 dias. Porém ela é Totalmente Free para estudantes e instituições de ensino.</p>
<p>Para download acesse: <a href="http://www.adobe.com/products/flex/" target="_blank">http://www.adobe.com/products/flex/</a></p>
<p>Para que a Adobe libere uma licença, você deve provar que é estudante enviando uma cópia da sua carteira de estudante ou contrato com a Universidade através do Site: <a href="https://www.flexregistration.com/" target="_blank">https://www.flexregistration.com/</a><br />
Eles enviam uma licença em até 3 dias.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.flexpernambuco.com.br/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
	</channel>
</rss>
