HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by sudip »

rathinagiri wrote: In HMG, the dimension of width and height of the paper is measured in millimeters and not columns. For example, if we choose an 'A4' paper, it is 210 mm wide and 297 mm high.

From this we can reduce the top, left, right and bottom margins say 25 mms (approx. 1 inch).

Then, we start printing like this @ 25,25 print 'This is to be printed' font "Arial" size 10

Hence, if you want to have the same proportion like your old dos, we can have here a small udf to convert the column number to mm.

@ c2mm(10),c2mm(10) print 'This as the first column' font "Arial" size 10
@ c2mm(10),c2mm(20) print 'This as the second column' font "Arial" size 10

Now, the function c2mm() is like this.

function c2mm(ncol)
return (ncol/80 * 210) // 80 is the number of columns in your old dos application. 210 is the width of the paper in windows. :)

I think I hadn't messed you more.
Rathi,

Thanks a lot! And I am learning so many things about printing today! Thank you Swapan for this topic :)

Now I have a suggestion. IMHO, may I change your code as:

@ r2mm(10),c2mm(10) print 'This as the first column' font "Arial" size 10
@ r2mm(10),c2mm(20) print 'This as the second column' font "Arial" size 10

...
...
Function R2mm(nRow)
return (nRow/66 * 297)

...
...

Now is there any function(s) to get the current Page Width and Current Page Height (PAPERWIDTH / PAPERLENGTH :?: ). And is there any function to get current row or column position like PROW(), PCOL()?

BTW, I am storing your posts in this this thread in my computer (like I did in case of MySql).

Thank you again.

Regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by Rathinagiri »

It is nice to have a function for row too.

I don't think that there are functions like prow() and pcol() available :(
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by swapan »

rathinagiri wrote: Hence, if you want to have the same proportion like your old dos, we can have here a small udf to convert the column number to mm.

@ c2mm(10),c2mm(10) print 'This as the first column' font "Arial" size 10
@ c2mm(10),c2mm(20) print 'This as the second column' font "Arial" size 10

Now, the function c2mm() is like this.

function c2mm(ncol)
return (ncol/80 * 210) // 80 is the number of columns in your old dos application. 210 is the width of the paper in windows. :)
Rathi, its wonderful for your being so supportive....., hope others will also share their "ways" to tackle windows printing for those with a HANGOVER OF DOS PRINTING CONCEPT!
rathinagiri wrote: I think I hadn't messed you more.
No not at all! Infact you've blessed this thread with your valuable inputs!

In this regard would love to know if Dot Matrix Printers are still prevailing in other countries?

With regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by swapan »

sudip wrote: Now I have a suggestion. IMHO, may I change your code as:

@ r2mm(10),c2mm(10) print 'This as the first column' font "Arial" size 10
@ r2mm(10),c2mm(20) print 'This as the second column' font "Arial" size 10

...
...
Function R2mm(nRow)
return (nRow/66 * 297)

...
...

Now is there any function(s) to get the current Page Width and Current Page Height (PAPERWIDTH / PAPERLENGTH :?: ). And is there any function to get current row or column position like PROW(), PCOL()?

BTW, I am storing your posts in this this thread in my computer (like I did in case of MySql).

Thank you again.

Regards.

Sudip

Thanks Sudip for taking interest in this topic. Yes your this function is also required. I'm done with a simple Master Entry form and now my next agenda was to print this data as Master List & later on print one sheet with all the related info. of an individual master record. Without the support of this forum wouldn't have come so far.......in any case there's lot...lot to learn.

Regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by sudip »

Hi Swapan,
swapan wrote: In this regard would love to know if Dot Matrix Printers are still prevailing in other countries?
Regarding DMP, please try to convert all your programs to use Windows Printing ASAP. Becase, now a days, all new DMP printers are connected with USB port only. If you transfer all your reports to windows printer compatible, then you don't have to worry about whether it is DMP or any other printer.

With best regards.

Sudip
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by Rathinagiri »

Even, in our forum itself, we have a small software to convert dot matrix printing to windows printing as such!

That would also be useful, you can use old style of printing. It can be useful if you have old printers too.

The only problem is we can't have preview.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by swapan »

Guys .........

Now the issue of giving page-break in Potrait & Lanscape mode.

In Clipper-Dos application, I use :
if ln=1 or ln>60
RepoHead() && this routine prints the heading
endi
ln=iif(ln>60,1,ln) && where ln denotes line no.

Now tell me we've to give similar kind of treatment here also, and Is it so:-

if Potrait mode
nHeight=297
elseif Landscape mode
nHeight=210
endif
if ln>nHeight && ln=current row
end printpage
ln=0 && or 1
start printpage
endif

Or I'm again getting messed up with DOS printing hangover!

Regards,

Swapan
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by sudip »

rathinagiri wrote:Even, in our forum itself, we have a small software to convert dot matrix printing to windows printing as such!

That would also be useful, you can use old style of printing. It can be useful if you have old printers too.

The only problem is we can't have preview.
So, you may guess what I shall request ;) How can I download that software ?

Thanks in advance.

Regards.

Sudip
With best regards,
Sudip
User avatar
swapan
Posts: 242
Joined: Mon Mar 16, 2009 4:23 am
Location: Kolkata, India
Contact:

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by swapan »

rathinagiri wrote:Even, in our forum itself, we have a small software to convert dot matrix printing to windows printing as such!

That would also be useful, you can use old style of printing. It can be useful if you have old printers too.

The only problem is we can't have preview.
Is it taking care of 132 cols. reports in compressed mode? I mean 225/232 chars. gets printed horizontally on a DMP in compressed mode, what happens to such reports with this utility? BTW is it the same Sudip was referring to in this thread?

Take care..... will be a bit busy attending mairrage ceremonies ( :lol: ), but when I'm back hope to see you guys with fresh inputs.
Thanks & Regards,
Swapan Das

http://www.swapandas.com/
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: HOW TO PRINT A SIMPLE REPORT IN WINDOWS FORMAT

Post by sudip »

Hello Swapan,

I hope you should go thru the reference file /hmg/DOC/print.html, written by Robergo Lopez. It is extremely helpful.

Regards.

Sudip
With best regards,
Sudip
Post Reply