Lucas Ferraz
7th March 2012, 20:37
Hello guys,

The situation is this, there's this customized report at the customer I'm working that made multiple selects in tdfat937, so the session was extremelly slow.
I'm trying to improve that, so I thought of a workaround that allowed me to do a single access to the table, although I had to use a lot of side processing to get it (almost) working.
My problem is that I need to print the same report several times containing different data. I'm trying to accomplish this by using brp functions. So I use brp.open and create a determined number os instances of the same report. Throughout my program I send data to this reports using brp.ready. When I finish the whole thing, I get the report ID's, close then one by one and generate an e-mail with the report attached.
My problem is, when I close the first report the HTML file is created in the folder and the e-mail is send sucessfully. Than I delete the file using file.rm, and use brp.close to close the next report id, but when I do this, the HTML does not appear in the folder, I don't know why!!
The spool.fileout variable contains the entire path to the HTML file, including it's name, that has to be the same to all reports.

Any ideas?

mark_h
8th March 2012, 18:11
Well having a hard time grasping this, sounds like you are trying to generate multiple reports at the sametime all using one spool.fileout variable. Can you post your code? I am wondering if you use spool.open if you could just set a different name for spool.fileout before each open. This would be just to see if it works. If it works then maybe what you could do is run the reports to an ascii device using different spool.fileout, then you could run ttstpconv yourself converting them to html into the same file name(one at a time of course), then emailing the reports.

On a side note if you also post the original code that was slow, maybe someone will see something to speed it up. Just thinking if it worked before maybe some tuning would improve it to something usable.

Hitesh Shah
9th March 2012, 16:54
Spool.fileout gets initialized at 1st brp.open . For subsequent brp.open spool.fileout may not have valid file pointers. So subseqent stpconv does not find the spool.fileout for conversion and hence no conversion.

You should use try to use variable spool.fileout if possible just brp.opens.