Jump to content


Photo
- - - - -

How to format text file in pro-iv


23 replies to this topic

#1 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 08 March 2004 - 04:00 PM

I have a report program that spool the output in a text file (run in unix box) and I FTP this text file (16 text file) in our NT environment. I created a DTS package that runs everynight and send this file as an attachment.

Here's my problem... The page break of the text file was not correct after It was transferred to the NT box.

Do you have any idea on how to format a text file in pro-iv or do I need a third party that will do the formatting. I'm thinking of a VB program but if there is a way in pro-iv on how to do it I'll do it in pro-iv.


thanks,
Mike

#2 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 08 March 2004 - 04:07 PM

mmeneses,

You can do it in ProIV.

The issue that you are seeing is Carriage Return versus Carriage Return & Line Feed.

Add CHAR(13) to the end of every line and you should be fine.

Regards,

Joseph

#3 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 08 March 2004 - 04:09 PM

mmeneses,

I may have answered too fast.

If your problem is page breaks, simply take off the page length in your report. This will prevent page breaks from being issued.

Regards,

Joseph

#4 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 08 March 2004 - 04:19 PM

I'll give it a try... thanks

#5 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 08 March 2004 - 05:54 PM

I dont see any problem on the pro-iv side because I was able to print the text file from my program. The client pro-iv setup for my printer was courier new regular 8.

The problem is that after I xfer this file to NT machine the font setup changed to courier new 10. I tried to changed it to size 8 but I still no luck.

#6 Joseph Bove

Joseph Bove

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 756 posts
  • Gender:Male
  • Location:Ramsey, United States

Posted 08 March 2004 - 08:07 PM

Mike,

I just want to make sure I fully understand your issue:

When you print your report under Unix, the end of the page is one line 66 (for argument sake).

When you send the report to a hold file, move the hold file to Windows and print under Windows, the end of the page is now line 58 (for argument sake).

If this is the case, then your problem lies in a lack a job control commands. In Unix, the printer interface files almost always default to courier font, 66 lines per page. In Windows, if you print a text file you are typically subjected to the default setting of notepad.

Depending on your needs, you can instruct the user to always change the font before printing on the Windows side or you can insert job commands into your file.

Job commands will be specific to the ultimate printer. HP has its own job command language (PCL). Canon has its own, etc. Alternately, you could play with RTF (rich text format) or HTML and go through either a 3rd party software or a Microsoft DLL.

Hope that helps.

Joseph

#7 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 08 March 2004 - 08:26 PM

Joseph,

That is exactly my problem and right now I'm trying to play with VB.net and have this report to be formatted on a 66 line (for argument sake).

Anyway thanks for all your reply.

Mike

#8 Bob Filipiak

Bob Filipiak

    Expert

  • Members
  • PipPipPipPip
  • 133 posts
  • Gender:Male

Posted 08 March 2004 - 10:57 PM

mmenses,

I do not know if this will have any bearing; but long ago, i had to deal with our Unix box and "On deamnd label printing". The output was such that one or more labels were printed; and that stuff such as 'form feed' had to be avoided. First thing I did was to get rid of the page length, this puts form feeds in the output. Doing this insured a continuous stream of data. If I needed 30 labels, fine thirty printed; only one, then one printed.

Your font defaulls may be the cause of the change to Courier 10 point. Another area to check in windows is your margins; as these settings will affect things like line overflow (too many characters for the line, which forces an extra line feed). number of printed lines per page.

If you are expecting the windows system NOT to do any additional formatting, (i.e. print the page EXACTLY as sent) then you will have to play around with the settings. Also, look around for "output format". In a previous thread, i passed a tip to someone who had a printing problem in windows. That involved changing the "output format"; but I will be dammed if I remember where that setting is.

HTH

Bob Filipiak

#9 Bob Filipiak

Bob Filipiak

    Expert

  • Members
  • PipPipPipPip
  • 133 posts
  • Gender:Male

Posted 08 March 2004 - 11:10 PM

mmensaes,

I found that earlier post, and pasted it below.

HTH

Bob Filipiak


(Post)


I re-read your posts, and the potential solution may be easier than either of us would believe. While I do not have any exposure to Win 2000; the Win XP system I use at the office has in the properties page settings for a "print processor". I found it when I added an Okidata 320 to my system. Once in "properties"; click on the "advanced" tab. You may find 3 buttons in the lower half of the dialog box, one may be titled "print processor". If it exists, click on it, and see what "data format" is being used to send print jobs to the printer. In the XP system I have, there are 3 variants of "RAW" and 4 variants of "EMT" and "TEXT". One variant is "RAW" alone, then there are "RAW FF appended" and "RAW FF auto". If you are set for "RAW", then one of the other choices may accomplish what you are trying to do. See if that works. The only other option that comes to mind is an "end of file header" which prints a space character on line 66 of your report. It works on my dinosaur, but then again, who knows what has changed.

#10 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 09 March 2004 - 01:54 PM

Bob,

Thanks for the info....
I have not started the VB.net program that will re-format this text file because I know there is a work around on this . I will try your suggestion later because I need to have administrator access so I can modify my printer properties.

By the way I found out yesterday that changing the font size to 8 (courier new) and the page size (top and bottom set to zero) works the same as a unix report. But this is not gonna work for them because the user wont accept this work around. They dont want to spare their time changing the setup of the report.. IT'S A WASTE OF TIME (according to them)...

thanks again...

#11 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 09 March 2004 - 02:52 PM

Bob,

The data format of my printer was set to RAW and I still have a problem with my report. Anyway thanks again...

#12 Bob Filipiak

Bob Filipiak

    Expert

  • Members
  • PipPipPipPip
  • 133 posts
  • Gender:Male

Posted 09 March 2004 - 06:06 PM

mmenses,

Now, correct me if I am wrong, it appears that your problem is related to font and character size settings used when printing in windows. You may have to send the appropriate control codes as part of your report. This is something I was forced to do when I created purchase order forms that were faxed (better image quality); various dunning letters. in my case, it was to select a "letter quality" mode.

HTH

Bob Filipiak

#13 mmeneses

mmeneses

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

Posted 09 March 2004 - 07:34 PM

Bob,

That is exactly the problem and I guess the only solution is to add the job control language. I dont know if you can embed a JCL in a text file but I know you can and I've done this a lot embeding the JCL inside the program before you print your text file. Anyway I will give it a try....

thanks again,
MMeneses

#14 Mike Schoen

Mike Schoen

    Expert

  • Members
  • PipPipPipPip
  • 198 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 10 March 2004 - 03:11 PM

Another option to adding job control language would be to convert the text files to .rtf files with
formatting (fonts, size, etc).
That way the files can be printed from word/openoffice with proper layouts.

#15 Vol Yip

Vol Yip

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 393 posts
  • Gender:Male
  • Location:Hong Kong

Posted 11 March 2004 - 03:17 AM

Mike,

Frankly speaking I do not quite understand the whole issue. Why you want to print the file in Unix and FTP to window to print? Why don't you just print through PRO-IV, output to your Window printer through GUI client?

Then, put PCL (escape sequence) into your PRO-IV report, at Client window mapping, select DEVICE and direct straight to the printer instead of goes through window print driver (otherwise your escape sequence in the report will be lost).

Will this help?

Regards,

Vol



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users