We have an application written in Delphi and we are using Crystal report 11 for reports.
There is a HP 3 tray printer which we uses for printing. Our order form is printing to tray3 in pre-printed document, and after that the order details are supposed to print on tray2 plain paper. But its not happening, if we are doing these tasks simultaneously, instead of tray2 the second print-out going to tray1.But both print-out are going to correct try,if we are exiting and login again each time. I have changed the printer in code , by giving different printer(each tray is added as separate printers) for each print-out. But its not working.
I have given the printer name to Tcrepe (crystal report component in delphi) for changing the printer, is there anything else do?.
Please advice.
Thanks in advance.
Open the report in Crystal and point it to that 2nd printer/tray. Once saved in the report, you shouldn't have a problem.
Related
Believe it or not, I have a UWP app that needs to print multi-part forms on a dot matrix printer. We got a print driver, and we can print just fine from Word/Notepad. However, from my application the fonts look really bad. The test docs used 'Courier New' at 12 pitch. This is exactly what I have in my style for the printed information. However, when it comes from my app, the font looks nasty. I have tried numerous font family combinations and nothing seems to help.
Any ideas/pointers would be appreciated. Thanks.
Turns out the problem was the printer driver. Switching to the Windows Update driver specific for that printer solved all the problems. Wish the inbox driver had worked, but happy it is resolved.
I am getting the error "Attempted to read or write protected memory.." on print button click of the Crystal Report Viewer. This error is random and sometimes the report prints without any errors. Sometimes it gives error as "Handle is invalid". I have tried 2-3 solutions provided on internet like un-checking the "Suppress JIT optimization.."option , but nothing has worked for me. Please help!! (Other details : Crystal Reports 2011, Crystal Reports for VS2010 version 13.0.2, C# 2010 winforms application)
I faced this problem on Windows7 64-bit only, and the Windows6.1-KB2695321-v2-x64 hotfix solved the problem.
I used Windows Hotfix Downloader to download the hotfix.
I hope this helps.
I used this way to avoid this problem :
set show print button to false in crystal report viewer
add a custom button to toolstrip look the link below :
http://www.manjuke.com/2011/08/invoke-custom-method-when-crystal.html
set Eventhandler to new customized button and inside it set code to print directly to printer
cr1.PrintToPrinter(1, false, 0, 0);
when you print directly to printer the problem does not appear.
or you can create a printdialog and use it to print your report
I did that and it all work fine
I've been "playing" with ReportViewer and I need to know how to do the following things:
Print report without creating a ReportViewer. Why? I don't want to show it, just print. ReportViewer is too slow.
Allow users to edit report design. The idea is to allow users to drag and drop TextBoxes to fit a pre-printed form. For example: to print invoices in a pre-printed form.
Thanks in advance.
You CAN print a report without a report viewer.
http://msdn.microsoft.com/en-us/library/ms252091.aspx
Also I have seen a post somewhere that creates a class that inherits from PrintDocument and you can pass the report into. It was in C# and I converted it to VB and it works fine.
Edit: Here is the post that detials the ReportPrintDocument class. Code linked on bottom of post
http://blogs.msdn.com/b/brianhartman/archive/2009/02/27/manually-printing-a-report.aspx
For the first part of the question: you can not print report without using reportViewer control. But you can print thre report from reportViewer control without actually showing the report. Here is similar question explaining how to do printing of report whout preview Link .For the second part of the question there are several ways to edit report desing. First is to use report designer in visual studio. Which is not good for users becaouse most user dont have VS or knowlege how to use it.Another way is to edit the xml of thr rdlc file by hand which is difficult to do even by programers. What i can suggest is using ReportBuilder. But this possible only if you use report server not reports in local mode.If thre is something not clear please ask.
Best Regards,
Iordan
We use the Microsoft Report Viewer control in our web application to print checks. The report needs to use a special MICR bank font in the report. Something like this: http://www.micrfonts.com/
Anyways the font is just a regular TTF font installed in Windows.
Now, when testing the printing on my local setup, everything works perfectly. The checks print on my personal LaserJet using the font correctly.
However, at my client's site, he is telling me that the font is rendering in the web-browser OK, which I think confirms that he has the proper font installed on his machine, but when he sends the report to the printer, the printout does not use the correct font.
Are there any limitations with the RDLC printing with regards to non-standard fonts? I'm not sure how to troubleshoot this issue.
Any help would be appreciated.
More details that I just discovered:
Apparently, everything works from my PC if I connect to my local instance of the app on localhost.
However, if I connect to my app on our remote dev environment, I can replicate the issue of the font not properly printing.
Figured it out. Apparently the font needs to be installed both on the client, and on the webserver.
When rendering to screen, the report viewer uses Html, so the font needs to be on the client machine. However, when printing, the report is generated server side before being sent to the printer, so in that case, the font needs to exist on the server, otherwise it will be substituted.
Took a while to find this. Hope this helps someone else.
I have created a Delphi service which is responsible for printing QuckReports to specific printers contained within the printer.Printers list. I pass my routine the printer name and it looks up in the printer.printers array to get the proper index. It then does this:
QuickRep1.PrinterSettings.PrinterIndex := iIndex;
In the help files it says this for printer.refresh: "Call Refresh when the installed fonts or printers on the current system may have changed". So I call the refresh before I look up the printer name against the printer.printers array.
At one of my installations this function is not working properly. If printers are added/deleted, or someone with printers under their profiles logs on, the list does not seem to get refreshed until the service is stopped and restarted.
Does this function not work for services?
The installation where this is occurring utilizes "virtual services". Could this have anything to do with it?
Thanks.
My experience and understanding is the printers array is updated only at application start. Anytime a new printer is installed, the application must be restarted to get the correct list.
I'm curious to hear any different experience with this myself.
EDIT: From my comment below; I wrote a small test program that confirms the TPrinters.Refresh() does update the printers list.