cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a ZPL script to a Crystal Report Layout

Former Member
0 Kudos

Hi,

I have a ZPL script which I want to add to a Crystal Report. The main objective is that when I print this Crystal Report which has the ZPL script to the Zebra barcode printer it should run the script and print the barcodes. How do I get about creating such a Crystal layout?

Thanks in Advance.

Regards,

Chanaka

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Chanaka,

It won't work in CR itself. We create "pictures" of each page, nothing embedded will be translated into printer scripts/controls.

Only I can think of is to export to any other format and then apply the script when printing that format. If it works for you that way....

What is the ZPL script for, possibly a work around can be found with more info?

Don

Former Member
0 Kudos

Hi Don,

Thank you for the message. Let me explain the issue I have a bit more in detail. I have two applications to preview a Crystal Report. One uses the RDC technology and the RDC Crystal viewer. This uses the Crystal XI R2 version. The other uses the .net Technology and the .net Crystal viewer. This uses the latest Crystal 2011 version.

Then I have a Zebra barcode printer installed to a UBS port. Then I install a printer to using a “Generic Text Printer” driver according to the following link using the same USB port the Zebra barcode printer is installed to. Note that in step 5 I provide the USB port rather than giving FILE:.

http://support.mfm.com/support/std_procedures/xpgenericprinter.html

Now I have a Crystal Report where the following ZPL script (this is just a sample) is inserted in to the text field. The report is created using Crystal Report Designer XI R2, but resaving it with Crystal Report Designer 2011 provides the same results.

^XA

^PRC

^LH0,0^FS

^LL296

^MD0

^MNY

^LH0,0^FS

^FO448,179^A0N,29,27^CI13^FR^FDLot Batch No:^FS

^FO20,179^A0N,29,25^CI13^FR^FDJob No:^FS

^FO204,49^A0N,29,25^CI13^FR^FDPartDescription^FS

^FO19,47^A0N,29,25^CI13^FR^FDProduct Code.^FS

^FO601,179^A0N,29,25^CI13^FR^FDABCDEFG^FS

^FO109,179^A0N,29,25^CI13^FR^FD12345678-1-1^FS

^FO20,145^A0N,29,25^CI13^FR^FDCust Ord No:^FS

^FO19,82^A0N,29,25^CI13^FR^FDManf Date.^FS

^FO204,82^A0N,29,25^CI13^FR^FD12345^FS

^FO21,115^A0N,29,25^CI13^FR^FDRoll Dimensions:^FS

^FO204,115^A0N,30,28^CI13^FR^FD^FS

^FO420,82^A0N,29,25^CI13^FR^FDQC Insepcted By:^FS

^FO601,82^A0N,29,25^CI13^FR^FD12345^FS

^FO202,147^A0N,29,25^CI13^FR^FD12345^FS

^FO468,117^A0N,29,25^CI13^FR^FDNo Of Joins:^FS

^FO601,117^A0N,29,25^CI13^FR^FDABCD^FS

^FO695,39^FR^XG!EJZCur ,1,1^FS

^FO698,121^A0N,15,17^CI13^FR^FDMH28855/MH19592^FS

^FO346,17^A0N,30,25^CI13^FR^FDSLIT CORE LABEL^FS

^FO341,179^A0N,30,25^CI13^FR^FDDP^FS

^FO410,146^A0N,29,25^CI13^FR^FDManufactured By:^FS

^FO599,146^A0N,29,25^CI13^FR^FDWorldmark^FS

^BY2,2.0^FO31,216^B3N,N,52,N,Y^FR^FD12345678-1-1^FS

^BY2,2.0^FO454,214^B3N,N,52,N,Y^FR^FD12345^FS

^FO8,7^FR^GB865,0,37^FS

^FO8,3^GB871,282,7^FS

^PQ2,0,0,N

^XZ

Now, I do a preview from the application using RDC. Then when I print the previewed report using the print button in the Crystal Report Viewer to the above installed printer the Zebra printer correctly printers the barcode. Then when I preview the report using the .net application. The preview looks the same as the one from the RDC application. Yet, when I print the report using the print button in the .net Crystal Report Viewer, to the same printer it just prints garbage values. Copying the same ZPL script to a notepad and printing to the same printer will give me the barcodes as well.

Do you have any idea why this is happening in the Crystal 2011 .net viewer?

Regards,

Chanaka

0 Kudos

The Windows .NET Viewer simply pastes an image of the page to the screen, there is no bit logic used as the ActiveX viewer did.

See this post for the sample app to create your own Print button and try using the PrintToPrinter or PrintOutputController to print the report.

http://scn.sap.com/message/13502900#13502900

Not sure if it will work, try your test button first to see if that will even work

Don

Former Member
0 Kudos

Hi Don,

Thank you for the answer. I think this answers my question why it acts differently in two viewers.

I will try your suggestion as well, but for now I will put this to answered state as it answered my question.

Regards,
Chanaka

Answers (0)