Solved

Print QR Codes

Posted on 2012-03-15
12
1,773 Views
Last Modified: 2012-03-26
I need to print QR Code on a system written in VFP. Is it possible?

Translate from portuguese:

"Eu preciso imprimir QR Code em um sistema escrito em VFP. É possível?"
0
Comment
Question by:etm_wkl
  • 6
  • 3
  • 3
12 Comments
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 37725125
0
 
LVL 27

Accepted Solution

by:
CaptainCyril earned 500 total points
ID: 37725127
http://www.downloadatlas.com/free-to-try-ef11b855.html

I found these online. Never tried them.
0
 

Author Comment

by:etm_wkl
ID: 37729297
Thank you.
I downloaded the ActiveX ( MW6 ) and headed e-mail requesting the examples in VFP, 2 times (yesterday and today), and I'm still waiting for some feedback.
Notice anything new.

Translate from portuguese:

"Obrigado.
Fiz o download do ActiveX ( MW6 ) e encaminhei e-mail solicitando os exemplos em VFP, por 2 vezes ( ontem e hoje ), e ainda estou aguardando por algum retorno.
Aviso qualquer novidade.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 27

Expert Comment

by:CaptainCyril
ID: 37729663
I Googled QR Codes and pasted the links above. I never actually used bar codes or QR codes in my code.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 37732329
You can't expect sample code in VFP. No ActiveX is programmed IN VFP, only few companies actually also know VFP and provide ActiveXes especially tested with, approved with VFP and handing out sample code.

But the ActiveX documentation of it's properties and methods should suffice for using it.

I expect not much more than a line of code needed, something like:

oleobject.CreateQRCode("your barcode value here","qrimage.gif")

And you need a foxpro sample for that?

Have you used any ActiveX in VFP so far? Do you have a general question obout the olecontrol baseclass of VFP?

Bye, Olaf.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 37732357
I agree with Olaf, most of the ActiveX we used had little documentation so we had to experiment with it.
0
 

Author Comment

by:etm_wkl
ID: 37732455
OK, thanks.

On the company website where I downloaded the Activex, say they can send VFP examples when prompted. So I have sent the emails cited.

Another point: in fact, I have no experience in the use of ActiveX. But I'll try.


Translate from portuguese:

"OK, obrigado.

No site da empresa de onde baixei o Activex, dizem que podem encaminhar exemplos em VFP quando solicitado. Daí eu ter enviado os emails citados.

Outro ponto: de fato, não tenho nenhuma experiencia no uso de Activex. Mas vou tentar."
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 37733082
You just need to install the ActiveX control. And just like using a textbox or commandbox on your form, you can use this ActiveX with intellisense of methods and properties. Professional companies have adequate documentation on their methods and properties.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 37733596
Cyril is right, not much more needed than installation and putting the ActiveX control on a form lilke any other control.

Even though it is not a visual control like a textbox, this can be done.

There are several ways to get at the ActiveX control, perhaps the easiest is to add the olecontrol control and then choose the ActiveX control from the dialog appearing.

You can also add ActiveX controls to the Toolbox or the Form Controls Toolbar.

Besides this, some non visual ActiveX Controls can also be instanciated via Createobject() and their OLE Classname, the same as OLE automation servers. It's all OLE/COM.

Bye, Olaf.
0
 

Author Closing Comment

by:etm_wkl
ID: 37741874
I received the following sample code and it worked.

Drop table barcode
*
Create table barcode (img g)
*
fileName = ""
*
For n = 1 to 15
      *
      fileName = "c:\qrcode_" + alltrim(str(n, 2, .0)) + ".bmp"
      *
      ThisForm.QRCodeObj.SetSize(300, 300)
      *
      With ThisForm.QRCodeObj
            *
            .Data = "String " + alltrim(str(n, 2, .0))
            .Refresh
            .SaveAsBMP(fileName)
            *
      EndWith
      *
      Insert Into barcode from MEMVAR
      *
      Append General barcode.img From (fileName)
      *
Next
*

Thanks to all.
0
 
LVL 27

Expert Comment

by:CaptainCyril
ID: 37742080
Welcome. It is easy, no? Glad it worked out great. :-)
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 37764604
Hm,

that kind of interface is a bit weird, but OK. Essentially the steps to do with the QRCode object are

.SetSize(300, 300)
.Data = "String ..."
.Refresh
.SaveAsBMP(fileName)

That could also be put in a single method call
.CreateQRCodeBMP(data,sizex,sizey,filename)

The seperation enables you to only set the size once outside of the loop. Having x and y size makes me wonder if there are any non quadratic QR codes, I haven't seen any such.

But it works and that's what matters, isn't it. Glad you got it working.

Bye, Olaf.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question