Muito obrigado, ajudou D+
vlw mesmo!!!
On 25 out, 13:33, Luis Eduardo - Suprasis Softwares
<[EMAIL PROTECTED]> wrote:
> MEU JISUIS CRISTIM!!! que tamanho de código difícil!
>
> Bom... fiz o seguinte... coloquei um prontiJob imprimindo pra te
> mostrar como funciona a lógica usando seu código mesmo. Mas precisa
> mexer ainda pra conseguir um bom resultado final ok?
> O normal de usar o flexPrintJob é ter um MXML específico para ser
> enviado à impressora. Isso porque é mais dificil de enxergar quando vc
> muda tanto a tela usando o states. E a tela feita para impressão
> costuma ser muito diferente do que a visualizada no monitor.
> Pra fazer usando o seu jeito (com states) vc precisa colocar uma
> HBox que seja pai de todos os outros componentes e dar um ID a ela.
> Depois vc adiciona ao FlexPrintJob esse id.
> eu fiz o exemplo usando sua Hbox chamada: hbox12... mas o correto
> mesmo é alguma outra que seja mais externa mas eu achei dificil
> encontrar.. então deixo contigo.
>
> primeira coisa é criar a função que trata a impressão:
>
> private function imprime():void {
> var printJob:FlexPrintJob = new FlexPrintJob();
> printJob.printAsBitmap = false;
>
> if (printJob.start()) {
>
> this.width=printJob.pageWidth;
> this.height=printJob.pageHeight;
>
> printJob.addObject( hbox12 );
>
> printJob.send();
> }
> }
>
> lembrando de adicionar o import do FlexPrintJob:
> import mx.printing.FlexPrintJob;
>
> depois vc precisa fazer o botão de "imprimir" chamar esse codigo:
> <mx:Button label="Imprimir" click="imprime()"/>
>
> e boa. Já deve imprimir. Mas procure fazer um mxml separado. Fica bem
> mais tranquilo de programar. Olha na documentação do FlexPrintJob que
> tem um exemplo bem tranquilo lá.
>
> Abraço,
> Luís Eduardo
>
> FabianoB escreveu:
>
>
>
> > <b>Olá Luiz Eduardo, ta na mão o código, se puder ajudar agradeço,
> > valeu mesmo.</b>
>
> > <?xml version="1.0" encoding="utf-8"?>
> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> > layout="absolute" backgroundGradientColors="[#ffffff, #ff7d7d]"
> > height="750" width="780">
>
> > <mx:Script>
> > <![CDATA[
> > import mx.rpc.events.ResultEvent;
>
> > public function gravarUsuario(): void {
> > roMeuProjeto.gravarUsuario.send();
> > currentState="imprimir"
> > }
>
> > ]]>
> > </mx:Script>
>
> > <mx:states>
> > <mx:State name="imprimir">
> > <mx:RemoveChild target="{button1}"/>
> > <mx:RemoveChild target="{text1}"/>
> > <mx:RemoveChild target="{applicationcontrolbar1}"/>
> > <mx:RemoveChild target="{text6}"/>
> > <mx:RemoveChild target="{hbox13}"/>
> > <mx:RemoveChild target="{form1}"/>
> > <mx:RemoveChild target="{text7}"/>
> > <mx:AddChild position="lastChild">
> > <mx:HBox x="57" y="161" width="658" height="44">
> > <mx:Text text="Seu cadastro foi efetuado
> > com sucesso! Clique no
> > botão ao lado para imprimir sua solicitação de reserva"
> > textAlign="center" width="487" fontWeight="bold" height="38"
> > fontSize="13"/>
> > <mx:Button label="Imprimir"/>
> > </mx:HBox>
> > </mx:AddChild>
> > <mx:SetProperty target="{hbox12}" name="height"
> > value="447"/>
> > <mx:SetProperty target="{hbox12}" name="y" value="213"/>
> > <mx:AddChild relativeTo="{hbox12}" position="lastChild">
> > <mx:Form width="100%" height="100%">
> > <mx:HBox width="615" height="22">
> > <mx:FormItem label="Data:">
> > <mx:Label text="Label"
> > width="101"/>
> > </mx:FormItem>
> > <mx:FormItem label="Hora:">
> > <mx:Label text="Label"
> > width="101"/>
> > </mx:FormItem>
> > <mx:FormItem label="Código:">
> > <mx:Label text="Label"
> > width="101"/>
> > </mx:FormItem>
> > </mx:HBox>
> > <mx:FormItem label="Nome"
> > fontWeight="bold">
> > <mx:TextInput width="547"
> > editable="false"/>
> > </mx:FormItem>
> > <mx:FormItem label="E-mail"
> > fontWeight="bold">
> > <mx:TextInput width="547"
> > editable="false"/>
> > </mx:FormItem>
> > <mx:FormItem label="Telefone"
> > fontWeight="bold">
> > <mx:TextInput width="274"
> > editable="false"/>
> > </mx:FormItem>
> > <mx:HBox width="526" height="20"
> > id="hbox8">
> > <mx:Text
> > text="Nome dos acompanhantes" width="234"
> > textAlign="left" fontWeight="bold"/>
> > <mx:Text
> > text="Data de nascimento" width="265"
> > textAlign="right" fontWeight="bold"/>
> > </mx:HBox>
> > <mx:HBox width="535" height="23"
> > id="hbox16">
> >
> > <mx:Label text="Label" width="378"/>
> >
> > <mx:Spacer width="20" height="20"/>
> >
> > <mx:Label text="Label" width="118"/>
> > </mx:HBox>
> > <mx:HBox width="535" height="23"
> > id="hbox14">
> >
> > <mx:Label text="Label" width="378"/>
> >
> > <mx:Spacer width="20" height="20"/>
> >
> > <mx:Label text="Label" width="118"/>
> > </mx:HBox>
> > <mx:HBox width="535" height="23"
> > id="hbox15">
> >
> > <mx:Label text="Label" width="378"/>
> >
> > <mx:Spacer width="20" height="20"/>
> >
> > <mx:Label text="Label" width="118"/>
> > </mx:HBox>
> > <mx:Text text="Período(s) escolhido(s)"
> > width="234"
> > textAlign="left" fontWeight="bold"/>
> > <mx:HBox width="615" height="22">
> > <mx:Label
> > text="Label" width="301"/>
> > <mx:Label
> > text="Label" width="301"/>
> > </mx:HBox>
> > <mx:HBox width="615" height="22">
> > <mx:Label
> > text="Label" width="301"/>
> > <mx:Label
> > text="Label" width="301"/>
> > </mx:HBox>
> > <mx:HBox width="615" height="22">
> > <mx:Label
> > text="Label" width="301"/>
> > <mx:Label
> > text="Label" width="301"/>
> > </mx:HBox>
> > <mx:HBox width="615" height="22">
> > <mx:Label
> > text="Label" width="301"/>
> > <mx:Label
> > text="Label" width="301"/>
> > </mx:HBox>
> > <mx:HBox width="615" height="22">
> > <mx:Label
> > text="Label" width="301"/>
> > <mx:Label
> > text="Label" width="301"/>
> > </mx:HBox>
> > <mx:HBox width="615" height="22">
> > <mx:Label
> > text="Label" width="301"/>
> > <mx:Text
> > text="Andar de preferência:" fontWeight="bold"/>
> > <mx:Label
> > text="Label" width="91"/>
> > </mx:HBox>
>
> > </mx:Form>
> > </mx:AddChild>
> > <mx:SetProperty name="height" value="100%"/>
> > <mx:AddChild position="lastChild">
> > <mx:VBox x="58" y="668" height="312" width="666">
> > <mx:Text text="Observações:" width="284"
> > height="20"
> > fontWeight="bold"/>
> > <mx:Text width="284" height="20"
> > text="a) Horário de entrada: 16
> > horas" fontWeight="bold"/>
> > <mx:Text width="284" height="20"
> > text="b) Horário de saída: 10
> > horas" fontWeight="bold"/>
> > <mx:Text width="666" height="31"
> > text="c) Desistência: é
> > obrigatória a comunicação com 10 dias de antecedência ao início do
> > período requerido, sob pena de pagamento integral." fontWeight="bold"/
>
> > <mx:Text width="666" height="20"
> > text="d) As roupas de cama, de
> > banho e redes de descanso para a sacada, devem ser levadas pelo
> > associado." fontWeight="bold"/>
> > <mx:Text text="A APMP cobrará para a
> > próxima temporada, o pacote
> > no valor de R$ 450,00 (quatrocentos e cinqüenta reais), importância
> > correspondente a 07 (sete) diárias, incluído o café da manhã para até
> > 05 (cinco) pessoas por apartamento e taxa de limpeza. O valor será
> > descontado na folha de pagamento do mês subseqüente ao uso, mediante
> > autorização concedida pelo associado no ato da inscrição." width="666"
> > height="61" textAlign="left"/>
> > <mx:Text width="666" height="37"
> > textAlign="left">
> > <mx:text>As normas de utilização
> > são as constantes do
> > Regulamento Geral do Uso de Bens da Sede Litorânea, sendo que qualquer
> > reclamação deverá ser encaminhada, por escrito, aos diretores da
> > Sede.</mx:text>
> > </mx:Text>
> > <mx:Text text="Maiores informações
> > poderão ser obtidas junto a
> > Secretaria da APMP com Silvana (0xx41) 3352-2919."/>
> > <mx:Text text="Limitando-nos ao exposto,
> > presta-se a ocasião para
> > manifestarmos a Vossa Excelência a garantia de nosso apreço e estima
> > pessoal." width="664"/>
> > </mx:VBox>
> > </mx:AddChild>
> > <mx:SetProperty name="width" value="100%"/>
> > <mx:AddChild position="lastChild">
> > <mx:Text text="Maria Tereza Uille Gomes
> > Presidente APMP"
> > textAlign="center" width="149" fontWeight="bold" y="988"
> > horizontalCenter="0"/>
> > </mx:AddChild>
> > <mx:AddChild position="lastChild">
> > <mx:Text text="Marcia Isabele Graf Beninca
> > Diretora"
> > textAlign="center" width="207" fontWeight="bold" y="1037"
> > horizontalCenter="-240.5"/>
> > </mx:AddChild>
> > <mx:AddChild position="lastChild">
> > <mx:Text textAlign="center" width="151"
> > fontWeight="bold" y="1037"
> > horizontalCenter="275.5" text="Wilson José Galheira Diretor"/>
> > </mx:AddChild>
> > </mx:State>
> > </mx:states>
> > <mx:ApplicationControlBar width="666" y="120" horizontalCenter="0"
> > id="applicationcontrolbar2">
> > <mx:Text text="Solicitação de reserva para uso da Sede Litorânea"
> > width="100%" height="100%" textAlign="center" fontWeight="bold"
> > fontSize="13" color="#ff0000" id="text5"/>
> > </mx:ApplicationControlBar>
> > <mx:Image source="icones/logo.png" y="10" horizontalCenter="0"/>
>
> > <mx:HBox y="186" width="666" height="544" horizontalCenter="1"
> > id="hbox12">
> > <mx:Form width="100%" height="100%" id="form1">
> > <mx:FormItem label="Associado" fontWeight="bold">
> > <mx:TextInput width="557" id="nome"
> > maxChars="100"/>
> > </mx:FormItem>
> > <mx:FormItem label="E-mail" fontWeight="bold"
> > id="formitem1">
> > <mx:TextInput width="557" color="#0000ff"
> > id="email" maxChars="50"/
>
> > </mx:FormItem>
> > <mx:FormItem label="Telefone" fontWeight="bold"
> > id="formitem2">
> > <mx:TextInput width="193" id="fone"
> > maxChars="9"/>
> > </mx:FormItem>
> > <mx:HBox width="526" height="20"
> > id="hbox11">
> >
> > <mx:Text text="Nome dos acompanhantes" width="234"
> > textAlign="left" fontWeight="bold"/>
> >
> > <mx:Text text="Data de nascimento" width="265"
>
> ...
>
> mais »- Ocultar texto entre aspas -
>
> - Mostrar texto entre aspas -
--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para [EMAIL PROTECTED]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev
-~----------~----~----~----~------~----~------~--~---