Returns information from any of five QuickBooks payroll reports:
Payroll Summary Reports can be generated if your application is accessing a company file that is currently signed up for a subscription to a payroll service. (If your application is not signed up, it will receive an error when it attempts to generate a report in this category.)
The restrictions noted above about payroll reports requiring the use of the Intuit Payroll service do not apply to the QuickBooks sample companies. You can still test out these reports on the sample companies without subscribing to the payroll service. For all other companies, however, the company must be subscribed.
Request
Response
XMLOps
VB.NET
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | <?xml version="1.0" encoding="utf-8"?> <?qbxml version="16.0"?> <QBXML> <QBXMLMsgsRq onError="stopOnError"> <PayrollDetailReportQueryRq> <!-- PayrollDetailReportType may have one of the following values: EmployeeStateTaxesDetail, PayrollItemDetail, PayrollReviewDetail, PayrollTransactionDetail, PayrollTransactionsByPayee --> <PayrollDetailReportType >ENUMTYPE</PayrollDetailReportType> <!-- required --> <DisplayReport >BOOLTYPE</DisplayReport> <!-- optional --> <!-- BEGIN OR --> <ReportPeriod> <!-- optional --> <FromReportDate >DATETYPE</FromReportDate> <!-- optional --> <ToReportDate >DATETYPE</ToReportDate> <!-- optional --> </ReportPeriod> <!-- OR --> <!-- ReportDateMacro may have one of the following values: All, Today, ThisWeek, ThisWeekToDate, ThisMonth, ThisMonthToDate, ThisQuarter, ThisQuarterToDate, ThisYear, ThisYearToDate, Yesterday, LastWeek, LastWeekToDate, LastMonth, LastMonthToDate, LastQuarter, LastQuarterToDate, LastYear, LastYearToDate, NextWeek, NextFourWeeks, NextMonth, NextQuarter, NextYear --> <ReportDateMacro >ENUMTYPE</ReportDateMacro> <!-- optional --> <!-- END OR --> <ReportAccountFilter> <!-- optional --> <!-- BEGIN OR --> <!-- AccountTypeFilter may have one of the following values: AccountsPayable, AccountsReceivable, AllowedFor1099, APAndSalesTax, APOrCreditCard, ARAndAP, Asset, BalanceSheet, Bank, BankAndARAndAPAndUF, BankAndUF, CostOfSales, CreditCard, CurrentAsset, CurrentAssetAndExpense, CurrentLiability, Equity, EquityAndIncomeAndExpense, ExpenseAndOtherExpense, FixedAsset, IncomeAndExpense, IncomeAndOtherIncome, Liability, LiabilityAndEquity, LongTermLiability, NonPosting, OrdinaryExpense, OrdinaryIncome, OrdinaryIncomeAndCOGS, OrdinaryIncomeAndExpense, OtherAsset, OtherCurrentAsset, OtherCurrentLiability, OtherExpense, OtherIncome, OtherIncomeOrExpense --> <AccountTypeFilter >ENUMTYPE</AccountTypeFilter> <!-- optional --> <!-- OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- OR --> <ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional --> <!-- OR --> <FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional --> <!-- END OR --> </ReportAccountFilter> <ReportEntityFilter> <!-- optional --> <!-- BEGIN OR --> <!-- EntityTypeFilter may have one of the following values: Customer, Employee, OtherName, Vendor --> <EntityTypeFilter >ENUMTYPE</EntityTypeFilter> <!-- optional --> <!-- OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- OR --> <ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional --> <!-- OR --> <FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional --> <!-- END OR --> </ReportEntityFilter> <ReportItemFilter> <!-- optional --> <!-- BEGIN OR --> <!-- ItemTypeFilter may have one of the following values: AllExceptFixedAsset, Assembly, Discount, FixedAsset, Inventory, InventoryAndAssembly, NonInventory, OtherCharge, Payment, Sales, SalesTax, Service --> <ItemTypeFilter >ENUMTYPE</ItemTypeFilter> <!-- optional --> <!-- OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- OR --> <ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional --> <!-- OR --> <FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional --> <!-- END OR --> </ReportItemFilter> <ReportClassFilter> <!-- optional --> <!-- BEGIN OR --> <ListID >IDTYPE</ListID> <!-- optional, may repeat --> <!-- OR --> <FullName >STRTYPE</FullName> <!-- optional, may repeat --> <!-- OR --> <ListIDWithChildren >IDTYPE</ListIDWithChildren> <!-- optional --> <!-- OR --> <FullNameWithChildren >STRTYPE</FullNameWithChildren> <!-- optional --> <!-- END OR --> </ReportClassFilter> <!-- BEGIN OR --> <ReportModifiedDateRangeFilter> <!-- optional --> <FromReportModifiedDate >DATETYPE</FromReportModifiedDate> <!-- optional --> <ToReportModifiedDate >DATETYPE</ToReportModifiedDate> <!-- optional --> </ReportModifiedDateRangeFilter> <!-- OR --> <!-- ReportModifiedDateRangeMacro may have one of the following values: All, Today, ThisWeek, ThisWeekToDate, ThisMonth, ThisMonthToDate, ThisQuarter, ThisQuarterToDate, ThisYear, ThisYearToDate, Yesterday, LastWeek, LastWeekToDate, LastMonth, LastMonthToDate, LastQuarter, LastQuarterToDate, LastYear, LastYearToDate, NextWeek, NextFourWeeks, NextMonth, NextQuarter, NextYear --> <ReportModifiedDateRangeMacro >ENUMTYPE</ReportModifiedDateRangeMacro> <!-- optional --> <!-- END OR --> <!-- ReportDetailLevelFilter may have one of the following values: All [DEFAULT], AllExceptSummary, SummaryOnly --> <ReportDetailLevelFilter >ENUMTYPE</ReportDetailLevelFilter> <!-- optional --> <!-- ReportPostingStatusFilter may have one of the following values: Either, NonPosting, Posting --> <ReportPostingStatusFilter >ENUMTYPE</ReportPostingStatusFilter> <!-- optional --> <!-- SummarizeRowsBy may have one of the following values: Account, BalanceSheet, Class, Customer, CustomerType, Day, Employee, FourWeek, HalfMonth, IncomeStatement, ItemDetail, ItemType, Month, Payee, PaymentMethod, PayrollItemDetail, PayrollYtdDetail, Quarter, SalesRep, SalesTaxCode, ShipMethod, TaxLine, Terms, TotalOnly, TwoWeek, Vendor, VendorType, Week, Year --> <SummarizeRowsBy >ENUMTYPE</SummarizeRowsBy> <!-- optional --> <!-- IncludeColumn may have one of the following values: Account, Aging, Amount, AmountDifference, AverageCost, BilledDate, BillingStatus, CalculatedAmount, Class, ClearedStatus, CostPrice, Credit, Currency, Date, Debit, DeliveryDate, DueDate, EstimateActive, ExchangeRate, FOB, IncomeSubjectToTax, Invoiced, Item, ItemDesc, LastModifiedBy, LatestOrPriorState, Memo, ModifiedTime, Name, NameAccountNumber, NameAddress, NameCity, NameContact, NameEmail, NameFax, NamePhone, NameState, NameZip, OpenBalance, OriginalAmount, PaidAmount, PaidStatus, PaidThroughDate, PaymentMethod, PayrollItem, PONumber, PrintStatus, ProgressAmount, ProgressPercent, Quantity, QuantityAvailable, QuantityOnHand, QuantityOnSalesOrder, ReceivedQuantity, RefNumber, RunningBalance, SalesRep, SalesTaxCode, SerialOrLotNumber, ShipDate, ShipMethod, SourceName, SplitAccount, SSNOrTaxID, TaxLine, TaxTableVersion, Terms, TxnID, TxnNumber, TxnType, UnitPrice, UserEdit, ValueOnHand, WageBase, WageBaseTips --> <IncludeColumn >ENUMTYPE</IncludeColumn> <!-- optional, may repeat --> <!-- IncludeAccounts may have one of the following values: All, InUse --> <IncludeAccounts >ENUMTYPE</IncludeAccounts> <!-- optional --> <!-- ReportOpenBalanceAsOf may have one of the following values: ReportEndDate, Today [DEFAULT] --> <ReportOpenBalanceAsOf >ENUMTYPE</ReportOpenBalanceAsOf> <!-- optional --> </PayrollDetailReportQueryRq> <PayrollDetailReportQueryRs statusCode="INTTYPE" statusSeverity="STRTYPE" statusMessage="STRTYPE"> <ReportRet> <!-- optional --> <ReportTitle >STRTYPE</ReportTitle> <!-- required --> <ReportSubtitle >STRTYPE</ReportSubtitle> <!-- required --> <!-- ReportBasis may have one of the following values: Accrual, Cash, None [DEFAULT] --> <ReportBasis >ENUMTYPE</ReportBasis> <!-- optional --> <NumRows >INTTYPE</NumRows> <!-- required --> <NumColumns >INTTYPE</NumColumns> <!-- required --> <NumColTitleRows >INTTYPE</NumColTitleRows> <!-- required --> <ColDesc colID="INTTYPE" dataType="ENUMTYPE"> <!-- required, may repeat --> <ColTitle titleRow="INTTYPE" value="STRTYPE"> <!-- required, may repeat --> </ColTitle> <!-- ColType may have one of the following values: Account, Addr1, Addr2, Addr3, Addr4, Addr5, Aging, Amount, AmountDifference, AverageCost, BilledDate, BillingStatus, Blank, CalculatedAmount, Class, ClearedStatus, CostPrice, CreateDate, Credit, CustomField, Date, Debit, DeliveryDate, DueDate, Duration, EarliestReceiptDate, EstimateActive, FOB, IncomeSubjectToTax, Invoiced, IsAdjustment, Item, ItemDesc, ItemVendor, Label, LastModifiedBy, LatestOrPriorState, Memo, ModifiedTime, Name, NameAccountNumber, NameAddress, NameCity, NameContact, NameEmail, NameFax, NamePhone, NameState, NameZip, OpenBalance, OriginalAmount, PaidAmount, PaidStatus, PaidThroughDate, PaymentMethod, PayrollItem, Percent, PercentChange, PercentOfTotalRetail, PercentOfTotalValue, PhysicalCount, PONumber, PrintStatus, ProgressAmount, ProgressPercent, Quantity, QuantityAvailable, QuantityOnHand, QuantityOnOrder, QuantityOnPendingBuild, QuantityOnSalesOrder, ReceivedQuantity, RefNumber, ReorderPoint, RetailValueOnHand, RunningBalance, SalesPerWeek, SalesRep, SalesTaxCode, ShipDate, ShipMethod, ShipToAddr1, ShipToAddr2, ShipToAddr3, ShipToAddr4, ShipToAddr5, SONumber, SourceName, SplitAccount, SSNOrTaxID, SuggestedReorder, TaxLine, TaxTableVersion, Terms, Total, TxnID, TxnNumber, TxnType, UnitPrice, UserEdit, ValueOnHand, WageBase, WageBaseTips --> <ColType >ENUMTYPE</ColType> <!-- required --> </ColDesc> <ReportData> <!-- optional --> <!-- BEGIN OR --> <DataRow> <!-- optional --> <RowData rowType="ENUMTYPE" value="STRTYPE"> <!-- optional --> </RowData> <ColData colID="INTTYPE" value="STRTYPE" dataType="ENUMTYPE"> <!-- optional, may repeat --> </ColData> </DataRow> <!-- OR --> <TextRow rowNumber="INTTYPE" value="STRTYPE"> <!-- optional --> </TextRow> <!-- OR --> <SubtotalRow> <!-- optional --> <RowData rowType="ENUMTYPE" value="STRTYPE"> <!-- optional --> </RowData> <ColData colID="INTTYPE" value="STRTYPE" dataType="ENUMTYPE"> <!-- optional, may repeat --> </ColData> </SubtotalRow> <!-- OR --> <TotalRow> <!-- optional --> <RowData rowType="ENUMTYPE" value="STRTYPE"> <!-- optional --> </RowData> <ColData colID="INTTYPE" value="STRTYPE" dataType="ENUMTYPE"> <!-- optional, may repeat --> </ColData> </TotalRow> <!-- END OR --> </ReportData> </ReportRet> </PayrollDetailReportQueryRs> </QBXMLMsgsRq> </QBXML> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 | 'The following sample code is generated as an illustration of 'Creating requests and parsing responses ONLY 'This code is NOT intended to show best practices or ideal code 'Use at your most careful discretion imports System imports System.Net imports System.Drawing imports System.Collections imports System.ComponentModel imports System.Windows.Forms imports System.Data imports System.IO imports Interop.QBFC16 Module com.intuit.idn.samples Public Class Sample Public Sub DoPayrollDetailReportQuery() Dim sessionBegun as Boolean sessionBegun = False Dim connectionOpen as Boolean connectionOpen = False Dim sessionManager as QBSessionManager sessionManager = nothing Try 'Create the session Manager object sessionManager = new QBSessionManager 'Create the message set request object to hold our request Dim requestMsgSet as IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0) requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue BuildPayrollDetailReportQueryRq(requestMsgSet) 'Connect to QuickBooks and begin a session sessionManager.OpenConnection("","Sample Code from OSR") connectionOpen = True sessionManager.BeginSession("", ENOpenMode.omDontCare) sessionBegun = True 'Send the request and get the response from QuickBooks Dim responseMsgSet as IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet) 'End the session and close the connection to QuickBooks sessionManager.EndSession() sessionBegun = False sessionManager.CloseConnection() connectionOpen = False WalkPayrollDetailReportQueryRs(responseMsgSet) Catch e as Exception MessageBox.Show(e.Message, "Error") if (sessionBegun) then sessionManager.EndSession() End If if (connectionOpen) then sessionManager.CloseConnection() End If End Try End Sub Public Sub BuildPayrollDetailReportQueryRq(requestMsgSet as IMsgSetRequest) Dim PayrollDetailReportQueryRq as IPayrollDetailReportQuery PayrollDetailReportQueryRq= requestMsgSet.AppendPayrollDetailReportQueryRq() 'Set field value for PayrollDetailReportType PayrollDetailReportQueryRq.PayrollDetailReportType.SetValue(ENPayrollDetailReportType.pdrtEmployeeStateTaxesDetail) 'Set field value for DisplayReport PayrollDetailReportQueryRq.DisplayReport.SetValue(True) Dim ORReportPeriodElementType17197 as String ORReportPeriodElementType17197 = "ReportPeriod" if (ORReportPeriodElementType17197 == "ReportPeriod") then 'Set field value for FromReportDate PayrollDetailReportQueryRq.ORReportPeriod.ReportPeriod.FromReportDate.SetValue(DateTime.Parse("12/15/2007")) 'Set field value for ToReportDate PayrollDetailReportQueryRq.ORReportPeriod.ReportPeriod.ToReportDate.SetValue(DateTime.Parse("12/15/2007")) End If if (ORReportPeriodElementType17197 == "ReportDateMacro") then 'Set field value for ReportDateMacro PayrollDetailReportQueryRq.ORReportPeriod.ReportDateMacro.SetValue(ENReportDateMacro.rdmAll) End If Dim ORReportAccountFilterElementType17198 as String ORReportAccountFilterElementType17198 = "AccountTypeFilter" if (ORReportAccountFilterElementType17198 == "AccountTypeFilter") then 'Set field value for AccountTypeFilter PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.AccountTypeFilter.SetValue(ENAccountTypeFilter.atfAccountsPayable) End If if (ORReportAccountFilterElementType17198 == "ListIDList") then 'Set field value for ListIDList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDList.Add("200000-1011023419") End If if (ORReportAccountFilterElementType17198 == "FullNameList") then 'Set field value for FullNameList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameList.Add("ab") End If if (ORReportAccountFilterElementType17198 == "ListIDWithChildren") then 'Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDWithChildren.SetValue("200000-1011023419") End If if (ORReportAccountFilterElementType17198 == "FullNameWithChildren") then 'Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameWithChildren.SetValue("ab") End If Dim ORReportEntityFilterElementType17199 as String ORReportEntityFilterElementType17199 = "EntityTypeFilter" if (ORReportEntityFilterElementType17199 == "EntityTypeFilter") then 'Set field value for EntityTypeFilter PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.EntityTypeFilter.SetValue(ENEntityTypeFilter.etfCustomer) End If if (ORReportEntityFilterElementType17199 == "ListIDList") then 'Set field value for ListIDList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDList.Add("200000-1011023419") End If if (ORReportEntityFilterElementType17199 == "FullNameList") then 'Set field value for FullNameList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add("ab") End If if (ORReportEntityFilterElementType17199 == "ListIDWithChildren") then 'Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDWithChildren.SetValue("200000-1011023419") End If if (ORReportEntityFilterElementType17199 == "FullNameWithChildren") then 'Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameWithChildren.SetValue("ab") End If Dim ORReportItemFilterElementType17200 as String ORReportItemFilterElementType17200 = "ItemTypeFilter" if (ORReportItemFilterElementType17200 == "ItemTypeFilter") then 'Set field value for ItemTypeFilter PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ItemTypeFilter.SetValue(ENItemTypeFilter.itfAllExceptFixedAsset) End If if (ORReportItemFilterElementType17200 == "ListIDList") then 'Set field value for ListIDList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDList.Add("200000-1011023419") End If if (ORReportItemFilterElementType17200 == "FullNameList") then 'Set field value for FullNameList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameList.Add("ab") End If if (ORReportItemFilterElementType17200 == "ListIDWithChildren") then 'Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDWithChildren.SetValue("200000-1011023419") End If if (ORReportItemFilterElementType17200 == "FullNameWithChildren") then 'Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameWithChildren.SetValue("ab") End If Dim ORReportClassFilterElementType17201 as String ORReportClassFilterElementType17201 = "ListIDList" if (ORReportClassFilterElementType17201 == "ListIDList") then 'Set field value for ListIDList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDList.Add("200000-1011023419") End If if (ORReportClassFilterElementType17201 == "FullNameList") then 'Set field value for FullNameList 'May create more than one of these if needed PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameList.Add("ab") End If if (ORReportClassFilterElementType17201 == "ListIDWithChildren") then 'Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDWithChildren.SetValue("200000-1011023419") End If if (ORReportClassFilterElementType17201 == "FullNameWithChildren") then 'Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameWithChildren.SetValue("ab") End If Dim ORReportModifiedDateElementType17202 as String ORReportModifiedDateElementType17202 = "ReportModifiedDateRangeFilter" if (ORReportModifiedDateElementType17202 == "ReportModifiedDateRangeFilter") then 'Set field value for FromReportModifiedDate PayrollDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.FromReportModifiedDate.SetValue(DateTime.Parse("12/15/2007")) 'Set field value for ToReportModifiedDate PayrollDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.ToReportModifiedDate.SetValue(DateTime.Parse("12/15/2007")) End If if (ORReportModifiedDateElementType17202 == "ReportModifiedDateRangeMacro") then 'Set field value for ReportModifiedDateRangeMacro PayrollDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeMacro.SetValue(ENReportModifiedDateRangeMacro.rmdrmAll) End If 'Set field value for ReportDetailLevelFilter PayrollDetailReportQueryRq.ReportDetailLevelFilter.SetValue(ENReportDetailLevelFilter.rdlfAll [DEFAULT]) 'Set field value for ReportPostingStatusFilter PayrollDetailReportQueryRq.ReportPostingStatusFilter.SetValue(ENReportPostingStatusFilter.rpsfEither) 'Set field value for SummarizeRowsBy PayrollDetailReportQueryRq.SummarizeRowsBy.SetValue(ENSummarizeRowsBy.srbAccount) 'Set field value for IncludeColumnList 'May create more than one of these if needed PayrollDetailReportQueryRq.IncludeColumnList.Add(ENIncludeColumnList.iclAccount) 'Set field value for IncludeAccounts PayrollDetailReportQueryRq.IncludeAccounts.SetValue(ENIncludeAccounts.iaAll) 'Set field value for ReportOpenBalanceAsOf PayrollDetailReportQueryRq.ReportOpenBalanceAsOf.SetValue(ENReportOpenBalanceAsOf.robaoReportEndDate) End Sub Public Sub WalkPayrollDetailReportQueryRs( responseMsgSet as IMsgSetResponse) if (responseMsgSet is nothing) then Exit Sub End If Dim responseList as IResponseList responseList = responseMsgSet.ResponseList if (responseList is nothing) then Exit Sub End If 'if we sent only one request, there is only one response, we'll walk the list for this sample for j=0 to responseList.Count-1 Dim response as IResponse response = responseList.GetAt(j) 'check the status code of the response, 0=ok, >0 is warning if (response.StatusCode >= 0) then 'the request-specific response is in the details, make sure we have some if (not response.Detail is nothing) then 'make sure the response is the type we're expecting Dim responseType as ENResponseType responseType = CType(response.Type.GetValue(),ENResponseType) if (responseType == ENResponseType.rtPayrollDetailReportQueryRs) then 'upcast to more specific type here, this is safe because we checked with response.Type check above Dim ReportRet as IReportRet ReportRet = CType(response.Detail,IReportRet) WalkReportRet(ReportRet) End If End If End If Next j End Sub Public Sub WalkReportRet(ReportRet as IReportRet) if (ReportRet is nothing) then Exit Sub End If 'Go through all the elements of IReportRet 'Get value of ReportTitle Dim ReportTitle17203 as String ReportTitle17203 = ReportRet.ReportTitle.GetValue() 'Get value of ReportSubtitle Dim ReportSubtitle17204 as String ReportSubtitle17204 = ReportRet.ReportSubtitle.GetValue() 'Get value of ReportBasis if ( not ReportRet.ReportBasis is nothing) then Dim ReportBasis17205 as ENReportBasis ReportBasis17205 = ReportRet.ReportBasis.GetValue() End If 'Get value of NumRows Dim NumRows17206 as Integer NumRows17206 = ReportRet.NumRows.GetValue() 'Get value of NumColumns Dim NumColumns17207 as Integer NumColumns17207 = ReportRet.NumColumns.GetValue() 'Get value of NumColTitleRows Dim NumColTitleRows17208 as Integer NumColTitleRows17208 = ReportRet.NumColTitleRows.GetValue() if (not ReportRet.ColDescList is nothing) Dim i17209 as Integer for i17209 = 0 to ReportRet.ColDescList.Count - 1 Dim ColDesc as IColDesc ColDesc = ReportRet.ColDescList.GetAt(i17209) if (not ColDescColTitleList is nothing) Dim i17210 as Integer for i17210 = 0 to ColDescColTitleList.Count - 1 Dim ColTitle as IColTitle ColTitle = ColDescColTitleList.GetAt(i17210) Next i17210 End If 'Get value of ColType Dim ColType17211 as ENColType ColType17211 = ColDescColType.GetValue() Next i17209 End If if (not ReportRet.ReportData. is nothing) then if (not ReportRet.ReportData.ORReportDataList is nothing) then Dim i17212 as Integer for i17212 = 0 to ReportRet.ReportData.ORReportDataList.Count - 1 Dim ORReportData17213 as IORReportData ORReportData17213 = ReportRet.ReportData.ORReportDataList.GetAt(i17212) if (not ORReportData17213.DataRow is nothing) then if (not ORReportData17213.DataRow. is nothing) then if (not ORReportData17213.DataRow.RowData. is nothing) then End If if (not ORReportData17213.DataRow.ColDataList is nothing) Dim i17214 as Integer for i17214 = 0 to ORReportData17213.DataRow.ColDataList.Count - 1 Dim ColData as IColData ColData = ORReportData17213.DataRow.ColDataList.GetAt(i17214) Next i17214 End If End If End If if (not ORReportData17213.TextRow is nothing) then if (not ORReportData17213.TextRow. is nothing) then End If End If if (not ORReportData17213.SubtotalRow is nothing) then if (not ORReportData17213.SubtotalRow. is nothing) then if (not ORReportData17213.SubtotalRow.RowData. is nothing) then End If if (not ORReportData17213.SubtotalRow.ColDataList is nothing) Dim i17215 as Integer for i17215 = 0 to ORReportData17213.SubtotalRow.ColDataList.Count - 1 Dim ColData as IColData ColData = ORReportData17213.SubtotalRow.ColDataList.GetAt(i17215) Next i17215 End If End If End If if (not ORReportData17213.TotalRow is nothing) then if (not ORReportData17213.TotalRow. is nothing) then if (not ORReportData17213.TotalRow.RowData. is nothing) then End If if (not ORReportData17213.TotalRow.ColDataList is nothing) Dim i17216 as Integer for i17216 = 0 to ORReportData17213.TotalRow.ColDataList.Count - 1 Dim ColData as IColData ColData = ORReportData17213.TotalRow.ColDataList.GetAt(i17216) Next i17216 End If End If End If Next i17212 End If End If End Sub End Class End Module |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | //The following sample code is generated as an illustration of //Creating requests and parsing responses ONLY //This code is NOT intended to show best practices or ideal code //Use at your most careful discretion using System; using System.Net; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.IO; using Interop.QBFC16; namespace com.intuit.idn.samples { public class Sample { public void DoPayrollDetailReportQuery() { bool sessionBegun = false; bool connectionOpen = false; QBSessionManager sessionManager = null; try { //Create the session Manager object sessionManager = new QBSessionManager(); //Create the message set request object to hold our request IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US",16,0); requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue; BuildPayrollDetailReportQueryRq(requestMsgSet); //Connect to QuickBooks and begin a session sessionManager.OpenConnection("","Sample Code from OSR"); connectionOpen = true; sessionManager.BeginSession("", ENOpenMode.omDontCare); sessionBegun = true; //Send the request and get the response from QuickBooks IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet); //End the session and close the connection to QuickBooks sessionManager.EndSession(); sessionBegun = false; sessionManager.CloseConnection(); connectionOpen = false; WalkPayrollDetailReportQueryRs(responseMsgSet); } catch (Exception e) { MessageBox.Show(e.Message, "Error"); if (sessionBegun) { sessionManager.EndSession(); } if (connectionOpen) { sessionManager.CloseConnection(); } } } void BuildPayrollDetailReportQueryRq(IMsgSetRequest requestMsgSet) { IPayrollDetailReportQuery PayrollDetailReportQueryRq= requestMsgSet.AppendPayrollDetailReportQueryRq(); //Set field value for PayrollDetailReportType PayrollDetailReportQueryRq.PayrollDetailReportType.SetValue(ENPayrollDetailReportType.pdrtEmployeeStateTaxesDetail); //Set field value for DisplayReport PayrollDetailReportQueryRq.DisplayReport.SetValue(true); string ORReportPeriodElementType17177 = "ReportPeriod"; if (ORReportPeriodElementType17177 == "ReportPeriod") { //Set field value for FromReportDate PayrollDetailReportQueryRq.ORReportPeriod.ReportPeriod.FromReportDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for ToReportDate PayrollDetailReportQueryRq.ORReportPeriod.ReportPeriod.ToReportDate.SetValue(DateTime.Parse("12/15/2007")); } if (ORReportPeriodElementType17177 == "ReportDateMacro") { //Set field value for ReportDateMacro PayrollDetailReportQueryRq.ORReportPeriod.ReportDateMacro.SetValue(ENReportDateMacro.rdmAll); } string ORReportAccountFilterElementType17178 = "AccountTypeFilter"; if (ORReportAccountFilterElementType17178 == "AccountTypeFilter") { //Set field value for AccountTypeFilter PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.AccountTypeFilter.SetValue(ENAccountTypeFilter.atfAccountsPayable); } if (ORReportAccountFilterElementType17178 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDList.Add("200000-1011023419"); } if (ORReportAccountFilterElementType17178 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameList.Add("ab"); } if (ORReportAccountFilterElementType17178 == "ListIDWithChildren") { //Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDWithChildren.SetValue("200000-1011023419"); } if (ORReportAccountFilterElementType17178 == "FullNameWithChildren") { //Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameWithChildren.SetValue("ab"); } string ORReportEntityFilterElementType17179 = "EntityTypeFilter"; if (ORReportEntityFilterElementType17179 == "EntityTypeFilter") { //Set field value for EntityTypeFilter PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.EntityTypeFilter.SetValue(ENEntityTypeFilter.etfCustomer); } if (ORReportEntityFilterElementType17179 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDList.Add("200000-1011023419"); } if (ORReportEntityFilterElementType17179 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add("ab"); } if (ORReportEntityFilterElementType17179 == "ListIDWithChildren") { //Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDWithChildren.SetValue("200000-1011023419"); } if (ORReportEntityFilterElementType17179 == "FullNameWithChildren") { //Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameWithChildren.SetValue("ab"); } string ORReportItemFilterElementType17180 = "ItemTypeFilter"; if (ORReportItemFilterElementType17180 == "ItemTypeFilter") { //Set field value for ItemTypeFilter PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ItemTypeFilter.SetValue(ENItemTypeFilter.itfAllExceptFixedAsset); } if (ORReportItemFilterElementType17180 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDList.Add("200000-1011023419"); } if (ORReportItemFilterElementType17180 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameList.Add("ab"); } if (ORReportItemFilterElementType17180 == "ListIDWithChildren") { //Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDWithChildren.SetValue("200000-1011023419"); } if (ORReportItemFilterElementType17180 == "FullNameWithChildren") { //Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameWithChildren.SetValue("ab"); } string ORReportClassFilterElementType17181 = "ListIDList"; if (ORReportClassFilterElementType17181 == "ListIDList") { //Set field value for ListIDList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDList.Add("200000-1011023419"); } if (ORReportClassFilterElementType17181 == "FullNameList") { //Set field value for FullNameList //May create more than one of these if needed PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameList.Add("ab"); } if (ORReportClassFilterElementType17181 == "ListIDWithChildren") { //Set field value for ListIDWithChildren PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDWithChildren.SetValue("200000-1011023419"); } if (ORReportClassFilterElementType17181 == "FullNameWithChildren") { //Set field value for FullNameWithChildren PayrollDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameWithChildren.SetValue("ab"); } string ORReportModifiedDateElementType17182 = "ReportModifiedDateRangeFilter"; if (ORReportModifiedDateElementType17182 == "ReportModifiedDateRangeFilter") { //Set field value for FromReportModifiedDate PayrollDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.FromReportModifiedDate.SetValue(DateTime.Parse("12/15/2007")); //Set field value for ToReportModifiedDate PayrollDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.ToReportModifiedDate.SetValue(DateTime.Parse("12/15/2007")); } if (ORReportModifiedDateElementType17182 == "ReportModifiedDateRangeMacro") { //Set field value for ReportModifiedDateRangeMacro PayrollDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeMacro.SetValue(ENReportModifiedDateRangeMacro.rmdrmAll); } //Set field value for ReportDetailLevelFilter PayrollDetailReportQueryRq.ReportDetailLevelFilter.SetValue(ENReportDetailLevelFilter.rdlfAll [DEFAULT]); //Set field value for ReportPostingStatusFilter PayrollDetailReportQueryRq.ReportPostingStatusFilter.SetValue(ENReportPostingStatusFilter.rpsfEither); //Set field value for SummarizeRowsBy PayrollDetailReportQueryRq.SummarizeRowsBy.SetValue(ENSummarizeRowsBy.srbAccount); //Set field value for IncludeColumnList //May create more than one of these if needed PayrollDetailReportQueryRq.IncludeColumnList.Add(ENIncludeColumnList.iclAccount); //Set field value for IncludeAccounts PayrollDetailReportQueryRq.IncludeAccounts.SetValue(ENIncludeAccounts.iaAll); //Set field value for ReportOpenBalanceAsOf PayrollDetailReportQueryRq.ReportOpenBalanceAsOf.SetValue(ENReportOpenBalanceAsOf.robaoReportEndDate); } void WalkPayrollDetailReportQueryRs(IMsgSetResponse responseMsgSet) { if (responseMsgSet == null) return; IResponseList responseList = responseMsgSet.ResponseList; if (responseList == null) return; //if we sent only one request, there is only one response, we'll walk the list for this sample for(int i=0; i < responseList.Count; i++) { IResponse response = responseList.GetAt(i); //check the status code of the response, 0=ok, >0 is warning if (response.StatusCode >= 0) { //the request-specific response is in the details, make sure we have some if (response.Detail != null) { //make sure the response is the type we're expecting ENResponseType responseType = (ENResponseType)response.Type.GetValue(); if (responseType == ENResponseType.rtPayrollDetailReportQueryRs) { //upcast to more specific type here, this is safe because we checked with response.Type check above IReportRet ReportRet = (IReportRet)response.Detail; WalkReportRet(ReportRet); } } } } } void WalkReportRet(IReportRet ReportRet) { if (ReportRet == null) return; //Go through all the elements of IReportRet //Get value of ReportTitle string ReportTitle17183 = (string)ReportRet.ReportTitle.GetValue(); //Get value of ReportSubtitle string ReportSubtitle17184 = (string)ReportRet.ReportSubtitle.GetValue(); //Get value of ReportBasis if (ReportRet.ReportBasis != null) { ENReportBasis ReportBasis17185 = (ENReportBasis)ReportRet.ReportBasis.GetValue(); } //Get value of NumRows int NumRows17186 = (int)ReportRet.NumRows.GetValue(); //Get value of NumColumns int NumColumns17187 = (int)ReportRet.NumColumns.GetValue(); //Get value of NumColTitleRows int NumColTitleRows17188 = (int)ReportRet.NumColTitleRows.GetValue(); if (ReportRet.ColDescList != null) { for (int i17189 = 0; i17189 < ReportRet.ColDescList.Count; i17189++) { IColDesc ColDesc = ReportRet.ColDescList.GetAt(i17189); if (ColDesc.ColTitleList != null) { for (int i17190 = 0; i17190 < ColDesc.ColTitleList.Count; i17190++) { IColTitle ColTitle = ColDesc.ColTitleList.GetAt(i17190); } } //Get value of ColType ENColType ColType17191 = (ENColType)ColDesc.ColType.GetValue(); } } if (ReportRet.ReportData != null) { if (ReportRet.ReportData.ORReportDataList != null) { for (int i17192 = 0; i17192 < ReportRet.ReportData.ORReportDataList.Count; i17192++) { IORReportData ORReportData17193 = ReportRet.ReportData.ORReportDataList.GetAt(i17192); if (ORReportData17193.DataRow != null) { if (ORReportData17193.DataRow != null) { if (ORReportData17193.DataRow.RowData != null) { } if (ORReportData17193.DataRow.ColDataList != null) { for (int i17194 = 0; i17194 < ORReportData17193.DataRow.ColDataList.Count; i17194++) { IColData ColData = ORReportData17193.DataRow.ColDataList.GetAt(i17194); } } } } if (ORReportData17193.TextRow != null) { if (ORReportData17193.TextRow != null) { } } if (ORReportData17193.SubtotalRow != null) { if (ORReportData17193.SubtotalRow != null) { if (ORReportData17193.SubtotalRow.RowData != null) { } if (ORReportData17193.SubtotalRow.ColDataList != null) { for (int i17195 = 0; i17195 < ORReportData17193.SubtotalRow.ColDataList.Count; i17195++) { IColData ColData = ORReportData17193.SubtotalRow.ColDataList.GetAt(i17195); } } } } if (ORReportData17193.TotalRow != null) { if (ORReportData17193.TotalRow != null) { if (ORReportData17193.TotalRow.RowData != null) { } if (ORReportData17193.TotalRow.ColDataList != null) { for (int i17196 = 0; i17196 < ORReportData17193.TotalRow.ColDataList.Count; i17196++) { IColData ColData = ORReportData17193.TotalRow.ColDataList.GetAt(i17196); } } } } } } } } } } |