Solved

Print Crystal Viewer Drilldown from VB

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Reports Suppress part of Address Field if the value is null 2 52
Parameter transfer to cristal report 3 75
Crystal Reports Version 7 4 25
Crystal reports vb.net 2 39
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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

785 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