473,396 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Printing web pages

Hi I am actually a vb.net windows developer using code to write a web page.
I have a loop that writes rows to the web page. What I would like to do is:

1. Every five tables force a page break

OR

2. If a table is broken between pages it should force a pagebreak to make
the table appear on the next page.

Can this be done in HTML? thank you for any help.........

A sample of how it is looking in my project....drs is a variable for row ,
Dshistory1.Tables is the table of data to be written, i is the integer
indicating what row you are on, sw is the data.

For Each drs In Dshistory1.Tables(0).Rows

i = i + 1

sw.WriteLine("<html>")

sw.WriteLine("<body>")

sw.WriteLine("<table border=3 cellspacing=1 width=100% id=AutoNumber1>")

sw.WriteLine("<tr>")

sw.WriteLine("<td width=33% align=center><b>CUSTNO</b></td>")

sw.WriteLine("<td width=33% align=center><b>CUSTNAME</b></td>")

sw.WriteLine("<td width=34% align=center><b>SLSMNO</b></td>")

sw.WriteLine("</tr>")

sw.WriteLine("<tr>")

sw.WriteLine("<td width=33% align=center>" &
Dshistory1.Tables(0).Rows(i).Item("CUSTNO") & "</td>")

sw.WriteLine("<td width=33% align=center>" &
Dshistory1.Tables(0).Rows(i).Item("CUSTNAME") & "</td>")

sw.WriteLine("<td width=34% align=center>" &
Dshistory1.Tables(0).Rows(i).Item("SLSMN") & "</td>")

sw.WriteLine("</tr>")

sw.WriteLine("</table>")

sw.WriteLine("</center>")

sw.WriteLine("</div>")

Next

sw.WriteLine("</body>")

sw.WriteLine("</html>")

sw.Close()

Nov 20 '05 #1
3 2563
Cor
Scorpion,
Please don't cross post this, now the one who answers you has to watch that
he removes all the responding links.

A webpage is always one page(when we are not talking about frames and that
you do not), it has no pagebreaks.
Therefore I do not understand what you mean with pagebrakes.
I can think about 2 different things that you maybe want to do, but please
will you explain that first, before I make a complete novel.

Keywords: are printing or more webpages each after each other.

Cor
Nov 20 '05 #2
scorpion53061 wrote:
2. If a table is broken between pages it should force a pagebreak to make
the table appear on the next page.


Look into the CSS 2 paged media stuff:

http://www.w3.org/TR/CSS2/page.html

You could use, say:

table
{
page-break-inside: avoid;
}

to ask the browser not to break pages within the table (sometimes a page
break is unavoidable though, for instance, if the table is more that one
page long)

Be aware though that not all browsers are smart enough to handle CSS
pages.

--
Toby A Inkster BSc (Hons) ARCS | mailto:to*****@goddamn.co.uk | pgp:0x6A2A7D39
aim:inka80 | icq:6622880 | yahoo:tobyink | jabber:ta*@jabber.linux.it
http://www.goddamn.co.uk/tobyink/ | "You've got spam!"
playing://(nothing)
Nov 20 '05 #3

"scorpion53061" <sc************@charter.net> wrote in message
news:vl************@corp.supernews.com...
Hi I am actually a vb.net windows developer using code to write a web page. I have a loop that writes rows to the web page. What I would like to do is:
1. Every five tables force a page break

OR

2. If a table is broken between pages it should force a pagebreak to make
the table appear on the next page.

Can this be done in HTML? thank you for any help.........

A sample of how it is looking in my project....drs is a variable for row ,
Dshistory1.Tables is the table of data to be written, i is the integer
indicating what row you are on, sw is the data.

For Each drs In Dshistory1.Tables(0).Rows

i = i + 1

sw.WriteLine("<html>")

sw.WriteLine("<body>")

sw.WriteLine("<table border=3 cellspacing=1 width=100% id=AutoNumber1>")

sw.WriteLine("<tr>")

sw.WriteLine("<td width=33% align=center><b>CUSTNO</b></td>")

sw.WriteLine("<td width=33% align=center><b>CUSTNAME</b></td>")

sw.WriteLine("<td width=34% align=center><b>SLSMNO</b></td>")

sw.WriteLine("</tr>")

sw.WriteLine("<tr>")

sw.WriteLine("<td width=33% align=center>" &
Dshistory1.Tables(0).Rows(i).Item("CUSTNO") & "</td>")

sw.WriteLine("<td width=33% align=center>" &
Dshistory1.Tables(0).Rows(i).Item("CUSTNAME") & "</td>")

sw.WriteLine("<td width=34% align=center>" &
Dshistory1.Tables(0).Rows(i).Item("SLSMN") & "</td>")

sw.WriteLine("</tr>")

sw.WriteLine("</table>")

sw.WriteLine("</center>")

sw.WriteLine("</div>")

Next

sw.WriteLine("</body>")

sw.WriteLine("</html>")

sw.Close()


First off, how many rows do you want in a table? How many tables before the
break.
Also (sw) is NOT the data beign written. The value of ITEM is what you are
writing to the table. You also have the value of Tables set to (0) meaning
it will ALWAYS be (0). You can remove the (sw) and change the value of
Tables to a variable that will change when the row limit has been reached by
checking to see how many rows have been written.
Nov 20 '05 #4

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

Similar topics

4
by: Jody Gelowitz | last post by:
I am having a problem with printing selected pages. Actually, the problem isn't with printing selected pages as it is more to do with having blank pages print for those pages that have not been...
5
by: Mark Preston | last post by:
Admission first - I don't actually have a problem here but have noticed that a lot of people have been asking similar questions and getting very varied answers. What I've done is to sort of...
4
by: Jamey Shuemaker | last post by:
I've been looking for a way to do a duplex print job without a duplex printer. I reviewed some old posts about printing odd pages and found that most of them led to KB article 101075 or an export...
3
by: Tim | last post by:
Hi, I am creating my own method for printing. I am using PrintDocument and cycling through the data and creating new pages as neccessary. My question is, how can I know that total number of...
4
by: Arif | last post by:
I C# code prints very slow as compared to a third party barcode printing software. That software prints approximately 10 labels in 2 seconds while my C# code prints 10 labels in 5 to 6 seconds. And...
6
by: Bill | last post by:
Hi I am trying to get my listbox items to print if they stream past the one page mark. my code is working for one page of information (if the e.hasmorepages) is not there. But I am having...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
0
by: John Smith | last post by:
Hello, I have 7 different crystal reports that need to be collated. Since I want to end up with a page of each (which all together make a single report), I created a blank main report and then...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
2
by: deepakfordotnet | last post by:
Hi, First of all let me confess that I could not get the solution to the same problem from an earlier post Printing :by Mr.Richard MSL (dated September 24th 2006) working. (Replied by Mr.Walter...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.