473,609 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to output a text file with a page break

This is not as simple as I thought.

Using Print # I am outputting content for a text file. I wanted at certain
points to force a page break so I thought a Chr(12) for a form feed may
work.

If opened in notepad and printed it doesn't. In WordPad or Word it sort of
does but puts a blank line at the start of each new page.

I then thought of an RTF file but this requires a heap of other control and
formatting info. In Notepad it looks crap.

The requirement is that we are sending a list of orders to someone and they
will want to view on screen and print this out. The page break is to
separate orders.

I don't know what they have installed but feel safe in that they will have
the 3 apps above. Can't count on a browser so HTML is out. Text file seemed
the easiest.

It will be sent as an attachment to an email.

Any ideas.

Jeff
Jan 27 '06 #1
3 9449
End a print statement with a semicolon to prevent it going to a new line
after printing. See my example inline with your original post...
Jeff wrote:
This is not as simple as I thought.

Using Print # I am outputting content for a text file. I wanted at certain
points to force a page break so I thought a Chr(12) for a form feed may
work.

If opened in notepad and printed it doesn't. In WordPad or Word it sort of
does but puts a blank line at the start of each new page.
print #9, chr(12) would put a blank line at the top of each page
print #9, chr(12); would not (note the semicolon)
I then thought of an RTF file but this requires a heap of other control and
formatting info. In Notepad it looks crap.

The requirement is that we are sending a list of orders to someone and they
will want to view on screen and print this out. The page break is to
separate orders.

I don't know what they have installed but feel safe in that they will have
the 3 apps above. Can't count on a browser so HTML is out. Text file seemed
the easiest.

It will be sent as an attachment to an email.

Any ideas.

Jeff

Jan 27 '06 #2
Jeff,
If this is a regular email attachment, you can output the report as
Snapshot. Your end used can download (or you can download for them)
from Microsoft the Access Snapshot viewer. This will provide
additional security, printing flexibility, and simplified support.
Your page breaks can be managed in the report design.

Jan 27 '06 #3
Or you could generate a pdf, which doesn't require your user to
download, install, and maintain another piece of software (if you think
pdf viewers are installed everywhere). Generating a pdf is usually as
simple as "print" with pdf being the target printer, using the adobe
driver ($), the paperport driver ($), or a free drive such as this one
http://www.primopdf.com

DoDahD wrote:
Jeff,
If this is a regular email attachment, you can output the report as
Snapshot. Your end used can download (or you can download for them)
from Microsoft the Access Snapshot viewer. This will provide
additional security, printing flexibility, and simplified support.
Your page breaks can be managed in the report design.

Jan 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2802
by: heatherpanek | last post by:
Does anyone know how to create a set number of data lines per page when creating an Access report that is ultimately being used to export as a space-delimited text file? OR, is it possible to set a page break so that the exported space-delimited text file still contains the page break? I am trying to take an Access report and COLD (Computer Output to Laser Disk) process it into a document managment system. The only problem is, without...
3
2033
by: Blankdraw | last post by:
I'm getting NO errors and 2 warnings with this code. I thought I was ready to write the output-formatting segment, but may be way off the mark now. The warnings say that "OPEN() and READ() are undeclared - assuming an external is returning integer values." This is not the source of the problem. Step-Thru causes the system to demand the location of system-sounding files like: CHKSTK.ASM, CRT0.C, READ.C. With no real debugger...
3
6252
by: Barbara Alderton | last post by:
I recently wrote an ASP.NET app that used user controls. I produced a printer-friendly output form. One requirement was a pagebreak between one part of the form and another. I had no problem adding the style definition below in the <hr> tag (line tag) which was the last item in the page before the break: <hr color="gray" size="1" style="PAGE-BREAK-AFTER: always"> and when the form is printed it forces a page-break. However, now I'm...
14
2661
by: dawnerd | last post by:
Hi, I am developing a CMS and came across something which has never happened to me before, and I re-wrote the specific script twice, both differently, and still had the same error. I'm not sure if it is apache, or php, or just an error I am not seeing. here is the code: <?php /** * Loop through the resultset
19
2633
by: Chad | last post by:
Okay, let's say I have an exotic os that limits how much goes to stdout. When I go like.. #include <stdio.h> int main(void) { int i=0; for(i=0; i< 10; i++) { printf("a \n");
10
1519
by: Alan M Dunsmuir | last post by:
Is there a standard technique, in a PHP/MySQL Web Application, for users to be provided with printable-quality output - e.g. business invoices - created for them on the fly?
1
1939
by: hotrod57 | last post by:
I am trying to append the results from a form to a text file. My code is supposed to print out the results on one page, and append the results to another page each time data is entered on the form and the submit button is hit. Unfortunately, it is only printing out the message acknowledging the submit button--no data on either form. Here is the code below, please help if you can. PHP code that reads the form submission: <?php function...
0
1800
by: jebbyleezer | last post by:
Hello, I have source code that builds correctly, however, after the program terminates the output file produced is empty. Here is my source code: import java.io.*; import java.util.Scanner; public class project { public static void main( String args ) {
11
2923
by: JRough | last post by:
I'm trying to use output buffering to cheat so i can print to excel which is called later than this header(). header("Content-type: application/xmsdownload"); header("Content-Disposition: attachment; header("Pragma: no-cache"); header("Expires; 0"); print "$header\n$data";
0
8139
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8579
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8555
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8232
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8408
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6064
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5524
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.