vik.patil
25th April 2016, 19:17
We are automating one Print Session to get report output as a file using AFS. Whenever we are running same session in manual mode and printing it with windows printer with Paper Type, it gives professional look to the report. Whereas whenever we are extracting same report using AFS and writing to the file with ASCII device it doesn't give proper look as Page Breaks and Spacing is in not in proper way as with Windows Printer device. Any Idea how to get report using AFS with same formatting as Windows Printer Device?

Any help will be appreciated.

Thanks.

Vikram.

Ajesh
26th April 2016, 06:10
What are the commands or the code that you are using?


I hope you are using stpapi.set.report and stpapi.form.command (I can deduce you have mentioned its Baan V or Higher), in case of Baan V or Higher.

mark_h
26th April 2016, 15:29
Try creating a new ascii device with a page length the same as the other device. If you try printing the ascii file it then it will not look the same since all special codes are stripped out when creating an ascii file. Another thing you can try - we don't do this - is run them to a device that creates PDF files. That might make them more readable. We do email a few reports from ascii reports, but our users know they cannot print them.

vik.patil
27th April 2016, 05:56
Thanks Ajesh and Mark for Input.
@Ajesh: We are using same command to get report output to the file. We are getting report output properly in file but formatting is issue.
@Mark:Page Length for Windows Printer device is set to 0 and "Letter (8 1/2 by 11) - Landscape" is paper type with Page Height with 60. We have tried with same Page length but still we are not getting proper page break and spacing in ASCII Output.

Ajesh
27th April 2016, 07:43
Hi Vik

Post your Code please.

mark_h
27th April 2016, 15:25
In this case I do not think the code will help. They are generating an ASCII report thru AFS. The problem is the ASCII device and the print device do not match when it comes to printing the format. So the ASCII report gets page breaks where the real print device would not. We print purchase orders to an ascii file - those come out pretty close. See attached for how ours is setup - not sure that helps or not. You maybe have to play with different page sizes. In a worst case scenario you could add a new report that would work with the ascii device.

Ajesh
2nd May 2016, 07:18
Both the devices should have the same parameters, the WIndows Printer and the ASCIF like the page length etc. What you can do is copy the Windows Printer on to a new ASCIF device and rename as "ASCIF_NEW" and then after changing the relevant parameters like path etc, you can try printing on the New device.

Is it even related to AFS or just a different device? You can check with running the Session normally and giving the output to ASCIF device.