i want to create a text report and i have use this coding:-

<?php
$f=fopen("c:\amit.txt", "wb");

// adding header
$text="\n Your text to write \n ".date('d')."-".date('m')."-".date('Y')."\n\n";
fputs($f, $text);
fclose($f);
?>

which results me some thing like when i open it in windows [i.e my computer->c drive->mit.txt] :-

[]Your text to write[]09-09-2012[][]

but i want it like this

Your text to write
09-09-2012

and in fanfold paper size 14" * 12"
as i have a huge data to create a report for ex payslip of all employee in my company

plz help me

Re: create report in text file in page size fanfold 14 x 12 80 80
Member Avatar

Not sure about that, but you can set dimensions in a Print CSS file. You can set page breaks etc, but I'm not sure that it can be set dynamically, unless you use js.

Re: create report in text file in page size fanfold 14 x 12 80 80

sir very very thanks for replying me but as i am a very fresher in this feild plz give me some sampal js and print ccs coding for line break / set page breaks etc so that i can get my output file [amit.txt] like

Your text to write
09-09-2012

instant of

[]Your text to write[]09-09-2012[][]

when i open it in windows [i.e my computer->c drive->amit.txt]

kind att. plz
currently i am using visual basic 6.0 and i use char(12) function for line break and char(13) function for page break
and
i want to switch this program vb 6.0 to php

i think i have made myself clear to u.

plz help me to come out of it

plz....................

Re: create report in text file in page size fanfold 14 x 12 80 80

Does this help

$text="\r\n Your text to write \r\n ".date('d')."-".date('m')."-".date('Y')."\r\n";

Re: create report in text file in page size fanfold 14 x 12 80 80

thanks urtrivedi, its works for line break but at last i want something for page break

Re: create report in text file in page size fanfold 14 x 12 80 80
Member Avatar

I'm sure you can Google 'css page-break', can't you?

Re: create report in text file in page size fanfold 14 x 12 80 80

I am not sure how you can add page break in plain text file. I think its dependent on software you use to open file like notepad/wordpad/word etc.

Re: create report in text file in page size fanfold 14 x 12 80 80

dear friends , i got my solutions by using \r\n for line break and \n\f for paze break
but remimber that report should contains 60 to 75 nos of line per page depending on font/fonte size u use

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.