on 05-05-2010 3:38 PM
I use report_viewer to run CR .rpt files from a Progress Application. When launched CR presents the report on the screen for the user to view/print. Can I run this report in a way that just goes directly to a printer and does not display on the screen? I just want to print the report and then have the CR session close. All this without the user ever seen CR. Don
Thank you for the replies! I am a software developer and work with the Progress 4GL programming language. As well I have the Developer edition of CR. What needs to be done to "report_Viewer" in order to launch the report directly to the printer and bypass the entire CRT screen presentation? I want the user to press a button in our application and have the report print without the user seeing anything on the CRT. Again, thank you for your assistance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Don,
So you are using the RDC ( craxdrt.dll ) as your report engine correct? So I moved this to the Legacy forum.
If you go to our RDC samples you'll find samples, they are VB but same methods, on how to print the report from the RDC engine and not the viewer. The viewer has a button to print only.
It should be something like ReportObject.PrintReport( other properties)
Thank you
Don
Don, thank you for help. I have to confess getting lost in the website. Can you post a link to the code sample for direct printing. I'll continue searching the site, but a link would be most helpful.
The code I'm presently using to view the report is:
chCtrlFrame:CrystalActiveXReportViewer:ReportSource=chReport.
chCtrlFrame:CrystalActiveXReportViewer:ViewReport().
I think Don was looking at [this|http://www.sdn.sap.com/irj/boc/index?rid=/webcontent/uuid/a01c839a-7787-2b10-88a2-c8c7b894df9e] [original link is broken]; downloads page. Unfortunately , I don't see much there so unless Don comes back with some other page, that is it.
Seeing the lack of actual sample apps, you'll have to dive into the Developer help which should be installed on your dev computer;
C:Program FilesBusiness ObjectsCrystal Reports 11.5Helpen dcsdk_com_dg_docdoc dcsdk_com_dg.chm
In a nut shell the following line of code should print the report - as long as it is logged on to the database (unless it is a saved data report) and all other parameters the report expects have been supplied:
report.PrintOut([PromptUser], [numberOfCopy], [collated], [startPageN], [stopPageN])
You can select a printer to print to;
report.SelectPrinter "DriverName", "PrinterName", "Portname"
There are other print properties you can set. See the dev help above and the article below for more details. In all of this, it is absolutely critical that you are working with [SP 6|https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe] as htere have been a number of fixes pertaining to printing.
Hunting for other possible sources of info;
[How Visual Basic Developers can Migrate from the OCX to the Report Designer Component as Their Primary Integration Method|http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/a06bac06-9d1e-2b10-5ebc-c518a91c0dc5?quicklink=index&overridelayout=true]
While the above is targeted at converting from OCX to RDC, it has great info re. working with printers and RDC.
Ludek
Follow us on Twitter http://twitter.com/SAPCRNetSup
Kudek, Thank you for the reply! I wasn't able to find a solution in your response as I am presently doing what you suggested.
Below is the code (Progress 4GL) that I'm using to launch the report. It brings the report to the user screen and automatically directs the printout to the appropriate printer. I'm trying to get it to go to the printer without displaying anything on the screen.
The last call, is the one that is presenting it to the CRT. I must have to replace the "ReportViewer:ViewReport()" with a different call to bypass the display step and go directly to the printer, but I don't know what to use.
Again, any help is very much appreciates.
chReport= chApplication:OpenReport("c:\dcam\reports\pack_list.rpt").
chCtrlFrame:CrystalActiveXReportViewer:EnableExportButton = TRUE.
chCtrlFrame:CrystalActiveXReportViewer:EnableSearchControl = FALSE.
chCtrlFrame:CrystalActiveXReportViewer:EnableGroupTree = FALSE.
/* Clear Report Parameter */
chReport:ParameterFields:ITEM(1):ClearCurrentValueAndRange().
/* Set Report Parameter */
chReport:ParameterFields:ITEM(1):SetCurrentValue(rep-lid-no).
chReport:SelectPrinter("", rep-printer, "").
chReport:PrintOut(FALSE).
/* Set the report name */
chCtrlFrame:CrystalActiveXReportViewer:ReportSource=chReport.
/* View Report */
chCtrlFrame:CrystalActiveXReportViewer:ViewReport().
Umm, if we don't want the viewer, what about removing any reference and / or code for it? E.g.;
chReport= chApplication:OpenReport("c:\dcam\reports\pack_list.rpt").
/* Clear Report Parameter */
chReport:ParameterFields:ITEM(1):ClearCurrentValueAndRange().
/* Set Report Parameter */
chReport:ParameterFields:ITEM(1):SetCurrentValue(rep-lid-no).
chReport:SelectPrinter("", rep-printer, "").
chReport:PrintOut(FALSE).
What am I missing here?
Ludek
Ludek & Don
I got it to work! All the difficulty I was having was a bad DSN connection that was masked by an erroneous error return code that looked like a printer problem. My "direct to printer" code was always working, but the ODBC connection failure was not being trapped properly and causing the ap to abort with a bad return code. I finally was able to unravel this. Once I determined the root problem the rest fell into place.
I can't thank you enough! Your efforts are very much appreciated!
Don
Hi Don,
We don't have anything like that as a standalone app.
You could write your own but it would require a Developer and quite simple to do. Lots of options. A web server/application would be the easiest.
There are also third party applications available to do the same also.
Thank you
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For a list of 3rd-party applications that provide this functionality, see http://www.kenhamady.com/bookmarks.html
User | Count |
---|---|
84 | |
10 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.