project BLF > class Report Component > method GetReportLabels

Description

Report labels (translated to report language) are stored in tables tqHeader + tqFilter + tqText which are included in the resut dataset of every report.


Parameters


icReportNameinputcharacterReport name equals the activity code linked to the report.
This can be different from the business method name.
icLanguageCodeinputcharacter
tFilterinputtemp-table
tqHeaderoutputtemp-table
tqFilteroutputtemp-table
tqTextoutputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


BLF
method breport.ApiGetReportStructure
method breport.ApiProcessReportLogic
method BSODReport.SODViolations

QadFinancials
method BAnalyticalReport.CostCentreTransDet
method BAnalyticalReport.CostCentreTransSumm
method BAnalyticalReport.ProjectTransDet
method BAnalyticalReport.ProjectTransSumm
method BAnalyticalReport.SafOnlyTransDet
method BAnalyticalReport.SafOnlyTransSumm
method BAPMatchingReport.InvoiceMatching
method BAPMatchingReport.MatchingVariance
method BAPMatchingReport.MatchingVarianceForLC
method BAPMatchingReport.UnmatchedReceipt
method BBankImportReport.ImportedBankFileReport
method BBillReport.BillReportDInvoice
method BBLWIReport.DocumentBLWIReport
method BBox1099Report.M1099MiscReport
method BBudgetReporting.BudgetDetail
method BBudgetReporting.BudgetOverview
method BCashBoxReport.CashBook
method BCashBoxReport.CashPaid
method BCashBoxReport.CashReceived
method BCCollectionReport.CCollectionReport
method BCDocumentReport.CDocumentReportAutoIncasso
method BCDocumentReport.CDocumentReportCheque
method BCDocumentReport.CDocumentReportDraft
method BCDocumentReport.CDocumentReportPromisNote
method BCDocumentReport.CDocumentReportSumStatement
method BCDocumentReport.CDocumentReportTransfer
method BClosingPostingsReport.AccUnmarkedTransactions
method BClosingPostingsReport.AllocationCheck
method BClosingPostingsReport.CIRECBalance
method BClosingPostingsReport.CreditorControlGLBalance
method BClosingPostingsReport.DebtorControlGLBalance
method BClosingPostingsReport.FAControlGLBalance
method BClosingPostingsReport.FARDepreciation
method BClosingPostingsReport.GLOpenItemControl
method BClosingPostingsReport.HistoryPostingsCheck
method BClosingPostingsReport.JournalEntryBalance
method BClosingPostingsReport.RecurringEntries
method BClosingPostingsReport.TransientLayers
method BClosingPostingsReport.VoucherCompleteness
method BConCheckReport.ConCheckReport
method BCreditorReport.CInvoiceRegister
method BCreditorReport.CreditorAABGroup
method BCreditorReport.CreditorAACGroup
method BCreditorReport.CreditorAccountMovements
method BCreditorReport.CreditorAccountsHistory
method BCreditorReport.CreditorAccountsSummary
method BCreditorReport.CreditorAgeingABackwards
method BCreditorReport.CreditorAgeingAnalysisCurrent
method BCreditorReport.CreditorCIREC
method BCreditorReport.CreditorList
method BCreditorReport.CreditorMasterCard
method BCreditorReport.CreditorOpenItems
method BCreditorReport.CreditorOpenItemsDetail
method BCreditorReport.CreditorPrepayments
method BCreditorReport.CreditorWHTCertificate
method BCreditorReport.CreditorWithholdingTax
method BCreditorReport.CreditorWithholdingTaxDue
method BDCollectionReport.DCollectionReport
method BDDocumentReport.DDocumentReportAll
method BDDocumentReport.DDocumentReportAutoIncasso
method BDDocumentReport.DDocumentReportCheque
method BDDocumentReport.DDocumentReportDraft
method BDDocumentReport.DDocumentReportPromisNote
method BDDocumentReport.DDocumentReportSumStatement
method BDDocumentReport.DDocumentReportTransfer
method BDDocumentReport.test
method BDebtorReport.CustomerCreditOverview
method BDebtorReport.DebtorAABGroup
method BDebtorReport.DebtorAACGroup
method BDebtorReport.DebtorAccountMovements
method BDebtorReport.DebtorAccountsHistoryDet
method BDebtorReport.DebtorAccountsSummary
method BDebtorReport.DebtorAccountState
method BDebtorReport.DebtorAgeingAnalysisBackwards
method BDebtorReport.DebtorAgeingAnalysisCurrent
method BDebtorReport.DebtorAgingHistAcroDomain
method BDebtorReport.DebtorBillingAAB
method BDebtorReport.DebtorInvoicePrint
method BDebtorReport.DebtorList
method BDebtorReport.DebtorMasterCard
method BDebtorReport.DebtorOpenItems
method BDebtorReport.DebtorOpenItemsQuick
method BDebtorReport.DebtorReminders
method BDebtorReport.DebtorRemindersOverview
method BEmployeeReport.AdvancePrintOut
method BEmployeeReport.EmployeeMasterCard
method BERSProcessorReport.ERSAuditReport
method BExpenseNoteReport.ExpenseNote
method BFixedAssetReport.MovementsByAssetCode
method BFixedAssetReport.MutationsByGL
method BFixedAssetReport.TransactionsByAssetCode
method BGLReport.AccBalanceTOT
method BGLReport.AccTransJournal
method BGLReport.AuditLogReport
method BGLReport.BalanceByCurrency
method BGLReport.BalanceSheetReport
method BGLReport.BankAuditLogReport
method BGLReport.CBGLReport
method BGLReport.CBPaymentJournal
method BGLReport.CBReceiptJournal
method BGLReport.ChineseBalanceSheet
method BGLReport.ChineseIncomeStatement
method BGLReport.ColumnarLedgers
method BGLReport.ForeignCurrJournal
method BGLReport.FSProForma
method BGLReport.GeneralGLJournal
method BGLReport.GLAccountSheet
method BGLReport.GLHistory
method BGLReport.GLList
method BGLReport.GLMasterCard
method BGLReport.GLNumbering
method BGLReport.GLOpenItems
method BGLReport.GLReport
method BGLReport.GLSequenceRenumber
method BGLReport.GLTransactions
method BGLReport.GLTransactionsOperational
method BGLReport.GLVerifandAppr
method BGLReport.IncomeStatement
method BGLReport.JournalEntryReport
method BGLReport.MirrorAccountingTr
method BGLReport.MultiColBalanceSheet
method BGLReport.MultiColIncomeStatement
method BGLReport.ReversedReplacedGLReport
method BGLReport.SubLedgeReport
method BGLReport.Transactions_DIV
method BGLReport.Transactions_GL
method BGLReport.Transactions_IC
method BGLReport.Transactions_JRNL
method BGLReport.TrialBalance
method BGLReport.VATPayableLedger
method BMfgDaybookSetReport.DaybookSetReport
method BPaymentSelectionReport.Paylist
method BPaymentSelectionReport.Remittance
method BProfileReport.ProfileOverview
method BProjectReport.CreditorAgeingAnalysisByProj
method BProjectReport.DebtorAgeingAnalysisByProj
method BProjectReport.ProjectMastercard
method BReportingJournalReport.ReportingJournalExceptReport
method BRevaluationReport.Revaluation
method BVATReport.DelayedTax
method BVATReport.ITAPEUSalesVatReg
method BVATReport.ITAPEUVatReg
method BVATReport.ITAPVATReg
method BVATReport.ITARVATReg
method BVATReport.ITVATRegSusp
method BVATReport.PolishAPVATReg
method BVATReport.PolishARVATReg
method BVATReport.ReverseCharge
method BVATReport.VATBoxReturnSum
method BVATReport.VATBoxReturnTran
method BVATReport.VATExceptionDet
method BVATReport.VATExceptionSum
method BVATReport.VATExceptionTran
method BVATReport.VATQuarterDet
method BVATReport.VATQuarterSum
method BVATReport.VATQuarterTran
method BVATReport.VATReconciliationTran
method BVATReport.VATRegisterTran
method BVATReport.VATVersusDet
method BVATReport.VATYearlyListingBE
method BGLReport.CheckZeroReport


program code (program1/breport.p)

if oiReturnStatus = 0
then oiReturnStatus = -98.

empty temp-table tqHeader.
empty temp-table tqFilter.
empty temp-table tqText.

if icLanguageCode = ""
or icLanguageCode = ?
then assign icLanguageCode = current-language.

create tqText.
assign tqText.tcCode = "LanguageCode"
       tqText.tcText = icLanguageCode.

/* GetBusinessFields uses method name, which can be different from activity code */
do while program-name(viMCount) begins "GetReportLabels":
    viMCount = viMCount + 1.
end.
if program-name(viMCount) begins "ApiGetReportStructure"
then vcMethodName = icReportName.
else vcMethodName = entry (1,program-name(viMCount)," ").

<M-1 run GetBusinessFields
   (input  vcMethodName (icReference), 
    output tBusinessFields (tBusinessFields), 
    output tCustomRelation (tCustomRelation), 
    output viFcReturnSuper (oiReturnStatus)) in breport>
if viFcReturnSuper <> 0
then oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0
then return.

for each tFilter:
    find first tBusinessFields where
               tBusinessFields.tcFcFieldName = tFilter.tcBusinessFieldName
               no-error.

    if available tBusinessFields                                            and
       lookup("IsEntityCode", tBusinessFields.tcValidationMask, chr(2)) > 0 and
       tFilter.tcParameterValue                                        <> ? and
       trim(tFilter.tcParameterValue)                                  <> ""
    then do:
        /* Remove the entities in which the user is not allowed to run this report */
        assign vcFilterValue = "".

        /* first check QRF */
        vcQRef = "urn:qad-report:c1:QAD_" + vcFcComponentName + "_" + icReportName.
        <Q-38 run ResourceByURIUsr (all) (Read) (NoCache)
           (input ?, (CompanyId)
            input vcQRef, (ResourceURI)
            input viUsrId, (UsrId)
            input ?, (CompanyIsActive)
            output dataset tqResourceByURIUsr) in BResource>

        if not can-find (first tqResourceByURIUsr)
        then do:
            vcQRef = "urn:qad-report:c1:QAD_" + icReportName.
            <Q-40 run ResourceByURIUsr (all) (Read) (NoCache)
               (input ?, (CompanyId)
                input vcQRef, (ResourceURI)
                input viUsrId, (UsrId)
                input ?, (CompanyIsActive)
                output dataset tqResourceByURIUsr) in BResource>
        end.
    
        if not can-find (first tqResourceByURIUsr)
        then do:
            /* When not QRF check Crystal */
            vcQRef = "urn:cbf:" + vcFcComponentName + "." + icReportName.
            <Q-96 run ResourceByURIUsr (all) (Read) (NoCache)
               (input ?, (CompanyId)
                input vcQRef, (ResourceURI)
                input viUsrId, (UsrId)
                input ?, (CompanyIsActive)
                output dataset tqResourceByURIUsr) in BResource>
        end.
        
        do viFcCount1 = num-entries(tFilter.tcParameterValue) to 1 by -1:
            if can-find(first tqResourceByURIUsr where
                              tqResourceByURIUsr.tiUsr_ID      = viUsrId                                     and
                              tqResourceByURIUsr.tcCompanyCode = entry(viFcCount1, tFilter.tcParameterValue) and
                              tqResourceByURIUsr.tcResourceURI = vcQRef)
            then do:
                if vcFilterValue <> ""
                then assign vcFilterValue = "," + vcFilterValue.

                assign vcFilterValue = entry(viFcCount1, tFilter.tcParameterValue) + vcFilterValue.
            end.
        end.

        assign tFilter.tcParameterValue = if vcFilterValue = ""
                                          then vcCompanyCode
                                          else vcFilterValue.
    end.

    create tqFilter.
    assign tqFilter.tcBusinessFieldLabel = (if available tBusinessFields
                                            then tBusinessFields.tcSideLabel
                                            else tFilter.tcBusinessFieldName)
           tqFilter.tcBusinessFieldName  = tFilter.tcBusinessFieldName
           tqFilter.tcOperator           = tFilter.tcOperator
           tqFilter.tcParameterValue     = tFilter.tcParameterValue.

    if available tBusinessFields
    then tqFilter.ti_Sequence = tBusinessFields.tiSequence.
end.

for each tBusinessFields where
         tBusinessFields.tcFcFieldType = "B":U :

    create tqText.
    assign tqText.tcCode = "coLbl":U + substring (entry(2,tBusinessFields.tcFcFieldName,".":U), 3,-1,"CHARACTER":U)
           tqText.tcText = tBusinessFields.tcColumnLabel.

    create tqText.
    assign tqText.tcCode = "siLbl":U + substring (entry(2,tBusinessFields.tcFcFieldName,".":U), 3,-1,"CHARACTER":U)
           tqText.tcText = tBusinessFields.tcSideLabel.
end.

/* retrieve report title */
find first tqHeader no-error.
if not available tqHeader
then create tqHeader.

assign tqHeader.tiDecLC         = 2
       tqHeader.tiDecCC         = 2
       tqHeader.tcDecTC         = ""
       tqHeader.tcCurrLC        = "EUR":U
       tqHeader.tcDateFormat    = <M-11 DisplayDate  (input  ? (itDate)) in breport>
       tqHeader.tcDecimalFormat = <M-3 DisplayDecimal (input  ? (idDecimal), 
                     input  '' (icFormat)) in breport>.

if search ("appinfo/":U + lc(vcFcComponentName) + "_ac.r":U) <> ?
or search ("appinfo/":U + lc(vcFcComponentName) + "_ac.p":U) <> ?
then do:
    empty temp-table tActivities.
    run value ("appinfo/":U + lc(vcFcComponentName) + "_ac.p":U) (input vhFcSuper, input table tActivities by-reference).
    find first tActivities where
              tActivities.tcName = icReportName no-error.
    if available tActivities
    then assign tqHeader.tcReportTitle = tActivities.tcLabel.

    /* clean-up */
    empty temp-table tActivities.
end.

/* ================================================================= */
/* Fill up header with user & company & domain                       */
/* ================================================================= */
find first tqHeader no-error.
if not available tqHeader
then create tqHeader.

assign tqHeader.tcUser = vcUserName
       tqHeader.tcUserLogin = vcUserLogin.

<Q-8 run CompanyByAll (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input ?, (CompanyCode)
    input ?, (CompanyIsActive)
    output dataset tqCompanyByAll) in BCompany >
find first tqCompanyByAll no-error.
if available tqCompanyByAll
then assign tqHeader.tcCompanyCode = tqCompanyByAll.tcCompanyCode
            tqHeader.tcCompanyDescription = tqCompanyByAll.tcCompanyDescription.

<Q-9 run DomainsPrim (all) (Read) (NoCache)
   (input viDomainID, (DomainID)
    input ?, (DomainCode)
    output dataset tqDomainsPrim) in BDomain >
find first tqDomainsPrim no-error.
if available tqDomainsPrim
then assign tqHeader.tcDomainCode = tqDomainsPrim.tcDomainCode.

/* ================================================================= */
/* Lookup report strings                                             */
/* ================================================================= */

/* convert codes to ID */
<Q-7 run LanguagePrim (all) (Read) (NoCache)
          (input icLanguageCode, (LngCode)
           input 0, (LngID)
           output dataset tqLanguagePrim) in BLanguage >
find first tqLanguagePrim no-error.
if available tqLanguagePrim
then assign viLngID = tqLanguagePrim.tiLng_ID.

<Q-6 run BusActivityByActCompDefault (all) (Read) (NoCache)
          (input icReportName, (BusActitvityCode)
           input vcFcComponentName, (BusComponentCode)
           input ?, (BusActiivtyIsDefault)
           input ?, (BusActivytIsActive)
           output dataset tqBusActivityByActCompDefault) in BBusinessComponent >
find first tqBusActivityByActCompDefault no-error.
if available tqBusActivityByActCompDefault
then do:
    <Q-10 run TranslationsForReport (all) (Read) (NoCache)
       (input tqBusActivityByActCompDefault.tiBusActivity_ID, (ActivityId)
        input tqBusActivityByActCompDefault.tiBusComponent_ID, (ComponentID)
        input viLngID, (LngID)
        output dataset tqTranslationsForReport) in BReportTranslation >

    for each tqTranslationsForReport:
        create tqText.
        assign tqText.tcCode = tqTranslationsForReport.tcReportTranslationCode
               tqText.tcText = (if tqTranslationsForReport.tcTranslationStringText = ?
                                or tqTranslationsForReport.tcTranslationStringText = ""
                                then tqTranslationsForReport.tcReportTranslationText
                                else tqTranslationsForReport.tcTranslationStringText).
    end.
end.

if oiReturnStatus = -98
then oiReturnStatus = 0.