In report module, how can export in .txt file

Martin Lalande2
Giga Contributor

In report   module, how can export in .txt file. No excel, no csv, only in .txt file

1 ACCEPTED SOLUTION

Inactive_Use167
Mega Expert

Hi Martinl,

 

Did you get the solution for it?

 

Thanks

Harish

View solution in original post

7 REPLIES 7

Scheuerman1
Mega Expert

To my knowledge, you cannot natively export to a pure .txt format. I suppose you could export to csv or excel and then try to export to text from there.



May I ask what the use case is for exporting to a txt file?


Hi.



Thanks for your response.



But I want to export like a dump from mainframe.



What do you think please about scripting below, I found it but not try.


Does it possible to apply on export list ?





Thanks,


I don't see any script attached or included with your post. I do understand that you are trying to export to a pure text file, similar to how some mainframes are able to.



The challenge that I have is that I just do not understand the use case. What do you then do with the text file? At that point it is not going to be human readable to any functional degree. Are you then feeding that document into another system for further processing? Or, perhaps feeding it into an application for accessibility needs, such as a text-to-voice application?



If you are feeding it into another system, does that system have APIs or the ability to connect with a web service?


Hi.



The script was an image pasted. Here the text:



**************************************************************



I want to export like a dump from mainframe.


What do you think please about scripting below, I found it but not try.


Does it possible to apply on export list ?



1. var myFields = new Packages.com.glide.choice.ChoiceList();


2. myFields.add('first_name');


3. myFields.add('last_name');


4.


5. var myQuery='first_name=Fred';


6.


7.


var c = new Packages.com.glide.generators.CSVExporter('sys_user', myQuery, myFields);


8. var outFile = new Packages.java.io.File('/tmp/pat.txt');


9. var outStream = new Packages.java.io.FileOutputStream(outFile);


10. c.generate(outStream);


11. outStream.close();



Thanks