Get Data Selection to Report Header

Vengealus

Member
Hi peeps,

I am totally new to JDE and I am having a problem with printing data selection to the Report Header. I have read some of the threads and it is still confusing to me, maybe you can help me out with this:

It is concerning report R09301. I know you can print the data selection by enabling print cover, but my organisation don't want to print that extra page because of waste and such.

I want to print the following data selection on the header.

Company (CO)
GLPostedCode (Post)
LedgeType (LT)
BatchType (ICUT)
DocumentType (DOC)
DateBatchJulian (DICJ)

I have already created additional section call Print Data Selection with the following EventRules:

<font class="small">Code:</font><hr /><pre>
Listing of ER for Report: Report : General Journal by Batch Report (R5609301)


=======================================================================
SECTION: Print Data Selection [COLUMNAR SECTION] (S12)
=======================================================================
OBJECT: SECTION
EVENT: Initialize Section
-----------------------------------------------------------------------
OPT: Using Defaults
0001 Set Selection Append Flag(<No>)
0002 Set User Selection(BC Program Name (F56GTDSH)(PGM), <Equal To>, SL ReportName, <And>)
0003 Set User Selection(BC Version History (F56GTDSH)(VERS), <Equal To>, SL VersionName, <And>)
0004 Set User Selection(BC Computer ID (F56GTDSH)(CTID), <Equal To>, VA rpt_szComputerID_CTID, <And>)
0005 Set User Selection(BC Job Number (F56GTDSH)(JOBS), <Equal To>, VA rpt_mnJobnumber_JOBS, <And>)

-----------------------------------------------------------------------
EVENT: Do Section
-----------------------------------------------------------------------
OPT: Using Defaults
0001 Build Data Selection String for Output
VA rpt_mnJobnumber_JOBS -> BF mnJobnumber_JOBS
VA rpt_szComputerID_CTID -> BF szComputerID_CTID
SL ReportName -> BF szProgramName_PGM
SL VersionName -> BF szVersion_VERS
BC Data Selection Header Count (F56GTDSH)($HCNT) -> BF mnHeaderCount_xHCNT
RV Data Selection Value <> BF szDataSelectionValue_xDSVL
</pre><hr />
Added another section named Selection:
<font class="small">Code:</font><hr /><pre>
Listing of ER for Report: Report : General Journal by Batch Report (R5609301)


=======================================================================
SECTION: Selection [GROUP SECTION] (S11)
=======================================================================
OBJECT: SECTION
EVENT: Initialize Section
-----------------------------------------------------------------------
OPT: Using Defaults
0001 If VA rpt_cSelectionPrinted_EV01 is not equal to "1"
0002 Get Job Number & Computer ID 76H
VA rpt_mnJobnumber_JOBS <- BF mnJobnumberA
VA rpt_szComputerID_CTID <- BF szComputerID
0003 Get UBE Data Selection
SL ReportName -> BF szReportId_PID
SL VersionName -> BF szVersion_VERS
SL SectionNumber -> BF mnSectionId_MATH01
VA rpt_mnJobnumber_JOBS -> BF mnJobnumber_JOBS
VA rpt_szComputerID_CTID -> BF szComputerID_CTID
0004 End If

-----------------------------------------------------------------------
EVENT: Do Section
-----------------------------------------------------------------------
OPT: Using Defaults
0001 F5683800.Select
SL ReportName = TK Object Name
0002 VA rpt_cFirstTimeFlag_EV01 = "Y"
0003 F5683800.Fetch Next
VA rpt_szReportSection_xRS <- TK Report Section
VA rpt_szSubSectionDes_xSSD <- TK Sub Section Description
VA rpt_szFromObjectAccount_xFOBJ <- TK From Object Account
VA rpt_szToObjectAccount_xTOBJ <- TK To Object Account
VA rpt_cLevelOfDetailAcctCde_LDA <- TK Account Level of Detail
VA rpt_cPageBreakBefore_xPBB <- TK Page Break Before
VA rpt_cPrintTotals_xPRT <- TK Print Totals
VA rpt_mnSeqWithinRprtSectio_xSEQ <- TK Sequence Within Report Section
VA rpt_cPrintBold_xURC1 <- TK User Reserved Character 1
VA rpt_cExcludeSignReversal_xURC2 <- TK User Reserved Character 2
0004 While SV File_IO_Status is not equal to CO ERROR
0005 If VA rpt_cFirstTimeFlag_EV01 is equal to "N"
0006 If VA rpt_szReportSection_xRS is not equal to VA rpt_szReportSectionSave_xRS Or VA rpt_cPageBreakBefore_xPBB is equal to "Y"
0007 Do Custom Section(RS Force Page Break)
0008 End If
0009 Else
0010 VA rpt_cFirstTimeFlag_EV01 = "N"
0011 End If
0012 VA rpt_szReportSectionSave_xRS = VA rpt_szReportSection_xRS
0013 RV Report Section = VA rpt_szReportSection_xRS
0014 F5683800.Fetch Next
VA rpt_szReportSection_xRS <- TK Report Section
VA rpt_szSubSectionDes_xSSD <- TK Sub Section Description
VA rpt_szFromObjectAccount_xFOBJ <- TK From Object Account
VA rpt_szToObjectAccount_xTOBJ <- TK To Object Account
VA rpt_cLevelOfDetailAcctCde_LDA <- TK Account Level of Detail
VA rpt_cPageBreakBefore_xPBB <- TK Page Break Before
VA rpt_cPrintTotals_xPRT <- TK Print Totals
VA rpt_mnSeqWithinRprtSectio_xSEQ <- TK Sequence Within Report Section
VA rpt_cPrintBold_xURC1 <- TK User Reserved Character 1
VA rpt_cExcludeSignReversal_xURC2 <- TK User Reserved Character 2
0015 End While
0016 If VA rpt_cSelectionPrinted_EV01 is not equal to "1"
0017 F56GTDSH.Delete
VA rpt_mnJobnumber_JOBS = TK Job Number
VA rpt_szComputerID_CTID = TK Computer ID
SL ReportName = TK Program Name
SL VersionName = TK Version History
0018 F56GTDSD.Delete
VA rpt_mnJobnumber_JOBS = TK Job Number
VA rpt_szComputerID_CTID = TK Computer ID
SL ReportName = TK Program Name
SL VersionName = TK Version History
0019 End If
0020 Stop Batch Processing
</pre><hr />
Finally I added to the Header the following EventRules:
<font class="small">Code:</font><hr /><pre>
Listing of ER for Report: Report : General Journal by Batch Report (R09301)

=======================================================================
SECTION: Page Header [PAGE HEADER] (S2)
=======================================================================
OBJECT: SECTION
EVENT: Do Section
-----------------------------------------------------------------------
OPT: Using Defaults
0001 Get Company And Report Description
"R09301" -> BF szProgramID
RV szCompanyName <- BF szCompanyName
RV szReportName <- BF szReportDescription
0002 RV szCompanyName = rtrim([RV szCompanyName]," ")
0003 RV szReportName = rtrim([RV szReportName]," ")

-----------------------------------------------------------------------
EVENT: Initialize Page Header
-----------------------------------------------------------------------
OPT: Using Defaults
0008 RV G/L Posted Code = PO cGLPostedCode
0009 If RV Ledger Type is equal to <Blank>
0010 PO szLedgerType = "AA"
0011 End If
0012 RV Ledger Type = PO szLedgerType
0013 RV Batch Type = PO szBatchType
0014 RV Document Type = PO szDocumentType
0015 RV Batch Date = PO jdDateBatchJulian

-----------------------------------------------------------------------
EVENT: After Last Object Printed
-----------------------------------------------------------------------
OPT: Using Defaults
0001 If VA rpt_cSelectionPrinted_EV01 is not equal to "1"
0002 Do Custom Section(RS Print Data Selection)
0003 VA rpt_cSelectionPrinted_EV01 = "1"
0004 End If
</pre><hr />

It seems to work, but it does not show anything when I run this report in BV. Can you help this junior to solve this issue? Thanks
 

JMR

VIP Member
First of all, you should post developer questions in the developer forum...you will receive much better results.

[ QUOTE ]
It seems to work, but it does not show anything when I run this report in BV. Can you help this junior to solve this issue? Thanks

[/ QUOTE ]

I have to ask what you mean by, "it seems to work"?

You have not shown the code for:
Do Custom Section(RS Print Data Selection)

I assume this is where the code resides that produces the data selection output, correct? If so, then it will be helpful to the readers to see that bit of code too.
 

Vengealus

Member
Hi JMR,

By it seems to work, I mean there is no error when I debug the codes, and it seems to me that the code is running, cause it goes through it line by line, but I don't see anything printed in the header except for the description I put into it when the pdf is done. I don't see an error of my input...
 
Top