Printing from label printer using Crystal Report in C# - c#

I am creating an desktop application for printing label from label printer. Can anyone guide me how to print from label printer using crystal report approach. I am new to this topic and have no idea.
I would appreciate if anyone provide me some sample program.
Thanks.

It depends on the kind of label printer that you have.
If you use Crystal Report, then your application will be printer agnostic, it wouldn't care which type of printer you use. Also you will not be able to use some features that you label printer might have like, controllable label cutting.
Label printers usually have API. So you would normally design a label in a template designer, that is normally supplied with your printer. Then you would call API providing the file path to the template and filling the data that template requires.

Related

Set Report Size on Crystal report

i am using windows 10.
i am trying to create a report for continuous form (Half Of A4), i set manually from device and printer, so i set printer server like this.
then i change page setup on CR to vpc (name of paper where i create on printer server) like this..
then i tried it with different way :
i preview the report, than print.
with out run my application. the print result was great. just like i want.
i run my application, preview my report with Crystal REport viewer tools, but my report become landscape. not protrait.
see...
what must i do?
yes, after a week,finally i found the answer, we need to set default paper to our customer paper.
just that.

ActiveReports interface to RightFax

I'm trying send ActiveReports formatted reports to my company's RightFax server, and pre-set some of the fax fields, like FAX number, sender, and recipient. The RightFax documentation says that the document must include Embedded Codes to set these values, e.g. <TOFAXNUM:12345556789><TONAME:Recipient><FROMNAME:Sender>. I create a TextBox or Label in ActiveReports that contains this text. But the values are not set when RightFax receives the document and brings up the RightFax client UI. The Embedded Codes remain in the fax image. I have the RightFax printer driver set to HP LaserJet 4. I'm developing in C#, using Visual Studio 2010 Professional.
One suggestion on the web is to make sure the Embedded Codes are set in Courier or another "printer font". However, Visual Studio does not have "Courier" or "Times Roman", only MS true type versions of these standard fonts, "Courier New" and "Times New Roman".
This method of sending faxes is working with older software, that doesn't use ActiveReports, on another machine using the same RightFax server.
Any experience you can share interfacing ActiveReports to RightFax would be most appreciated.
Thanks,
Gregg Lobdell
You could accomplish your task by controlling the whole printing process and sending the escape sequence using Windows API. I assume you using ActiveReports 6 or section-based reports of ActiveReports 7.
In more detail:
create your own PrintDocument and define PrintPage handler
in the PrintPage handler send escape sequence to printer using Escape winapi call (see the example on CodeProject)
render the page itself by calling the Page.Draw()
As long as you use a true type font, the printer should recognize that font and be able to "read" the text in it. Only old bitmap fonts are fonts that might be not readable by the printer. Usually commonly used TT fonts on windows like "Courier New" or "Times New Roman", are already in the printer so they won't even be downloaded.
However, RightFax does have some documentation on escape codes here, so you might want to try using escape codes with ActiveReports. Also, here is an example of using the SystemPrinter object in ActiveReports6 to send escape codes directly to the printer without using any special API. You might try using that code and replacing the escape code there with ones that RightFax understands.
Finally, ActiveReports essentially prints by getting a graphics from the printer and drawing on it. Textboxes are real text drawn with appropriate text commands (i.e. text is not rendered as bitmaps). This is a normal way of printing in modern windows so any printer should see the text as normal text. You should be abel to see the same exact results by writing your own simple printing code in .NET and sending it to the RightFax driver. If it works there it will work in ActiveReports.
If it isn't working, and the escape code trick above won't work, I think contacting RightFax and asking them for insight into how to print to their driver from a .NET application would be the next logical step.
Hope this helps!

how to print (on printer) table from database using c#

I work on some project that is migrating from vb6 to web (asp.net). I need to print some kind of report - A table from database and number of simple headers with date and time. In vb it was implemented using vsPrinter object. Is there any Class in C# that is similar to this Class in vb6 in its functionality? If there in no such thing in .net, what is the easiest way to do this?
Thanx for assistance!
Remember you are moving to the web so you don't have access to the hardware printer controls. You only have access to what the browser gives you. If you are not doing anything fancy with this you can do one of two things.
Since this is an ASP.NET webpage, simply create a new browser or popup and render your report as html. The user can them choose print from the browser print dialog or you can launch it with some generated javascript.
Use the Microsoft Report and Report Viewer controls is you need more formal report layout. These are available from your toolbox under the category Reporting.
I think the easiest way would be by using any reporting tool, one of the powerfull tools is Crystal reports, just google it an you will find alot of useful tutorial such as:
Creating Crystal Reports using C# with Datasets.
Crystal reports in ASP.NET
You can also find alot of useful threads about it here in SO under Crystal Reports tag, like:
How to use Crystal Reports with ASP.NET?
C# Crystal Reports Tutorial on asp.net?

How to print formatted labels from c#

I'm writing a program that will (among other things) print out labels with variable information. I want to be able to format these labels (preferably in a GUI) at design-time, then have them print out at runtime. What tools/languages/projects can I use to accomplish this?
The label needs to include text and also Code39 or Code128 barcodes.
Printing will be done on a normal default printer, or possibly a label printer, unknown at this time.
Preference is for open-source, free projects, but any suggestions are appreciated. I'd also like to be able to distribute the program through xcopy, meaning no separate installations needed on the client.
EDIT: I'm now trying to do this using Microsoft Reporting services in local mode, but I'm still having problems getting the barcode to be readable.
There is a simple walkthrough of using our programmable ActiveReports product to do this here. Once you design the labels you can get them in PDF or print them directly (among other things). Another example of using ActiveReports to create a label maker program is here. That one uses the ActiveX/COM edition of ActiveReports but the concepts are still the same in the C#/.NET version.
We also provide a product named Data Dynamics Reports that uses a page-based metaphore for designing reports rather than the banded metephore like ActiveReports. It includes a label wizard which you can find out more about at this link.
Scott Willeke
GrapeCity inc.
Using Microsoft Reporting Services I can use a local report. Its not xcopy, but it is free and relatively easy. I just have to install report viewer on the client (and the barcode font), then I can even run the .exe from a network share.

printer driver type application

I am working on a application which requires me to create a printer type driver, which offers to decrease the quality of document, and then prints the document.
Where document can be anything like image, word, pdf. And this application should be listed as new printer in the documents printers menu.
What I was thinking to create an application that will be installed as printer driver, and when this printer is selected for print then this application consider print documents as image and decrease the image quality based on user input. then these can be copied into new pdf and then print this newly created pdf silently using default printer drivers.
Can anyone tell me if I am thinking on the right track, and if I am thinking on right then please help me out in this, as I have no idea how to do this stuff.
I am using C# and .NET for creating this application.
thanks in advance
It's a good approach but it's not possible to create a printer driver in C# and .NET. You will need the Windows Driver Kit and C/C++.

Categories