0

I am trying to convert SQR report to CSV file by command.

I am using SQR Version: SQR V4.3.4

What I actually tried:

from official documentation:

-EH_CSVONLY Creates a CSV file but does not create an HTML file.

so the command that I am using:

sqrwp.exe c:\AUD12000.sqr  ServerName/UserName/Password -c -xcb -ic:\reports\  -EH_CSVONLY -printer:EP

I am wondering of the output as it is PDF file instead of csv file

I am using -PRINTER:EH or ‑PRINTER:EP and -EH_CSVONLY or -EH_CSV with no hope.

I have two questions:

  1. why the output is PDF file although I am using -EH_CSVONLY?
  2. how to convert SQR command to csv file format?
James Z
  • 12,209
  • 10
  • 24
  • 44
ahmed abdelqader
  • 3,409
  • 17
  • 36

1 Answers1

1

Unfortunately, I no longer have access to SQR, but I used to use it a lot.

First of all, the command specified above is SQRWP, not SQRW. That stands for SQR Print. It requires an SPF file as input - it doesn't run SQR, just the converter. Do you have an SPF file? If so, that is the file name that is to be input, e.g. c:\AUD12000.spf SPF stands for SQR Portable File format. SQR always produces one of those first, THEN converts it to the desired output (PDF or Line printer or even CSV).

Link to SQRWP info on Oracle's site

If you do not have a file with an SPF extension, you should run SQRW with the -KEEP option to create one. Command line Parms

The reason to generate an SPF file is so you can play with the options without having to constantly access the database and do all the processing each time. As I pointed out before, the conversion from SPF to the desired format is done at the end of each SQR run. -KEEP just doesn't delete the SPF file at the end of processing.

By the way, neither here nor there, but the CSV format sucks. It generates an awful output file. I always found it better to use -PRINTER:LP (line printer) and then import it into an Excel file directly and save as CSV. I mean if you must. Do NOT expect it to generate pretty columns of data. When I wanted nice columnar output, I used to write headers and column data with commas in between as a separate file and not use the report formatting, but that's a lot of additional work.

Hope this helps.

cardmagik
  • 1,698
  • 19
  • 17
  • Thanks for your time, I have SPF file, and the target is convert that SPF to CSV by command without opening SPF file then click "save as CSV", do u have any idea?, also please note the hyperlink of "Link to SQRWP info on Oracle's site" is not working. – ahmed abdelqader Apr 08 '23 at 20:13
  • also when I click "Save as CSV" nothing happened !, some articles from internet says csv file will be saved into same path of SPF but actually this is not happened with me. – ahmed abdelqader Apr 08 '23 at 20:51
  • You probably can't try to simply save it as a CSV. It's its own format. Try using the command SQRWP c:\aud1200.spf. – cardmagik Apr 09 '23 at 21:45
  • Here is the link again I hope: https://docs.oracle.com/cd/E92519_02/pt856pbr3/eng/pt/tsql/task_GeneratingOutputfromtheCommandLine-c07bb7.html?pli=ul_d66e79_tsql – cardmagik Apr 09 '23 at 21:45
  • As an alternative, go to https://docs.oracle.com/en/ and search for SQRWP The link didn't work for me either, but the direct links do – cardmagik Apr 09 '23 at 21:47
  • And sorry about the delayed answer. I don't normally scan StackOverflow because I no longer work in the field and notifications seem to take over 24 hours – cardmagik Apr 09 '23 at 21:48