GeneralDetailReportQuery(2.0)

You use this report query to get any of the supported QuickBooks detail reports, which you specify in the GeneralDetailReportType. You can optionally display the report within QB by setting DisplayReport to True.
You can also use this detail report to get information not obtainable from various SDK queries. For example, suppose you wanted the cleared status from a BillPaymentCheck; the BillPaymentCheckQuery wouldn’t have this info, but you could use this general detail report and specify the column ClearedStatus to find that information.
Also, if you wanted to query the accounts receivable directly, you could do a General Detail Report Query with the report type set to Open Invoices.
You could also use this report if you needed to run a report on all invoice changes made in a specific day, and only include changes to invoices from a given past month, if the audit trail is on in QuickBooks. You would use a GeneralDetailReport query with the report type set to AuditTrail.
Notice that if a line is paid, PaidStatus == “X”. If a line is not paid, no entry for PaidStatus is returned.
However, in the same report run within the QB GUI, the following behavior is observed: This differs from the UI, where if the line is paid, an entry of “Paid” is displayed and if the line is not paid, an entry of “Unpaid” is displayed.

Request

Response

XMLOps

VB.NET

C#

Tag Type Max length Implementation Required

IGeneralDetailReportQuery

You use this report query to get any of the supported QuickBooks detail reports, which you specify in the GeneralDetailReportType. You can optionally display the report within QB by setting DisplayReport to True. You can also use this detail report to get information not obtainable from various SDK queries. For example, suppose you wanted the cleared status from a BillPaymentCheck; the BillPaymentCheckQuery wouldn’t have this info, but you could use this general detail report and specify the column ClearedStatus to find that information. Also, if you wanted to query the accounts receivable directly, you could do a General Detail Report Query with the report type set to Open Invoices. You could also use this report if you needed to run a report on all invoice changes made in a specific day, and only include changes to invoices from a given past month, if the audit trail is on in QuickBooks. You would use a GeneralDetailReport query with the report type set to AuditTrail. Notice that if a line is paid, PaidStatus == “X”. If a line is not paid, no entry for PaidStatus is returned. However, in the same report run within the QB GUI, the following behavior is observed: This differs from the UI, where if the line is paid, an entry of “Paid” is displayed and if the line is not paid, an entry of “Unpaid” is displayed.
    2.0  

GeneralDetailReportType

The type of general detail report to return. (If you specify gdrtMissingChecks, you must also specify an account type in the account filter.)
IQBENGeneralDetailReportTypeType     Y

DisplayReport

Set DisplayReport to true to display this report within the QuickBooks UI. (Default is false.) If you want the request to display the report without returning any data to your application, set the responseData attribute to includeNone.
IQBBoolType   3.0  

ORReportPeriod

IORReportPeriod      

ReportPeriod

If you omit both ToReportDate and FromReportDate, the report will cover the current fiscal year to date.
IReportPeriod      

FromReportDate

Selects information from this date and later. The range of acceptable FromReportDate and ToReportDate values depends on how the report dates are determined. If the report dates are based on the dates of transactions, the range is 01/01/1901 to 12/31/9999. If the report dates are based on modification dates, the range will be 1970-01-01 to 2038-01-19T03:14:07 (2038-01-18T19:14:07-08:00 PST). If you omit FromReportDate, it will be set to 1970-01-01T00:00:00 (1969-12-31T16:00:00-08:00 PST).
IQBDateType      

ToReportDate

Selects information created on this date or earlier. The range of acceptable ToReportDate and FromReportDate values depends on how the report dates are determined. If the report dates are based on the dates of transactions, the range is 01/01/1901 to 12/31/9999. If the report dates are based on modification dates, the range will be 1970-01-01 to 2038-01-19T03:14:07 (2038-01-18T19:14:07-08:00 PST). If you omit ToReportDate, it will be set to 2038-01-19T03:14:07 (2038-01-18T19:14:07-08:00 PST).
IQBDateType      

ReportDateMacro

The time period covered by this report.
IQBENReportDateMacroType      

ReportAccountFilter

Allows you to query for a specified account type or for specific list elements.
IReportAccountFilter      

ORReportAccountFilter

IORReportAccountFilter     Y

AccountTypeFilter

Allows you to report on a specific account type.
IQBENAccountTypeFilterType      

ListIDList

One or more ListID values. Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IBSTRList      

FullNameList

A list of one or more FullName values. FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IBSTRList      

ListIDWithChildren

Allows you to filter for data that relates to the specified object and its descendants.
IQBIDType      

FullNameWithChildren

Allows you to filter for data that relates to the specified object and its descendants. For names that do not have children, FullNameWithChildren is exactly the same as FullName.
IQBStringType      

ReportEntityFilter

Allows you to query for a specified name type (customer, employee, vendor, or other) or query for specific list elements.
IReportEntityFilter      

ORReportEntityFilter

IORReportEntityFilter     Y

EntityTypeFilter

Allows you to report on a specific name type.
IQBENEntityTypeFilterType      

ListIDList

One or more ListID values. Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IBSTRList      

FullNameList

A list of one or more FullName values. FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IBSTRList      

ListIDWithChildren

Allows you to filter for data that relates to the specified object and its descendants.
IQBIDType      

FullNameWithChildren

Allows you to filter for data that relates to the specified object and its descendants. For names that do not have children, FullNameWithChildren is exactly the same as FullName.
IQBStringType      

ReportItemFilter

Allows you to query for a specified item type (for example, discount, inventory, or non-inventory) or query for specific list elements.
IReportItemFilter      

ORReportItemFilter

IORReportItemFilter     Y

ItemTypeFilter

Allows you to report on a specific item type.
IQBENItemTypeFilterType      

ListIDList

One or more ListID values. Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IBSTRList      

FullNameList

A list of one or more FullName values. FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IBSTRList      

ListIDWithChildren

Allows you to filter for data that relates to the specified object and its descendants.
IQBIDType      

FullNameWithChildren

Allows you to filter for data that relates to the specified object and its descendants. For names that do not have children, FullNameWithChildren is exactly the same as FullName.
IQBStringType      

ReportClassFilter

Allows you to query for a specified class. Classes can be used to separate transactions into meaningful categories. (For example, transactions could be classified according to department, business location, or type of work.) In QuickBooks, class tracking is off by default.
IReportClassFilter   2.1  

ORReportClassFilter

IORReportClassFilter     Y

ListIDList

One or more ListID values. Along with FullName, ListID is a way to identify a list object. When a list object is added to QuickBooks through the SDK or through the QuickBooks user interface, the server assigns it a ListID. A ListID is not unique across lists, but it is unique across each particular type of list. For example, two customers could not have the same ListID, and a customer could not have the same ListID as an employee (because Customer and Employee are both name lists). But a customer could have the same ListID as a non-inventory item.
IBSTRList      

FullNameList

A list of one or more FullName values. FullName (along with ListID) is a way to identify a list object. The FullName is the name prefixed by the names of each ancestor, for example Jones:Kitchen:Cabinets. FullName values are not case-sensitive.
IBSTRList      

ListIDWithChildren

Allows you to filter for data that relates to the specified object and its descendants.
IQBIDType      

FullNameWithChildren

Allows you to filter for data that relates to the specified object and its descendants. For names that do not have children, FullNameWithChildren is exactly the same as FullName.
IQBStringType      

ReportTxnTypeFilter

Allows you to report on specific transaction types (for example, charge, check, deposit, or estimate).
IReportTxnTypeFilter      

TxnTypeFilterList

A list of the transaction types you want the report to cover.
IENTxnTypeFilterList     Y

ORReportModifiedDate

IORReportModifiedDate   3.0  

ReportModifiedDateRangeFilter

Returns reports that were modified between these two dates (inclusive). The range of acceptable dates for both FromReportModifiedDate and ToReportModifiedDate is 1970-01-01 to 2038-01-19T03:14:07 (2038-01-18T19:14:07-08:00 PST).
IReportModifiedDateRangeFilter      

FromReportModifiedDate

Selects information from this date and later. The range of acceptable dates is 1970-01-01 to 2038-01-19T03:14:07 (2038-01-18T19:14:07-08:00 PST).
IQBDateType      

ToReportModifiedDate

Selects information created on this date or earlier. The range of acceptable dates is 1970-01-01 to 2038-01-19T03:14:07 (2038-01-18T19:14:07-08:00 PST).
IQBDateType      

ReportModifiedDateRangeMacro

The time period covered by this report.
IQBENReportModifiedDateRangeMacroType      

ReportDetailLevelFilter

The level of detail to include in the report.
IQBENReportDetailLevelFilterType   3.0  

ReportPostingStatusFilter

Allows you to query for posting reports, non-posting reports, or reports that are either one.
IQBENReportPostingStatusFilterType   3.0  

SummarizeRowsBy

SummarizeRowsBy (along with IncludeColumnList, in most cases) determines what data is calculated for this report and controls how the rows are organized and labeled. For example, if you set the value to srbAccount, the report’s row labels might be “Checking,” “Savings,” and so on.
IQBENSummarizeRowsByType      

IncludeColumnList

A list of enum values showing which columns you want the report to return. (The report won’t return columns other than the ones you specify here.)
IENIncludeColumnList      

IncludeAccounts

Indicates whether this report should include all accounts or just those that are currently in use.
IQBENIncludeAccountsType      

ReportOpenBalanceAsOf

The report will return open balance information up to the ReportOpenBalanceAsOf date.
IQBENReportOpenBalanceAsOfType      

ReportBasis

If ReportBasis is rbCash, the report bases income and expenses on the dates when money changed hands.rbAccrual, the report bases income on the dates when customers were invoiced and bases expenses on the dates when bills were entered.rbNone, the report uses the default ReportBasis, which is either the QuickBooks Preference setting or the QuickBooks default for a given type of report. In a report response, the SDK returns rbNone for reports that do not support ReportBasis. (The 1099 report, for example, has its own basis for generation.)
IQBENReportBasisType   2.1  
Tag Type Max length Implementation Required

IResponse

You use this report query to get any of the supported QuickBooks detail reports, which you specify in the GeneralDetailReportType. You can optionally display the report within QB by setting DisplayReport to True. You can also use this detail report to get information not obtainable from various SDK queries. For example, suppose you wanted the cleared status from a BillPaymentCheck; the BillPaymentCheckQuery wouldn’t have this info, but you could use this general detail report and specify the column ClearedStatus to find that information. Also, if you wanted to query the accounts receivable directly, you could do a General Detail Report Query with the report type set to Open Invoices. You could also use this report if you needed to run a report on all invoice changes made in a specific day, and only include changes to invoices from a given past month, if the audit trail is on in QuickBooks. You would use a GeneralDetailReport query with the report type set to AuditTrail. Notice that if a line is paid, PaidStatus == “X”. If a line is not paid, no entry for PaidStatus is returned. However, in the same report run within the QB GUI, the following behavior is observed: This differs from the UI, where if the line is paid, an entry of “Paid” is displayed and if the line is not paid, an entry of “Unpaid” is displayed.
    2.0  

StatusCode

A number that corresponds to a statusSeverity and statusMessage. Five status codes relate directly to signon messages: 2000, 2010, 2020, 2030, and 2040. For details about these and other statusCode values that can be returned, see the statusCode table on the Error Codes page.
IQBIntType     Y

StatusSeverity

One of the following values: INFO The request was completed, and the results are consistent with what your application expected. WARNING The request was completed, but the results might not be consistent with what you expected. ERROR The request was not completed. No data will appear in the server’s response after the statusMessage.
IQBStringType     Y

StatusMessage

A user-readable explanation of the success or error condition that is indicated by the statusCode. For details about the statusMessage values that can be returned, see the “Explanation” column of the statusCode table on the Error Codes page.
IQBStringType     Y

Detail

IReportRet      

ReportTitle

The main title for this report.
IQBStringType     Y

ReportSubtitle

The subtitle for this report.
IQBStringType     Y

ReportBasis

If ReportBasis is rbCash, the report bases income and expenses on the dates when money changed hands.rbAccrual, the report bases income on the dates when customers were invoiced and bases expenses on the dates when bills were entered.rbNone, the report uses the default ReportBasis, which is either the QuickBooks Preference setting or the QuickBooks default for a given type of report. In a report response, the SDK returns rbNone for reports that do not support ReportBasis. (The 1099 report, for example, has its own basis for generation.)
IQBENReportBasisType      

NumRows

The number of rows in the report.
IQBIntType     Y

NumColumns

The number of columns in the report.
IQBIntType     Y

NumColTitleRows

The number of rows to allocate for column titles. Although this number is usually 1, with some reports it is 2 or 3. (For an example of column titles that span multiple rows, look at a ProfitAndLossByJob report in QuickBooks.)
IQBIntType     Y

ColDescList

A list of IColDesc objects, each of which identifies one column in the report. Each column is identified by a colID (the position of the column in the report), a title, and a type. If the report contains any data, it is given row-by-row in an IReportData object.
IColDescList     Y

(List

of IColDesc Objects)
       

colID

An identifying number that corresponds to the position of this column in the report. The columns are numbered from left to right, starting with 1.
IQBIntType     Y

dataType

The data type: IDTYPE, STRTYPE, and so on.
IQBENdataTypeType     Y

ColTitleList

A list of IColTitle objects, each of which represents a title for this column. For example, if the first two rows of this column were titles, two IColTitle objects would be returned.
IColTitleList     Y

(List

of IColTitle Objects)
       

titleRow

The number of this title row. For example, if the first three rows of a report were titles, titleRow of the third of these rows would be 3.
IQBIntType     Y

value

The data in this cell of the report.
IQBStringType     Y

ColType

The type of data that this column contains. ColType values are formatted types. (Returned ctPercent values, for example, will have digits after the decimal points, and ctAddr1 values will be strings.)
IQBENColTypeType     Y

ReportData

If the report contains any data, it is given row-by-row in a ReportData aggregate.
IReportData      

ORReportDataList

IORReportDataList     Y

(List

of IORReportData Objects)
       

DataRow

A data row contains the actual data for each column.
IDataRow      

RowData

RowData describes one row in the report.
IRowData      

rowType

An enumerated value that shows the type of data that this row contains. Values: account class customer customerMessage customerType employee item jobType label memorizedTxn memorizedReport name otherName paymentMethod payrollItem salesRep salesTaxCode shipMethod state style terms toDo vendor vendorType
IQBENrowTypeType      

value

The data in this cell of the report.
IQBStringType      

ColDataList

A list of IColData objects, each of which describes the data in one cell of the report.
IColDataList      

(List

of IColData Objects)
       

colID

An identifying number that corresponds to the position of this column in the report. The columns are numbered from left to right, starting with 1.
IQBIntType     Y

value

The data in this cell of the report.
IQBStringType     Y

dataType

The data type: IDTYPE, STRTYPE, and so on.
IQBENdataTypeType     Y

TextRow

A text row contains only text and is used mainly for headings.
ITextRow      

rowNumber

The row number. Rows are numbered from top to bottom, starting with 1.
IQBIntType     Y

value

The data in this cell of the report.
IQBStringType     Y

SubtotalRow

A row that contains a calculated subtotal of the data in all the rows since the last SubTotalRow and, usually, a single underline. There can be multiple SubTotalRow aggregates in a report.
ISubtotalRow      

RowData

RowData describes one row in the report.
IRowData      

rowType

An enumerated value that shows the type of data that this row contains. Values: account class customer customerMessage customerType employee item jobType label memorizedTxn memorizedReport name otherName paymentMethod payrollItem salesRep salesTaxCode shipMethod state style terms toDo vendor vendorType
IQBENrowTypeType      

value

The data in this cell of the report.
IQBStringType      

ColDataList

A list of IColData objects, each of which describes the data in one cell of the report.
IColDataList      

(List

of IColData Objects)
       

colID

An identifying number that corresponds to the position of this column in the report. The columns are numbered from left to right, starting with 1.
IQBIntType     Y

value

The data in this cell of the report.
IQBStringType     Y

dataType

The data type: IDTYPE, STRTYPE, and so on.
IQBENdataTypeType     Y

TotalRow

A row that contains a calculated total of all the data that has come before and a double underline. There will only be one TotalRow per report. If TotalRow does not include any numerical values, the columns required to show the total values are not part of the report. These columns were not included when the report was customized.
ITotalRow      

RowData

RowData describes one row in the report.
IRowData      

rowType

An enumerated value that shows the type of data that this row contains. Values: account class customer customerMessage customerType employee item jobType label memorizedTxn memorizedReport name otherName paymentMethod payrollItem salesRep salesTaxCode shipMethod state style terms toDo vendor vendorType
IQBENrowTypeType      

value

The data in this cell of the report.
IQBStringType      

ColDataList

A list of IColData objects, each of which describes the data in one cell of the report.
IColDataList      

(List

of IColData Objects)
       

colID

An identifying number that corresponds to the position of this column in the report. The columns are numbered from left to right, starting with 1.
IQBIntType     Y

value

The data in this cell of the report.
IQBStringType     Y

dataType

The data type: IDTYPE, STRTYPE, and so on.
IQBENdataTypeType     Y

  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
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="16.0"?>
<QBXML>
        <QBXMLMsgsRq onError="stopOnError">
                <GeneralDetailReportQueryRq>
                        <!-- GeneralDetailReportType may have one of the following values: 1099Detail, AuditTrail, BalanceSheetDetail, CheckDetail, CustomerBalanceDetail, DepositDetail, EstimatesByJob, ExpenseByVendorDetail, GeneralLedger, IncomeByCustomerDetail, IncomeTaxDetail, InventoryValuationDetail, JobProgressInvoicesVsEstimates, Journal, MissingChecks, OpenInvoices, OpenPOs, OpenPOsByJob, OpenSalesOrderByCustomer, OpenSalesOrderByItem, PendingSales, ProfitAndLossDetail, PurchaseByItemDetail, PurchaseByVendorDetail, SalesByCustomerDetail, SalesByItemDetail, SalesByRepDetail, TxnDetailByAccount, TxnListByCustomer, TxnListByDate, TxnListByVendor, UnpaidBillsDetail, UnbilledCostsByJob, VendorBalanceDetail -->
                        <GeneralDetailReportType >ENUMTYPE</GeneralDetailReportType> <!-- 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>
                        <ReportTxnTypeFilter> <!-- optional -->
                                <!-- TxnTypeFilter may have one of the following values: All, ARRefundCreditCard, Bill, BillPaymentCheck, BillPaymentCreditCard, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, LiabilityAdjustment, Paycheck, PayrollLiabilityCheck, PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, Transfer, VendorCredit, YTDAdjustment -->
                                <TxnTypeFilter >ENUMTYPE</TxnTypeFilter> <!-- required, may repeat -->
                        </ReportTxnTypeFilter>
                        <!-- 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 -->
                        <!-- ReportBasis may have one of the following values: Accrual, Cash, None [DEFAULT] -->
                        <ReportBasis >ENUMTYPE</ReportBasis> <!-- optional -->
                </GeneralDetailReportQueryRq>

                <GeneralDetailReportQueryRs 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>
                </GeneralDetailReportQueryRs>
        </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
343
344
345
346
'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  DoGeneralDetailReportQuery()
                        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

                                BuildGeneralDetailReportQueryRq(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

                                WalkGeneralDetailReportQueryRs(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 BuildGeneralDetailReportQueryRq(requestMsgSet as IMsgSetRequest)
                        Dim GeneralDetailReportQueryRq as IGeneralDetailReportQuery
                        GeneralDetailReportQueryRq= requestMsgSet.AppendGeneralDetailReportQueryRq()
                        'Set field value for GeneralDetailReportType
                        GeneralDetailReportQueryRq.GeneralDetailReportType.SetValue(ENGeneralDetailReportType.gdrt1099Detail)
                        'Set field value for DisplayReport
                        GeneralDetailReportQueryRq.DisplayReport.SetValue(True)
                        Dim ORReportPeriodElementType10641 as String
                        ORReportPeriodElementType10641 = "ReportPeriod"
                        if (ORReportPeriodElementType10641 == "ReportPeriod") then
                                'Set field value for FromReportDate
                                GeneralDetailReportQueryRq.ORReportPeriod.ReportPeriod.FromReportDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToReportDate
                                GeneralDetailReportQueryRq.ORReportPeriod.ReportPeriod.ToReportDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORReportPeriodElementType10641 == "ReportDateMacro") then
                                'Set field value for ReportDateMacro
                                GeneralDetailReportQueryRq.ORReportPeriod.ReportDateMacro.SetValue(ENReportDateMacro.rdmAll)
                        End If
                        Dim ORReportAccountFilterElementType10642 as String
                        ORReportAccountFilterElementType10642 = "AccountTypeFilter"
                        if (ORReportAccountFilterElementType10642 == "AccountTypeFilter") then
                                'Set field value for AccountTypeFilter
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.AccountTypeFilter.SetValue(ENAccountTypeFilter.atfAccountsPayable)
                        End If
                        if (ORReportAccountFilterElementType10642 == "ListIDList") then
                                'Set field value for ListIDList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDList.Add("200000-1011023419")
                        End If
                        if (ORReportAccountFilterElementType10642 == "FullNameList") then
                                'Set field value for FullNameList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameList.Add("ab")
                        End If
                        if (ORReportAccountFilterElementType10642 == "ListIDWithChildren") then
                                'Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDWithChildren.SetValue("200000-1011023419")
                        End If
                        if (ORReportAccountFilterElementType10642 == "FullNameWithChildren") then
                                'Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameWithChildren.SetValue("ab")
                        End If
                        Dim ORReportEntityFilterElementType10643 as String
                        ORReportEntityFilterElementType10643 = "EntityTypeFilter"
                        if (ORReportEntityFilterElementType10643 == "EntityTypeFilter") then
                                'Set field value for EntityTypeFilter
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.EntityTypeFilter.SetValue(ENEntityTypeFilter.etfCustomer)
                        End If
                        if (ORReportEntityFilterElementType10643 == "ListIDList") then
                                'Set field value for ListIDList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDList.Add("200000-1011023419")
                        End If
                        if (ORReportEntityFilterElementType10643 == "FullNameList") then
                                'Set field value for FullNameList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add("ab")
                        End If
                        if (ORReportEntityFilterElementType10643 == "ListIDWithChildren") then
                                'Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDWithChildren.SetValue("200000-1011023419")
                        End If
                        if (ORReportEntityFilterElementType10643 == "FullNameWithChildren") then
                                'Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameWithChildren.SetValue("ab")
                        End If
                        Dim ORReportItemFilterElementType10644 as String
                        ORReportItemFilterElementType10644 = "ItemTypeFilter"
                        if (ORReportItemFilterElementType10644 == "ItemTypeFilter") then
                                'Set field value for ItemTypeFilter
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ItemTypeFilter.SetValue(ENItemTypeFilter.itfAllExceptFixedAsset)
                        End If
                        if (ORReportItemFilterElementType10644 == "ListIDList") then
                                'Set field value for ListIDList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDList.Add("200000-1011023419")
                        End If
                        if (ORReportItemFilterElementType10644 == "FullNameList") then
                                'Set field value for FullNameList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameList.Add("ab")
                        End If
                        if (ORReportItemFilterElementType10644 == "ListIDWithChildren") then
                                'Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDWithChildren.SetValue("200000-1011023419")
                        End If
                        if (ORReportItemFilterElementType10644 == "FullNameWithChildren") then
                                'Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameWithChildren.SetValue("ab")
                        End If
                        Dim ORReportClassFilterElementType10645 as String
                        ORReportClassFilterElementType10645 = "ListIDList"
                        if (ORReportClassFilterElementType10645 == "ListIDList") then
                                'Set field value for ListIDList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDList.Add("200000-1011023419")
                        End If
                        if (ORReportClassFilterElementType10645 == "FullNameList") then
                                'Set field value for FullNameList
                                'May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameList.Add("ab")
                        End If
                        if (ORReportClassFilterElementType10645 == "ListIDWithChildren") then
                                'Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDWithChildren.SetValue("200000-1011023419")
                        End If
                        if (ORReportClassFilterElementType10645 == "FullNameWithChildren") then
                                'Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameWithChildren.SetValue("ab")
                        End If
                        'Set field value for TxnTypeFilterList
                        GeneralDetailReportQueryRq.ReportTxnTypeFilter.TxnTypeFilterList.SetValue(ENTxnTypeFilterList.ttflAll)
                        Dim ORReportModifiedDateElementType10646 as String
                        ORReportModifiedDateElementType10646 = "ReportModifiedDateRangeFilter"
                        if (ORReportModifiedDateElementType10646 == "ReportModifiedDateRangeFilter") then
                                'Set field value for FromReportModifiedDate
                                GeneralDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.FromReportModifiedDate.SetValue(DateTime.Parse("12/15/2007"))
                                'Set field value for ToReportModifiedDate
                                GeneralDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.ToReportModifiedDate.SetValue(DateTime.Parse("12/15/2007"))
                        End If
                        if (ORReportModifiedDateElementType10646 == "ReportModifiedDateRangeMacro") then
                                'Set field value for ReportModifiedDateRangeMacro
                                GeneralDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeMacro.SetValue(ENReportModifiedDateRangeMacro.rmdrmAll)
                        End If
                        'Set field value for ReportDetailLevelFilter
                        GeneralDetailReportQueryRq.ReportDetailLevelFilter.SetValue(ENReportDetailLevelFilter.rdlfAll [DEFAULT])
                        'Set field value for ReportPostingStatusFilter
                        GeneralDetailReportQueryRq.ReportPostingStatusFilter.SetValue(ENReportPostingStatusFilter.rpsfEither)
                        'Set field value for SummarizeRowsBy
                        GeneralDetailReportQueryRq.SummarizeRowsBy.SetValue(ENSummarizeRowsBy.srbAccount)
                        'Set field value for IncludeColumnList
                        'May create more than one of these if needed
                        GeneralDetailReportQueryRq.IncludeColumnList.Add(ENIncludeColumnList.iclAccount)
                        'Set field value for IncludeAccounts
                        GeneralDetailReportQueryRq.IncludeAccounts.SetValue(ENIncludeAccounts.iaAll)
                        'Set field value for ReportOpenBalanceAsOf
                        GeneralDetailReportQueryRq.ReportOpenBalanceAsOf.SetValue(ENReportOpenBalanceAsOf.robaoReportEndDate)
                        'Set field value for ReportBasis
                        GeneralDetailReportQueryRq.ReportBasis.SetValue(ENReportBasis.rbAccrual)
                End Sub




                Public Sub WalkGeneralDetailReportQueryRs( 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.rtGeneralDetailReportQueryRs) 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 ReportTitle10647 as String
                        ReportTitle10647 = ReportRet.ReportTitle.GetValue()
                        'Get value of ReportSubtitle
                        Dim ReportSubtitle10648 as String
                        ReportSubtitle10648 = ReportRet.ReportSubtitle.GetValue()
                        'Get value of ReportBasis
                        if ( not ReportRet.ReportBasis is nothing) then
                                Dim ReportBasis10649 as ENReportBasis
                                ReportBasis10649 = ReportRet.ReportBasis.GetValue()
                        End If
                        'Get value of NumRows
                        Dim NumRows10650 as Integer
                        NumRows10650 = ReportRet.NumRows.GetValue()
                        'Get value of NumColumns
                        Dim NumColumns10651 as Integer
                        NumColumns10651 = ReportRet.NumColumns.GetValue()
                        'Get value of NumColTitleRows
                        Dim NumColTitleRows10652 as Integer
                        NumColTitleRows10652 = ReportRet.NumColTitleRows.GetValue()
                        if (not ReportRet.ColDescList is nothing)
                                Dim i10653 as Integer
                                for i10653 = 0  to ReportRet.ColDescList.Count - 1
                                        Dim ColDesc as IColDesc
                                        ColDesc = ReportRet.ColDescList.GetAt(i10653)
                                        if (not ColDescColTitleList is nothing)
                                                Dim i10654 as Integer
                                                for i10654 = 0  to ColDescColTitleList.Count - 1
                                                        Dim ColTitle as IColTitle
                                                        ColTitle = ColDescColTitleList.GetAt(i10654)
                                                Next i10654
                                        End If
                                        'Get value of ColType
                                        Dim ColType10655 as ENColType
                                        ColType10655 = ColDescColType.GetValue()
                                Next i10653
                        End If
                        if (not ReportRet.ReportData. is nothing) then
                                if (not ReportRet.ReportData.ORReportDataList is nothing) then
                                        Dim i10656 as Integer
                                        for i10656 = 0 to ReportRet.ReportData.ORReportDataList.Count - 1
                                                Dim ORReportData10657 as IORReportData
                                                ORReportData10657 = ReportRet.ReportData.ORReportDataList.GetAt(i10656)
                                                if (not ORReportData10657.DataRow is nothing) then
                                                        if (not ORReportData10657.DataRow. is nothing) then
                                                                if (not ORReportData10657.DataRow.RowData. is nothing) then
                                                                End If
                                                                if (not ORReportData10657.DataRow.ColDataList is nothing)
                                                                        Dim i10658 as Integer
                                                                        for i10658 = 0  to ORReportData10657.DataRow.ColDataList.Count - 1
                                                                                Dim ColData as IColData
                                                                                ColData = ORReportData10657.DataRow.ColDataList.GetAt(i10658)
                                                                        Next i10658
                                                                End If
                                                        End If
                                                End If
                                                if (not ORReportData10657.TextRow is nothing) then
                                                        if (not ORReportData10657.TextRow. is nothing) then
                                                        End If
                                                End If
                                                if (not ORReportData10657.SubtotalRow is nothing) then
                                                        if (not ORReportData10657.SubtotalRow. is nothing) then
                                                                if (not ORReportData10657.SubtotalRow.RowData. is nothing) then
                                                                End If
                                                                if (not ORReportData10657.SubtotalRow.ColDataList is nothing)
                                                                        Dim i10659 as Integer
                                                                        for i10659 = 0  to ORReportData10657.SubtotalRow.ColDataList.Count - 1
                                                                                Dim ColData as IColData
                                                                                ColData = ORReportData10657.SubtotalRow.ColDataList.GetAt(i10659)
                                                                        Next i10659
                                                                End If
                                                        End If
                                                End If
                                                if (not ORReportData10657.TotalRow is nothing) then
                                                        if (not ORReportData10657.TotalRow. is nothing) then
                                                                if (not ORReportData10657.TotalRow.RowData. is nothing) then
                                                                End If
                                                                if (not ORReportData10657.TotalRow.ColDataList is nothing)
                                                                        Dim i10660 as Integer
                                                                        for i10660 = 0  to ORReportData10657.TotalRow.ColDataList.Count - 1
                                                                                Dim ColData as IColData
                                                                                ColData = ORReportData10657.TotalRow.ColDataList.GetAt(i10660)
                                                                        Next i10660
                                                                End If
                                                        End If
                                                End If
                                        Next i10656
                                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
362
363
364
365
//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  DoGeneralDetailReportQuery()
                {
                        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;

                                BuildGeneralDetailReportQueryRq(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;

                                WalkGeneralDetailReportQueryRs(responseMsgSet);
                        }
                        catch (Exception e)
                        {
                                MessageBox.Show(e.Message, "Error");
                                if (sessionBegun)
                                {
                                        sessionManager.EndSession();
                                }
                                if (connectionOpen)
                                {
                                        sessionManager.CloseConnection();
                                }
                        }
                }
                void BuildGeneralDetailReportQueryRq(IMsgSetRequest requestMsgSet)
                {
                        IGeneralDetailReportQuery GeneralDetailReportQueryRq= requestMsgSet.AppendGeneralDetailReportQueryRq();
                        //Set field value for GeneralDetailReportType
                        GeneralDetailReportQueryRq.GeneralDetailReportType.SetValue(ENGeneralDetailReportType.gdrt1099Detail);
                        //Set field value for DisplayReport
                        GeneralDetailReportQueryRq.DisplayReport.SetValue(true);
                        string ORReportPeriodElementType10621 = "ReportPeriod";
                        if (ORReportPeriodElementType10621 == "ReportPeriod")
                        {
                                //Set field value for FromReportDate
                                GeneralDetailReportQueryRq.ORReportPeriod.ReportPeriod.FromReportDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToReportDate
                                GeneralDetailReportQueryRq.ORReportPeriod.ReportPeriod.ToReportDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORReportPeriodElementType10621 == "ReportDateMacro")
                        {
                                //Set field value for ReportDateMacro
                                GeneralDetailReportQueryRq.ORReportPeriod.ReportDateMacro.SetValue(ENReportDateMacro.rdmAll);
                        }
                        string ORReportAccountFilterElementType10622 = "AccountTypeFilter";
                        if (ORReportAccountFilterElementType10622 == "AccountTypeFilter")
                        {
                                //Set field value for AccountTypeFilter
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.AccountTypeFilter.SetValue(ENAccountTypeFilter.atfAccountsPayable);
                        }
                        if (ORReportAccountFilterElementType10622 == "ListIDList")
                        {
                                //Set field value for ListIDList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDList.Add("200000-1011023419");
                        }
                        if (ORReportAccountFilterElementType10622 == "FullNameList")
                        {
                                //Set field value for FullNameList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameList.Add("ab");
                        }
                        if (ORReportAccountFilterElementType10622 == "ListIDWithChildren")
                        {
                                //Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.ListIDWithChildren.SetValue("200000-1011023419");
                        }
                        if (ORReportAccountFilterElementType10622 == "FullNameWithChildren")
                        {
                                //Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportAccountFilter.ORReportAccountFilter.FullNameWithChildren.SetValue("ab");
                        }
                        string ORReportEntityFilterElementType10623 = "EntityTypeFilter";
                        if (ORReportEntityFilterElementType10623 == "EntityTypeFilter")
                        {
                                //Set field value for EntityTypeFilter
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.EntityTypeFilter.SetValue(ENEntityTypeFilter.etfCustomer);
                        }
                        if (ORReportEntityFilterElementType10623 == "ListIDList")
                        {
                                //Set field value for ListIDList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDList.Add("200000-1011023419");
                        }
                        if (ORReportEntityFilterElementType10623 == "FullNameList")
                        {
                                //Set field value for FullNameList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameList.Add("ab");
                        }
                        if (ORReportEntityFilterElementType10623 == "ListIDWithChildren")
                        {
                                //Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.ListIDWithChildren.SetValue("200000-1011023419");
                        }
                        if (ORReportEntityFilterElementType10623 == "FullNameWithChildren")
                        {
                                //Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportEntityFilter.ORReportEntityFilter.FullNameWithChildren.SetValue("ab");
                        }
                        string ORReportItemFilterElementType10624 = "ItemTypeFilter";
                        if (ORReportItemFilterElementType10624 == "ItemTypeFilter")
                        {
                                //Set field value for ItemTypeFilter
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ItemTypeFilter.SetValue(ENItemTypeFilter.itfAllExceptFixedAsset);
                        }
                        if (ORReportItemFilterElementType10624 == "ListIDList")
                        {
                                //Set field value for ListIDList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDList.Add("200000-1011023419");
                        }
                        if (ORReportItemFilterElementType10624 == "FullNameList")
                        {
                                //Set field value for FullNameList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameList.Add("ab");
                        }
                        if (ORReportItemFilterElementType10624 == "ListIDWithChildren")
                        {
                                //Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.ListIDWithChildren.SetValue("200000-1011023419");
                        }
                        if (ORReportItemFilterElementType10624 == "FullNameWithChildren")
                        {
                                //Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportItemFilter.ORReportItemFilter.FullNameWithChildren.SetValue("ab");
                        }
                        string ORReportClassFilterElementType10625 = "ListIDList";
                        if (ORReportClassFilterElementType10625 == "ListIDList")
                        {
                                //Set field value for ListIDList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDList.Add("200000-1011023419");
                        }
                        if (ORReportClassFilterElementType10625 == "FullNameList")
                        {
                                //Set field value for FullNameList
                                //May create more than one of these if needed
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameList.Add("ab");
                        }
                        if (ORReportClassFilterElementType10625 == "ListIDWithChildren")
                        {
                                //Set field value for ListIDWithChildren
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.ListIDWithChildren.SetValue("200000-1011023419");
                        }
                        if (ORReportClassFilterElementType10625 == "FullNameWithChildren")
                        {
                                //Set field value for FullNameWithChildren
                                GeneralDetailReportQueryRq.ReportClassFilter.ORReportClassFilter.FullNameWithChildren.SetValue("ab");
                        }
                        //Set field value for TxnTypeFilterList
                        GeneralDetailReportQueryRq.ReportTxnTypeFilter.TxnTypeFilterList.SetValue(ENTxnTypeFilterList.ttflAll);
                        string ORReportModifiedDateElementType10626 = "ReportModifiedDateRangeFilter";
                        if (ORReportModifiedDateElementType10626 == "ReportModifiedDateRangeFilter")
                        {
                                //Set field value for FromReportModifiedDate
                                GeneralDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.FromReportModifiedDate.SetValue(DateTime.Parse("12/15/2007"));
                                //Set field value for ToReportModifiedDate
                                GeneralDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeFilter.ToReportModifiedDate.SetValue(DateTime.Parse("12/15/2007"));
                        }
                        if (ORReportModifiedDateElementType10626 == "ReportModifiedDateRangeMacro")
                        {
                                //Set field value for ReportModifiedDateRangeMacro
                                GeneralDetailReportQueryRq.ORReportModifiedDate.ReportModifiedDateRangeMacro.SetValue(ENReportModifiedDateRangeMacro.rmdrmAll);
                        }
                        //Set field value for ReportDetailLevelFilter
                        GeneralDetailReportQueryRq.ReportDetailLevelFilter.SetValue(ENReportDetailLevelFilter.rdlfAll [DEFAULT]);
                        //Set field value for ReportPostingStatusFilter
                        GeneralDetailReportQueryRq.ReportPostingStatusFilter.SetValue(ENReportPostingStatusFilter.rpsfEither);
                        //Set field value for SummarizeRowsBy
                        GeneralDetailReportQueryRq.SummarizeRowsBy.SetValue(ENSummarizeRowsBy.srbAccount);
                        //Set field value for IncludeColumnList
                        //May create more than one of these if needed
                        GeneralDetailReportQueryRq.IncludeColumnList.Add(ENIncludeColumnList.iclAccount);
                        //Set field value for IncludeAccounts
                        GeneralDetailReportQueryRq.IncludeAccounts.SetValue(ENIncludeAccounts.iaAll);
                        //Set field value for ReportOpenBalanceAsOf
                        GeneralDetailReportQueryRq.ReportOpenBalanceAsOf.SetValue(ENReportOpenBalanceAsOf.robaoReportEndDate);
                        //Set field value for ReportBasis
                        GeneralDetailReportQueryRq.ReportBasis.SetValue(ENReportBasis.rbAccrual);
                }




                void WalkGeneralDetailReportQueryRs(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.rtGeneralDetailReportQueryRs)
                                                {
                                                        //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 ReportTitle10627 = (string)ReportRet.ReportTitle.GetValue();
                        //Get value of ReportSubtitle
                        string ReportSubtitle10628 = (string)ReportRet.ReportSubtitle.GetValue();
                        //Get value of ReportBasis
                        if (ReportRet.ReportBasis != null)
                        {
                                ENReportBasis ReportBasis10629 = (ENReportBasis)ReportRet.ReportBasis.GetValue();
                        }
                        //Get value of NumRows
                        int NumRows10630 = (int)ReportRet.NumRows.GetValue();
                        //Get value of NumColumns
                        int NumColumns10631 = (int)ReportRet.NumColumns.GetValue();
                        //Get value of NumColTitleRows
                        int NumColTitleRows10632 = (int)ReportRet.NumColTitleRows.GetValue();
                        if (ReportRet.ColDescList != null)
                        {
                                for (int i10633 = 0; i10633 < ReportRet.ColDescList.Count; i10633++)
                                {
                                        IColDesc ColDesc = ReportRet.ColDescList.GetAt(i10633);
                                        if (ColDesc.ColTitleList != null)
                                        {
                                                for (int i10634 = 0; i10634 < ColDesc.ColTitleList.Count; i10634++)
                                                {
                                                        IColTitle ColTitle = ColDesc.ColTitleList.GetAt(i10634);
                                                }
                                        }
                                        //Get value of ColType
                                        ENColType ColType10635 = (ENColType)ColDesc.ColType.GetValue();
                                }
                        }
                        if (ReportRet.ReportData != null)
                        {
                                if (ReportRet.ReportData.ORReportDataList != null)
                                {
                                        for (int i10636 = 0; i10636 < ReportRet.ReportData.ORReportDataList.Count; i10636++)
                                        {
                                                IORReportData ORReportData10637 = ReportRet.ReportData.ORReportDataList.GetAt(i10636);
                                                if (ORReportData10637.DataRow != null)
                                                {
                                                        if (ORReportData10637.DataRow != null)
                                                        {
                                                                if (ORReportData10637.DataRow.RowData != null)
                                                                {
                                                                }
                                                                if (ORReportData10637.DataRow.ColDataList != null)
                                                                {
                                                                        for (int i10638 = 0; i10638 < ORReportData10637.DataRow.ColDataList.Count; i10638++)
                                                                        {
                                                                                IColData ColData = ORReportData10637.DataRow.ColDataList.GetAt(i10638);
                                                                        }
                                                                }
                                                        }
                                                }
                                                if (ORReportData10637.TextRow != null)
                                                {
                                                        if (ORReportData10637.TextRow != null)
                                                        {
                                                        }
                                                }
                                                if (ORReportData10637.SubtotalRow != null)
                                                {
                                                        if (ORReportData10637.SubtotalRow != null)
                                                        {
                                                                if (ORReportData10637.SubtotalRow.RowData != null)
                                                                {
                                                                }
                                                                if (ORReportData10637.SubtotalRow.ColDataList != null)
                                                                {
                                                                        for (int i10639 = 0; i10639 < ORReportData10637.SubtotalRow.ColDataList.Count; i10639++)
                                                                        {
                                                                                IColData ColData = ORReportData10637.SubtotalRow.ColDataList.GetAt(i10639);
                                                                        }
                                                                }
                                                        }
                                                }
                                                if (ORReportData10637.TotalRow != null)
                                                {
                                                        if (ORReportData10637.TotalRow != null)
                                                        {
                                                                if (ORReportData10637.TotalRow.RowData != null)
                                                                {
                                                                }
                                                                if (ORReportData10637.TotalRow.ColDataList != null)
                                                                {
                                                                        for (int i10640 = 0; i10640 < ORReportData10637.TotalRow.ColDataList.Count; i10640++)
                                                                        {
                                                                                IColData ColData = ORReportData10637.TotalRow.ColDataList.GetAt(i10640);
                                                                        }
                                                                }
                                                        }
                                                }
                                        }
                                }
                        }
                }




        }
}