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.
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!
Last edited by gracehskuo; Sep 11th, 2007 at 09:11 PM.
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?
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 ??
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.
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.
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.