CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 1999
    Posts
    6

    Data Report Trouble



    2 Questions


    First how do you change the caption on a label located in the report header of a Data Report. What I want to do is put the Job# and Name of the file I'm printing in the report header. The information is stored in a Dbase and the report header has lables called Job_No and Job_Name. This is the code I have, and nothing happens when it executes. (Putting .caption after the objects gives me an error also)


    Private Sub DataReport_Initialize()

    Dim dbsActive As Database

    Dim rstTemp As Recordset



    Set dbsActive = OpenDatabase(Main_Form.Active_Filename)

    Set rstTemp = dbsActive.OpenRecordset("Job Info")

    With rstTemp

    Job_No = !Job_No

    Job_Name = !Job_Name

    End With

    dbsActive.Close


    End Sub


    Second I seem to be haveing similar trouble as Shappy. I need to print this report in landscape but when I set the Printer.Oriention = 2 It still wants to print in whatever the default is. (I've put PrinterDefault = True before it also and the same thing happens). The workaround that I've done is to open up the CommonDialog.ShowPrinter and set it manually, but that's very inefficent.


    Please help me.

    Thanx

  2. #2
    Join Date
    Nov 1998
    Posts
    3

    Re: Data Report Trouble



    You can change the caption of a report header label like this (assuming your report header is called 'ReportHeader'):


    drReport.Sections("ReportHeader").Controls("Job_Name").Caption = "Whatever"


    Can't help you with problem 2.


    Andy

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

Featured