Results 1 to 18 of 18

Thread: [RESOLVED] how to set Landscape DataReports

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Resolved [RESOLVED] how to set Landscape DataReports

    hello, how to set Landscape size DataReports???
    please help!

  2. #2
    Member
    Join Date
    Jun 2006
    Posts
    44

    Re: how to set Landscape DataReports

    Change the property of the width of the paper to 11 inches and the heighth to 8.5 inches.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    VBChick:
    hiya...i upload the datareport properties image here.please guide.
    Thanks ya!
    Attached Images Attached Images  

  4. #4
    Member
    Join Date
    Jun 2006
    Posts
    44

    Re: how to set Landscape DataReports

    What reporting tool are you using?

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    VBChick,
    hiya...i'm using VB6 datareport tools.ok,i upload the datareport error message here,please help!
    Attached Images Attached Images  
    Last edited by gracehskuo; Sep 11th, 2007 at 02:15 AM.

  6. #6
    Member
    Join Date
    Jun 2006
    Posts
    44

    Re: how to set Landscape DataReports

    Did you drag some controls outside your grid (canvas) or, did you set the page size greater than 11in,8.5in (landscape). Look for the page size property.

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,511

    Re: how to set Landscape DataReports

    This might help

    rptData1.Orientation = rptOrientLandscape
    rpData1.Show vbModal

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    wes4dbt:
    hi,thanks ya reply.i have try your method but can't work.have error appear.This is the current code for the datareport.please help!


    Code:
    Private Sub cmdPrint_Click()
    Dim strSQL As String
    Dim conDataConnection As Connection
    Dim start As String
    Dim enddate As String
    
    DataReport2.Orientation = rptOrientLandscape error message highlight at blue color
    DataReport2.Show vbModal
    
    start = Format(DTPicker1.Value, "dd MMM yyyy")
    enddate = Format(DTPicker2.Value, "dd MMM yyyy")
    
     Set conDataConnection = New Connection
          conDataConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & _
                    "\Overtime.mdb;Persist Security Info=False"
    
    
    Dim rs As New ADODB.Recordset
    strSQL = "SELECT * FROM Overtime where OvertimeDate BETWEEN #" & start & "# and #" & enddate & "#"
    rs.Open strSQL, conDataConnection, adOpenStatic, adLockOptimistic
    
    
    'set the database source in rs
        Set DataReport2.DataSource = rs
        'then set the field
        DataReport2.Sections("section1").Controls.Item("Text1").DataField = "EmployeeName"
        DataReport2.Sections("section1").Controls.Item("Text2").DataField = "EmployeeNo"
        DataReport2.Sections("section1").Controls.Item("Text3").DataField = "Designation"
        DataReport2.Sections("section1").Controls.Item("Text4").DataField = "Department"
        DataReport2.Sections("section1").Controls.Item("Text5").DataField = "Shift"
        DataReport2.Sections("section1").Controls.Item("Text6").DataField = "OvertimeDate"
        DataReport2.Sections("section1").Controls.Item("Text7").DataField = "TimeFrom"
        DataReport2.Sections("section1").Controls.Item("Text8").DataField = "TimeTo"
        DataReport2.Sections("section1").Controls.Item("Text9").DataField = "Breaktime"
        DataReport2.Sections("section1").Controls.Item("Text10").DataField = "OtRate"
        DataReport2.Sections("section1").Controls.Item("Text11").DataField = "CategoryDay"
        DataReport2.Sections("section1").Controls.Item("Text12").DataField = "WorkDescript"
       
    End Sub
    thanks help!
    Attached Images Attached Images  
    Last edited by gracehskuo; Sep 11th, 2007 at 09:11 PM.

  9. #9
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,511

    Re: how to set Landscape DataReports

    Can you locate at which line of code you get the error?

    I don't see where you set the datamember property.

    Datareport2.DataMember = rs.DataMember

    Might help.

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    wes4dbt:
    hiya..thanks your reply.

    the error is highlight at this line:
    Code:
    DataReport2.Orientation = rptOrientLandscape
    i upload the project file here.please help!
    Thanks ya!
    Attached Files Attached Files

  11. #11
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,511

    Re: how to set Landscape DataReports

    Try this,

    Code:
    Private Sub cmdPrint_Click()
    Dim strSQL As String
    Dim conDataConnection As Connection
    Dim start As String
    Dim enddate As String
    
     start = Format(DTPicker1.Value, "dd MMM yyyy")
    enddate = Format(DTPicker2.Value, "dd MMM yyyy")
    
    Set conDataConnection = New Connection
          conDataConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data    source= " & App.Path & _
                    "\Overtime.mdb;Persist Security Info=False"
    
    
    Dim rs As New ADODB.Recordset
    strSQL = "SELECT * FROM Overtime where OvertimeDate BETWEEN #" & start & "# and #" & enddate & "#"
    rs.Open strSQL, conDataConnection, adOpenStatic, adLockOptimistic
    
    
    'set the database source in rs
        Set DataReport2.DataSource = rs
        DataReport2.DataMember = rs.DataMember
        'then set the field
        DataReport2.Sections("section1").Controls.Item("Text1").DataField = "EmployeeName"
        DataReport2.Sections("section1").Controls.Item("Text2").DataField = "EmployeeNo"
        DataReport2.Sections("section1").Controls.Item("Text3").DataField = "Designation"
        DataReport2.Sections("section1").Controls.Item("Text4").DataField = "Department"
        DataReport2.Sections("section1").Controls.Item("Text5").DataField = "Shift"
        DataReport2.Sections("section1").Controls.Item("Text6").DataField = "OvertimeDate"
        DataReport2.Sections("section1").Controls.Item("Text7").DataField = "TimeFrom"
        DataReport2.Sections("section1").Controls.Item("Text8").DataField = "TimeTo"
        DataReport2.Sections("section1").Controls.Item("Text9").DataField = "Breaktime"
        DataReport2.Sections("section1").Controls.Item("Text10").DataField = "OtRate"
        DataReport2.Sections("section1").Controls.Item("Text11").DataField = "CategoryDay"
        DataReport2.Sections("section1").Controls.Item("Text12").DataField = "WorkDescript"
        DataReport2.Orientation = rptOrientLandscape
        DataReport2.Show vbModal
    End Sub
    If this has an error, show where error happens

  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    wes4dbt:
    hi,i post the error message here.Thanks for help!
    Attached Images Attached Images   

  13. #13
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,511

    Re: how to set Landscape DataReports

    Some things to try,

    Set the report rightmargin and leftmargin properties to 0.
    or
    The report you sent me was small enough to print without landscape, just adjust the design form right margin, then remove "datareport2.orientation = rptOrientLandscape".

    Will any of your reports print in landscape?
    Will your printer print in landscape?

    Let me know

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    wes4dbt:
    HI,thanks ya basically one of the report are able to print.but i still have one report need to print with landscape size.so what should i do??
    why the my datareport unable to support for this datareport2.orientation = rptOrientLandscape ??

    please help!

  15. #15
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,511

    Re: how to set Landscape DataReports

    If you able to print one of your reports in landscape then try this.

    Add a new datareport
    set the datasource and datamember
    put 1 text box on the report in the detail section
    run the report
    if it runs then set the orientation property to landscape
    run the report
    if it runs then start adding text boxes one at a time and running the report
    continue this untill you have all the text boxes you need for the report or until you get an error.
    This should help you find the problem.

    Datareport2 may be corrupted

    PS - Make sure you assign the data to the text boxes one at a time also.

  16. #16
    Fanatic Member
    Join Date
    May 2004
    Location
    Quetta-Pakistan
    Posts
    852

    Re: how to set Landscape DataReports

    Hi..
    Microsoft has launched the fix for this LANDSCAPE Error.
    Download pageset.exe from microsoft side or from all over the net by searching on GOOGLE.

  17. #17
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642

    Re: how to set Landscape DataReports

    Quote Originally Posted by gracehskuo
    wes4dbt:
    HI,thanks ya basically one of the report are able to print.but i still have one report need to print with landscape size.so what should i do??
    why the my datareport unable to support for this datareport2.orientation = rptOrientLandscape ??

    please help!
    have you applied Service Pack 6 to your VB/Visual Studio? with that service pack, orientation property is already included.
    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: how to set Landscape DataReports

    eimroda:
    hello,thank ya i reinstall the service park 6 to vb,now i can see the Orientation property appear.

    thanks for help!
    Last edited by gracehskuo; Sep 28th, 2007 at 01:18 AM.

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