on 04-13-2006 9:05 PM
HI !
In my addon i use Crystal Report. What would be the code i need to add if i want to print directly instead of having to go thru the crystal viewer.
The crystal viewer gives me lots of problems with painting the screen when i move the form and it allways opens in the task bar. I cant seem to control the window sizes of the viewer either so unless it's easyer to fix those problem i need help to go and print direct without the viewer....
Thanks for your time
Hi again !
I'm using Crystal Report 10 with .net
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the ActiveX object in the SDK to embed the crystal viewer directly into a business one form. I have built an add-on with Crystal XI Developer using this technique (It looks a lot better than my old Crystal V9 add-on that ran in V6.5 of B1 using a windows form). Sizing is easily handled by manually changing the Height/Width properties of the SDK object during the FORM_RESIZE event. Window refresh also works fine using the embeded approach.
If you want to print directly without showing the report in the viewer you can use the PrintOut method of the CRAXDRT.Report object.
John
From memory a simple example would go something like this:-
Dim objReport As New CRAXDRT.Report
Set objReport = objAppl.OpenReport("c:\MyReport.rpt")
objReport.PrintOut True, 1
This will open up a previously saved RPT file and send it to the printer. The first parameter tells it if you want the printer options dialog to display, the second one is the number of copies. You can get more details of the parameters from the Crystal Help files. I am using Version XI but I think it will be the same in V10.
John.
Hi John !
Thanks again, I did find it for version 10. My addon loads allright i have this last error that i hope you can help me with.
Public Member 'Open Report' on type 'ApplicationClass' not found ???
Thanks again for your time. This is really helping and i'm sure it will help alot of others.
Alain
Hi John !
I finnaly made it work...
here's what i used
Dim objAppl As New CRAXDRT.Application
Dim objReport As CRAXDRT.Report
objReport = objAppl.OpenReport("C:Program FilesSAPSAP Business OneAddOnsDutiesresultat.rpt")
objReport.PrintOut(True, 1)
Thanks alot for your time.
p.s.: I can i get the print window open on the screen instead of the task bar ??? it did that with the viewer too...
Thanks again
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.