Solved

Print Crystal Viewer Drilldown from VB

Posted on 2004-09-30
6
493 Views
Last Modified: 2008-02-01
If you flop a CRViewer into a VB form, yadda yadda, and hit the Crystal Toolbar print button, a simple dialog comes up to print the report.  Works fine, but you can't choose what printer it goes to.

Same as above, but you double-click on a particular group in the report, a simple drill-down subreport is automatically generated by Crystal and added to a new tab at the top of the viewer.  You can hit the Crystal Toolbar print button, the same simple dialog comes up to print the report.  This prints the subreport tab you are currently on, which in this case is the auto-generated subreport.

If you write VB code to take care of selecting the printer, etc, you can no longer print the subreport.  Even if you are on the subreport tab when you choose print, you still receive a printout of the main report itself.

I have found some bits of code that try to work around this, but it is a lot of code to get around something that works out of the box.

My question is, is there a correct way to add the ability of choosing a printer without breaking the drill-down printing, or is there a way to make the drill-down printing work without adding a huge amount of code and additional sub-reports manually...?

Thanks.

0
Comment
Question by:JayCrowe
  • 2
6 Comments
 
LVL 10

Expert Comment

by:ebolek
ID: 12192292
check thes eout
support.businessobjects.com/communityCS/FilesAndUpdates/printer.exe
support.businessobjects.com/library/kbase/articles/c2004174.asp
support.businessobjects.com/library/kbase/articles/c2005043.asp
0
 

Author Comment

by:JayCrowe
ID: 12198964
The c2004174 solution lets me choose the printer, but does not print the drill-down tabs.

Here is the super-simple solution I came up with:

Private Sub CRViewer_PrintButtonClicked(UseDefault As Boolean)

UseDefault = True

Dim result As Long

result = CrxReport.PrinterSetupEx(Me.hwnd)

If result = 1 Then UseDefault = False 'Don't print if the user clicks Cancel on the PrinterSetup dialog

End Sub

The downside:
You get two printer prompts.  The first to choose what printer and page orientation you want, the next to choose number of pages/copies.  I suppose I could put the PrinterSetupEx on a separate button on the form to avoid seeing both prompts.

I never know what to do when I answer my own questions here.  Do I just leave my question open?  If I delete it, nobody can see my answer any longer, correct?

0
 
LVL 10

Expert Comment

by:ebolek
ID: 12199383
If you think that you didnt get any  help from me in solving this problem then you can contact to the cocmmunity group and they can refund you the points

Regards
Emre
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 12464037
Closed, 500 points refunded.
PashaMod
Community Support Moderator
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now