Data Report Editor Assistance

Hello everyone,

Two issues I need assistance with.
I am using the data report editor found within the Visual Basic 6.0 suite.
I built an ADO shape query to group my data.

Everything is printing ok, but I'm having difficulties changing the paper size in which to print to. Can anyone please help. I need the report to print to a legal sized document, but I cannot find where to set those changes. I can see where to set the report width and size, but when I print I keep getting the error, This report is larger than papersize. Apparently it has the default papersize of 8.5 x 11.

How can I set the printer paper size changes to work with the datareport?

Issue #2:
Is there a method, at runtime for a data report text box to have a conditional statement? For example I have two fields. Approved Hours and Worked Hours. I wanted to have them both invisible, UNLESS worked hours was greater than approved hours. Is there a way to do this within my report?

Here is the code I have.

[code]
VarSQL = "SHAPE " _
& "{SELECT T1.BatchNumber,T1.ProviderSSN,T1.ClientNumber," _
& "T1.Hours,T1.TTHours,T1.EndDate," _
& "T1.Codes,T1.PayrollCode," _
& "T2.SSN, T2.FirstN,T2.LastN," _
& "T3.ClientNumber, " _
& "T3.FirstName, T3.LastName, " _
& "T3.AppHours, T3.WrkHours " _
& "FROM (T1 LEFT JOIN T2 ON " _
& "T1.ProviderSSN = T2.SSN) " _
& "LEFT JOIN T3 ON " _
& "T1.ClientNumber = T3.ClientNumber" _
& "} AS TotalEdits " _
& "COMPUTE TotalEdits BY BatchNumber"

MsgBox VarSQL

' Temporary Payroll Table for Formatting
If EditsChkEmpRS.State = adStateOpen Then
EditsChkEmpRS.Close
End If
'setting cursor and open information for recordset table
With EditsChkEmpRS
.ActiveConnection = PRDB_SQL_SRVER 'PayrollDB
.CursorLocation = adUseServer
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Source = VarSQL
.Open
End With

varNum = EditsChkEmpRS.RecordCount

Set rptEdits.DataSource = EditsChkEmpRS

Printer.PaperSize = vbPRPSLegal

With rptEdits
.Orientation = rptOrientLandscape
.TopMargin = 0.5
.LeftMargin = 0.5
.RightMargin = 0.5
.BottomMargin = 0.5

With .Sections("Section4").Controls
.Item("Label2").Caption = "TVNS PAYROLL " & DeptNum & " EDITS REPORT"
End With

With .Sections("Section1").Controls
.Item("txtBatch").DataMember = ""
.Item("txtBatch").DataField = "BatchNumber"
End With

With .Sections("DataDetail").Controls
.Item("Text1").DataMember = "TotalEdits"
.Item("Text1").DataField = "ProviderSSN"
.Item("Text2").DataMember = "TotalEdits"
.Item("Text2").DataField = "FirstN"
.Item("Text3").DataMember = "TotalEdits"
.Item("Text3").DataField = "LastN"
.Item("Text4").DataMember = "TotalEdits"
.Item("Text4").DataField = "ClientNumber"
.Item("Text5").DataMember = "TotalEdits"
.Item("Text5").DataField = "FirstName"
.Item("Text6").DataMember = "TotalEdits"
.Item("Text6").DataField = "LastName"
.Item("Text7").DataMember = "TotalEdits"
.Item("Text7").DataField = "Hours"
.Item("Text8").DataMember = "TotalEdits"
.Item("Text8").DataField = "TTHours"
.Item("Text9").DataMember = "TotalEdits"
.Item("Text9").DataField = "EndDate"
.Item("Text10").DataMember = "TotalEdits"
.Item("Text10").DataField = "Codes"
.Item("Text11").DataMember = "TotalEdits"
.Item("Text11").DataField = "WrkHours"
.Item("Text12").DataMember = "TotalEdits"
.Item("Text12").DataField = "AppHours"
End With

With .Sections("Section6").Controls
.Item("Function1").DataMember = "TotalEdits"
.Item("Function1").DataField = "ProviderSSN"
.Item("Function2").DataMember = "TotalEdits"
.Item("Function2").DataField = "Hours"
.Item("Function3").DataMember = "TotalEdits"
.Item("Function3").DataField = "TTHours"
End With

With .Sections("Section5").Controls
.Item("Function4").DataMember = "TotalEdits"
.Item("Function4").DataField = "ProviderSSN"
.Item("Function5").DataMember = "TotalEdits"
.Item("Function5").DataField = "Hours"
.Item("Function6").DataMember = "TotalEdits"
.Item("Function6").DataField = "TTHours"
End With

.Show

End With
[/code]

Any Help is appreciated.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories