p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: Conversion problem


Message #1 by "Michel Medawar" <mmedawar@t...> on Thu, 13 Dec 2001 23:53:56 +0200
This is a multi-part message in MIME format.



------=_NextPart_000_0016_01C18431.6D9611E0

Content-Type: text/plain;

	charset="windows-1256"

Content-Transfer-Encoding: quoted-printable



Hi to all crystal report developers



A new day and a new problem :)

my god what a week...



my problem goes like this: i have a receipt to print,

in this receipt i have an amount let's say 100$,

what i usualy do is that i convert the amount to words

in vb and then i pass it as a parameter for the CR, like

"One Hundred Dollars Only", this works fine in case

of printing one receipt at a time, but when the operator

wants to print 5 or 6 receipts in one time.



So any one may sugest a way to resolve it?



Thanks in advance



Michel Medawar.








Message #2 by "Preethi" <preethi@s...> on Fri, 14 Dec 2001 08:36:40 +0600
This is a multi-part message in MIME format.



------=_NextPart_000_000C_01C1847A.73905580

Content-Type: text/plain;

	charset="windows-1256"

Content-Transfer-Encoding: quoted-printable



Use CR's built in function ToText



Preethi

  ----- Original Message -----

  From: Michel Medawar

  To: crystal_reports

  Sent: Friday, December 14, 2001 3:53 AM

  Subject: [crystal_reports] Conversion problem





  Hi to all crystal report developers



  A new day and a new problem :)

  my god what a week...



  my problem goes like this: i have a receipt to print,

  in this receipt i have an amount let's say 100$,

  what i usualy do is that i convert the amount to words

  in vb and then i pass it as a parameter for the CR, like

  "One Hundred Dollars Only", this works fine in case

  of printing one receipt at a time, but when the operator

  wants to print 5 or 6 receipts in one time.



  So any one may sugest a way to resolve it?



  Thanks in advance



  Michel Medawar.






$subst('Email.Unsub').






Message #3 by "Yama Kamyar" <y.kamyar@e...> on Thu, 13 Dec 2001 20:03:15 -0800
Hi,



Try to URL Encode the text.



<script language="vbscript">





mystr = URLEncode ("One Hundred Dollars Only")



'For testing purposes I will message box.

msgbox mystr



'Equivalent to Server.URLEncode

Function URLEncode(Text)

Dim X

Dim buffer

Dim Char

Dim Temp

Dim Charset



Charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"



Text = Replace(Text, " ", " ")

Text = Trim(Text)



For X = 1 To Len(Text)

Char = Mid(Text, X, 1)

If InStr(1, Charset, Char) < 1 Then

Temp = Trim(Hex(Asc(Char)))

buffer = buffer & "%" & UCase(Temp)

Else

buffer = buffer & Char

End If

Next

URLencode = buffer

End Function



</script>





Hope this helps,



Yama Kamyar

Sr. Software Engineer

--



On Thu, 13 Dec 2001 23:53:56   Michel Medawar wrote:

>Hi to all crystal report developers

>

>A new day and a new problem :) 

>my god what a week...

>

>my problem goes like this: i have a receipt to print, 

>in this receipt i have an amount let's say 100$, 

>what i usualy do is that i convert the amount to words 

>in vb and then i pass it as a parameter for the CR, like 

>"One Hundred Dollars Only", this works fine in case 

>of printing one receipt at a time, but when the operator

>wants to print 5 or 6 receipts in one time.

>

>So any one may sugest a way to resolve it?

>

>Thanks in advance

>

>Michel Medawar.

>

>

>




>





Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at http://www.eudoramail.com

Message #4 by "Keith Lee" <kitleeky@m...> on Fri, 14 Dec 2001 12:57:41 +0800
This is a multi-part message in MIME format.



------=_NextPart_000_004E_01C1849E.EA626260

Content-Type: text/plain;

	charset="windows-1256"

Content-Transfer-Encoding: quoted-printable



I'm using Crystal Report built-in function ToWords to convert.

But u need to put in some calculation.



TQ.







"Michel Medawar" <mmedawar@t...> wrote in message 

news:128963@c..._reports...

  Hi to all crystal report developers



  A new day and a new problem :)

  my god what a week...



  my problem goes like this: i have a receipt to print,

  in this receipt i have an amount let's say 100$,

  what i usualy do is that i convert the amount to words

  in vb and then i pass it as a parameter for the CR, like

  "One Hundred Dollars Only", this works fine in case

  of printing one receipt at a time, but when the operator

  wants to print 5 or 6 receipts in one time.



  So any one may sugest a way to resolve it?



  Thanks in advance



  Michel Medawar.








Message #5 by <mmedawar@t...> on Fri, 14 Dec 2001 14:07:54 +0200
Hi again



1)What if i declared the report with events, is there 

any event i can use to get the receipt amount for 

every record and pass back the parameter??



2)If no, can i use the same module code that converts 

amounts to words in the crystal report??



Thanks 



Michel Medawar





Message #6 by "Michel Medawar" <mmedawar@t...> on Fri, 14 Dec 2001 20:30:30 +0200
This is a multi-part message in MIME format.



------=_NextPart_000_000D_01C184DE.2C5727C0

Content-Type: text/plain;

	charset="windows-1256"

Content-Transfer-Encoding: quoted-printable



Hi again



I used the function ToWords as you said,

it worked well eventhough i didn't like the

XX/100 very much :)



So thank you all, everyday i'm learning

something new about the CR.



I'm gona have some rest now, enough

problems for today...



Have a good Day/Night



Michel Medawar.









  Return to Index