I'm creating Excel output using the XFRX driver. The basis for the report is a cursor which has in my test setup about 40 records. It's created using SQL Select with the nofilter clause. There are no relations in to it or out from it. It is the currently selected table when running the report. The issue is that the XLSX file produced just has the same record repeated about 4,000 times. Any ideas?
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
On 14/09/2017 10:28, Alan Bourke wrote:
I'm creating Excel output using the XFRX driver. The basis for the report is a cursor which has in my test setup about 40 records. It's created using SQL Select with the nofilter clause. There are no relations in to it or out from it. It is the currently selected table when running the report. The issue is that the XLSX file produced just has the same record repeated about 4,000 times. Any ideas?
Can you share the SQL select code? Do you get the 4000 repeats or is that from a live data set?
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
I can pause execution just before the report and there's 40 odd records which is correct. If I open the report layout in VFP and save it just before it runs then it's fine, however the next time I do it if I don't open\save the problem occurs.
Select _fees.*, int(Val(feevalc) * 7) as calcweek, _feecusts.accname, _feecusts.custype, _feecusts.ntpfid, _feecusts.admitd, _feecusts.active, _feecusts.lastact, _feecusts.lastinact, _feecusts.emailinv, _feecusts.contact, _feecusts.dormant from _fees left join _feecusts on _feecusts.account = _fees.account order by _fees.account, _fees.feeprod into cursor _report nofilter
You might notice that since there are multiple _fees rows per _feecust row the above will produce repetition of the _feecusts fields on each row in the result - that is by design.
On 14/09/2017 10:58, Alan Bourke wrote:
I can pause execution just before the report and there's 40 odd records which is correct. If I open the report layout in VFP and save it just before it runs then it's fine, however the next time I do it if I don't open\save the problem occurs.
Select _fees.*, int(Val(feevalc) * 7) as calcweek, _feecusts.accname, _feecusts.custype, _feecusts.ntpfid, _feecusts.admitd, _feecusts.active, _feecusts.lastact, _feecusts.lastinact, _feecusts.emailinv, _feecusts.contact, _feecusts.dormant from _fees left join _feecusts on _feecusts.account = _fees.account order by _fees.account, _fees.feeprod into cursor _report nofilter
You might notice that since there are multiple _fees rows per _feecust row the above will produce repetition of the _feecusts fields on each row in the result - that is by design.
From what you say it sounds like a problem with the report layout if the cursor has the right number of records in it. Is it feasible to create a new one from scratch or try a new one and just paste in a few fields to test.
Peter
This communication is intended for the person or organisation to whom it is addressed. The contents are confidential and may be protected in law. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
www.whisperingsmith.com
Whispering Smith Ltd Head Office:61 Great Ducie Street, Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715
London Office:17-19 Foley Street, London W1W 6DW Tel:0207 299 7960
WAG: Sounds like the wrong table/cursor is selected. Is it possible you have a grid somewhere in the mix with 4000 records in its recordsource? If so, before running your export code, set focus to a control other than the grid.
Frank.
Frank Cazabon
On 14/09/2017 05:28 AM, Alan Bourke wrote:
I'm creating Excel output using the XFRX driver. The basis for the report is a cursor which has in my test setup about 40 records. It's created using SQL Select with the nofilter clause. There are no relations in to it or out from it. It is the currently selected table when running the report. The issue is that the XLSX file produced just has the same record repeated about 4,000 times. Any ideas?
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
It's something to do with our framework (output to XFRX is handled by a black box that I'm calling) so I've changed it to use XFRX directly and it's OK now.