I want to ask you a simple question. I have a small database and a simple interface in C++Builder XE8. I want to ask 2 things. First of all how i can take some reports from database, can i use somehow crystal reports tool is anyother that i can use? My second question is how i can print some data in thermal printer. Is any componnent? I guess i need some code too. For example if i have some editboxes with data and i want to print it thermal printer with dimensions 80x80 paper how i have to start
This is two discussions in one - not helpful for other forum users.
I suggest leave this one as "thermal printer" - and repost a second one regarding report options (although I fear the number of approaches here is large and you will need to more accurately specify the nature of the reports you are trying to generate in order to get anyone to be able to offer useful advice).
Q: How is your thermal printer connected to the PC (hardware) ?
Q: How is your thermal printer connected to the PC software wise? does it have Windows drivers (and therefore appears as a standard windows printer?) or is it a simple Ascii device that you send ascii characters directly to?
(Some devices can be installed either with or without drivers, in which case let us know which option you have gone for).
If it is driven by a Windows driver then can you print successfully to it from, say, notepad (or a word processor?).
It's always helpful to list the compiler version, operating system and (in your case) thermal printer manufacturer and type number when posting questions...
As far for the printing in thermal printer i did some progress with a very simple code like that:
TPrinter *Printer1 = Printer();
Printer1->Canvas->CopyMode = cmSrcCopy;
I print and everything is ok. Now my problem is how to print a logo in top of thermal paper. My thermal printer is atec fastprint and is connected with lan cable. Also my windows are win7 professional.
I still need some help on create reports from database and print them from my application in A4 printer. For example crystal reports maybe?
All you need to do is to use any of the canvas methods that correspond to TextOut() but that are for graphics.
Here's an example that will copy a rectangle from the client canvas to the default printer.
// here to print out a copy of what is on a section of the client canvas
// (starting in corner (0,0))
// MaxWidth and MaxHeight are values defined elsewhere to suit the size of the
// rectangle we want to print out
Graphics::TBitmap *Scratch = new Graphics::TBitmap;
TRect ImageSize(0, 0, MaxWidth - 1, MaxHeight - 1);
Scratch->Width = MaxWidth;
Scratch->Height = MaxHeight;
Scratch->Canvas->CopyMode = cmSrcCopy;
Scratch->Canvas->CopyRect(ImageSize, ClientImage->Canvas, ImageSize);
// print it out assumes it will fit on one page
TPrinter *PagePrinter = Printer();
PagePrinter->Orientation = poLandscape;
PagePrinter->Canvas->CopyMode = cmSrcCopy;