Solved

Print Crystal Viewer Drilldown from VB

Posted on 2004-09-30
6
494 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

18 Experts available now in Live!

Get 1:1 Help Now