hello, how to set Landscape size DataReports???
please help!:)
Printable View
hello, how to set Landscape size DataReports???
please help!:)
Change the property of the width of the paper to 11 inches and the heighth to 8.5 inches.
VBChick:
hiya...i upload the datareport properties image here.please guide.
Thanks ya!:blush:
What reporting tool are you using?
VBChick,
hiya...i'm using VB6 datareport tools.ok,i upload the datareport error message here,please help!:blush:
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.
This might help
rptData1.Orientation = rptOrientLandscape
rpData1.Show vbModal
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!
thanks 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
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.
wes4dbt:
hiya..thanks your reply.
the error is highlight at this line:
i upload the project file here.please help!Code:DataReport2.Orientation = rptOrientLandscape
Thanks ya!
Try this,
If this has an error, show where error happensCode: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
wes4dbt:
hi,i post the error message here.Thanks for help!
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
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!:blush:
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.
have you applied Service Pack 6 to your VB/Visual Studio? with that service pack, orientation property is already included. ;)Quote:
Originally Posted by gracehskuo
eimroda:
hello,thank ya i reinstall the service park 6 to vb,now i can see the Orientation property appear.
thanks for help!:thumb: