How to rotate Tpp2DBarCode in RB11 / D2007?
Hi,
I'm testing the new ReportBuilder 11. I found that it contains a 2D
barcode component - great, I need that feature. Is it possible to print
the barcode rotated? I couldn't find any property or method which would
allow that and I need the possibility to print the 2D barcode on a label
top-to-bottom. How can I do that?
Kind regards,
Michal R. Hoffmann
I'm testing the new ReportBuilder 11. I found that it contains a 2D
barcode component - great, I need that feature. Is it possible to print
the barcode rotated? I couldn't find any property or method which would
allow that and I need the possibility to print the 2D barcode on a label
top-to-bottom. How can I do that?
Kind regards,
Michal R. Hoffmann
This discussion has been closed.
Comments
The 2D barcode component currently does not include rotation support. This
is a feature we would like to add to ReportBuilder as we move forward with
the product. Thank you for the feedback. If you are designing small
labels, it may be possible to rotate the other objects present so the 2D
barcodes do not need rotation.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for a quick response. Unfortunately it has to be printed on A4
despatch report with a peel-off label. Is there any way of temporary
workaround? I thought about adding an invisible 2D barcode and an image
component, then in runtime reading generated barcode as an image,
assigning to the image and rotating the image. Is it possible? On which
event then?
Thanks,
Michal R. Hoffmann
You should be able to use the AsMetaFile routine of the TppDraw2DBarCode
class once the drawcommand is created to save the barcode as an image.
Unfortunately the best place to gain access to the drawcommand is in the
OnCreateDrawCommand event which fires too late to add the image to a
TppImage component. You could either manually create a TppDraw2DBarCode
object separate from the report or manually create and add a TppDrawImage
object and add it to the report.
Method 1:
1. TppImage.OnPrint event: create a TppDraw2DBarCode object, assign
properties and call AsMetaFile.
2. Rotate image and assign it to the TppImage component.
Method 2:
1. Call AsMetaFile routine in the Tpp2DBarcode.OnCreateDrawCommand event
and save image.
2. Rotate image.
3. Create a TppDrawImage object, add the image and add the drawcommand to
the page.
See the following article for an example of how to add a drawcommand to a
page at runtime.
http://www.digital-metaphors.com/rbWiki/Delphi_Code/Formatting/How_To...Manually_Add_a_Watermark_to_a_Page
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thank you - your hints were very useful. It worked quite well, although
I wish there's a built-in method to rotate image I had some problems
implementing method 2 - it requires printing to a page (and I need it in
the footer relative to some other elements), so I used method 1 (a bit
modified).
Can I expect 2D barcode rotate in version 11 update or rather in the
further version?
And with version 11 Pro - do you still supply source code so it's
possible to tweak things?
Kind regards,
Michal R. Hoffmann
Although I cannot guarantee that rotating the 2DBarcode will be added, I
will mark it down as a possible enhancement for a later release. Thanks for
your feedback.
Yes, the registered version of ReportBuilder 11 Pro includes the source
code.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com