Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Print Crystal Viewer Drilldown from VB

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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