We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,716 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

create report in text file in page size fanfold 14 x 12

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

3
Contributors
7
Replies
1 Month
Discussion Span
7 Months Ago
Last Updated
8
Views
Question
Answered
amit.chaudhari.71
Newbie Poster
6 posts since Sep 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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.

diafol
Keep Smiling
Moderator
10,634 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57

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....................

amit.chaudhari.71
Newbie Poster
6 posts since Sep 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Does this help

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

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

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

amit.chaudhari.71
Newbie Poster
6 posts since Sep 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

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

diafol
Keep Smiling
Moderator
10,634 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,506
Skill Endorsements: 57

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.

urtrivedi
Posting Virtuoso
1,714 posts since Dec 2008
Reputation Points: 299
Solved Threads: 362
Skill Endorsements: 24

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

amit.chaudhari.71
Newbie Poster
6 posts since Sep 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 7 Months Ago by urtrivedi and diafol

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0908 seconds using 2.79MB