Solved

Print Crystal Viewer Drilldown from VB

Posted on 2004-09-30
6
502 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
[X]
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
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

630 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