Results 1 to 5 of 5

Thread: Couple of Crystal questions...

  1. #1

    Thread Starter
    Lively Member adBSTRD's Avatar
    Join Date
    Oct 2003
    Posts
    116

    Couple of Crystal questions...

    1) I need my report to appear twice on the same page so I can cut it in half. How can I make it 'mirror' itself in the botton half of the page?

    2) How can I tell my report what printer will it use, and finally

    3) How do I make it print without getting the printers prompt? I tried CRViewer1.PrintReport but I get the prompt... Thanks in advance!

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    No idea about question #1.

    For questions 2 and 3 I am assuming your report is currently being viewed in the crviewer control (why are you not using the Print button on the control).

    Anyways, use the methods of the CRAXDRT.Report object instead.
    I have Version 8.5 with some hot fixes.

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim objReport As CRAXDRT.Report
    3.     Set objReport = CRViewer1.ReportSource
    4.  
    5.     objReport.PrinterSetup 0
    6.     'Or objReport.PrinterSetupEx 0        
    7.     'depends on your version
    8.    
    9.     objReport.PrintOut False 'print the report
    10.  
    11. End Sub

  3. #3

    Thread Starter
    Lively Member adBSTRD's Avatar
    Join Date
    Oct 2003
    Posts
    116
    Thanks a milllion Bruce!

    I dont want to use the print button on the crviewer because I have a number of tems on a listview ans must print a new report for each one. Thats why I want to be able to print automatically, so my routine can print the reports while looping thru the listview.

    Does "objReport.PrinterSetup 0" make the report use the default printer?

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    So there is no reason to use the CRViewer.

    VB Code:
    1. Dim objReport as CRAXDRT.Report
    2.  
    3. Set objReport = <CrystalAppObject>.OpenReport(PathToReport)
    4.  
    5. 'Set any parameter fields
    6.  
    7. objReport.ReadRecords
    8. objReport.PrintOut False

    objReport.PrinterSetup 0 - shows a dialog that allows the user to select a printer.

    As far as I know the report is always printed to the default printer.

    There is another method called PrinterSelect or is it SelectPrinter that allows you to set the printer in code without a dialog box.

  5. #5

    Thread Starter
    Lively Member adBSTRD's Avatar
    Join Date
    Oct 2003
    Posts
    116
    Hey Bruce I solved question 1 by adding the same subreport twice in the same report and playing around with the spacing until they are the same size and take the whole page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width