|
| [WD20] Report with No Source - Add Table Line |
| Iniciado por guest, 17,jun. 2016 23:39 - 1 respuesta |
| |
| | | |
|
| |
| Publicado el 17,junio 2016 - 23:39 |
I have a table style report with no data source. I pass a Data Source variable to the report, but I do extra calculations to it and my final report data ends up in an associative array of structure.
Is there a way to add a table line to the report table without using the built in data sources(HReadFirst,HReadNext)? The for each loop I have now only writes to the first row. FOR EACH stAnalyticInfo,sItem of aaItemAnalytics ITEM_COL_A = sItem ITEM_COL_B = stAnalyticInfo.xTotal/stAnalyticInfo.nCount ITEM_COL_C = stAnalyticInfo.xTotal2/stAnalyticInfo.nCount END |
| |
| |
| | | |
|
| | |
| |
| Publicado el 21,junio 2016 - 14:27 |
Hi Curtis,
I guess you are speaking of programming your own data source: http://doc.windev.com/en-US/…
The answer to your question is yes. The example is misleading in this regard. You simply have to do exactly as they describe, using the "events": "Reading the report data", "Before printing the BODY block", "After printing the Body block".
In the "Reading the report data" simply return True or False to say if you have another record to print or not. In your case, you simply have to create a global variable to know at what index you are at in your array, and when you reach the end of your array, return false.
"Reading the report data": gIndex++ RETURN gIndex > aaItemAnalytics..Occurrence
"Before printing the BODY block" // This code will not work as you intend, but this is just to illustrate: WITH aaItemAnalytics[gIndex] //ITEM_COL_A = sItem ITEM_COL_B = .xTotal/.nCount ITEM_COL_C = .xTotal2/.nCount END
Best regards, Alexandre Leclerc |
| |
| |
| | | |
|
| | | | |
| | |
|