Forcing a page break inside a DIV.

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 13
Reputation: khusani is an unknown quantity at this point 
Solved Threads: 0
khusani khusani is offline Offline
Newbie Poster

Forcing a page break inside a DIV.

 
0
  #1
Nov 16th, 2006
Hey all,

I'm developing a Reports module for an application. anyway, i'm dynamically generating tables and adding them inside an existing DIV which has the following style :

[html]<DIV id="forPrint" class="hide" style="PADDING-RIGHT:0px;PADDING-LEFT:0px;LEFT:0px;PADDING-BOTTOM:0px;WIDTH:100%;PADDING-TOP:0px;POSITION;absolute;TOP:0px;HEIGHT:100%" runat=server>
</DIV>[/html]

when creating each row inside a loop and add it to the table i check that if the rows number has reached 25, then break the page.

here is how i do it:
C#:
  1. if (rowCount == 25)
  2. {
  3. tableName.CssClass = "MainTable";
  4. }
  5. else
  6. {
  7. tableName.CssClass = "MainTableWithoutBreak;
  8. }
  9.  
  10. divName.Controls.Add(tableName);
  11.  

the CSS Classes:
  1. .MainTable
  2. {
  3. TABLE-LAYOUT:auto;PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-TOP:0px;PADDING-BUTTOM:0px;PAGE-BREAK-AFTER:always;WIDTH:100%
  4. }



the MainTableWithoutBreak CSS class is the same as the MainTable CSS Class but without the PAGE-BREAK-AFTER attribute.

Now the problem is when the report is generated. say that 30 rows are created, the page will have all 30 rows in the same page.

i tried to clear the POSITION: aboslute style from the DIV. then i will have two pages but the first one will start from the middle of the page.

could anyone help me with this problem ? i would really appreciate it.

and sorry if my english is bad and you did not understand anything lol.
Last edited by tgreer; Nov 16th, 2006 at 9:48 am. Reason: No code tags.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 2
Reputation: sachu is an unknown quantity at this point 
Solved Threads: 0
sachu sachu is offline Offline
Newbie Poster

Re: Forcing a page break inside a DIV.

 
0
  #2
Nov 19th, 2006
Ar eu showing this Report in IE.. ?

Originally Posted by khusani View Post
Hey all,

I'm developing a Reports module for an application. anyway, i'm dynamically generating tables and adding them inside an existing DIV which has the following style :

[html]<DIV id="forPrint" class="hide" style="PADDING-RIGHT:0px;PADDING-LEFT:0px;LEFT:0px;PADDING-BOTTOM:0px;WIDTH:100%;PADDING-TOP:0px;POSITION;absolute;TOP:0px;HEIGHT:100%" runat=server>
</DIV>[/html]

when creating each row inside a loop and add it to the table i check that if the rows number has reached 25, then break the page.

here is how i do it:
C#:
  1. if (rowCount == 25)
  2. {
  3. tableName.CssClass = "MainTable";
  4. }
  5. else
  6. {
  7. tableName.CssClass = "MainTableWithoutBreak;
  8. }
  9.  
  10. divName.Controls.Add(tableName);
  11.  

the CSS Classes:
  1. .MainTable
  2. {
  3. TABLE-LAYOUT:auto;PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-TOP:0px;PADDING-BUTTOM:0px;PAGE-BREAK-AFTER:always;WIDTH:100%
  4. }



the MainTableWithoutBreak CSS class is the same as the MainTable CSS Class but without the PAGE-BREAK-AFTER attribute.

Now the problem is when the report is generated. say that 30 rows are created, the page will have all 30 rows in the same page.

i tried to clear the POSITION: aboslute style from the DIV. then i will have two pages but the first one will start from the middle of the page.

could anyone help me with this problem ? i would really appreciate it.

and sorry if my english is bad and you did not understand anything lol.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: khusani is an unknown quantity at this point 
Solved Threads: 0
khusani khusani is offline Offline
Newbie Poster

Re: Forcing a page break inside a DIV.

 
0
  #3
Nov 19th, 2006
yes i'm using I.E 6. it was working before but suddenly the problem appeared.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 2
Reputation: sachu is an unknown quantity at this point 
Solved Threads: 0
sachu sachu is offline Offline
Newbie Poster

Re: Forcing a page break inside a DIV.

 
0
  #4
Nov 19th, 2006
Just remove the Outer Div... What i mean is Dont put the Tables inside the DIV...

Remove the Outer Div a seee.. It should work...
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: khusani is an unknown quantity at this point 
Solved Threads: 0
khusani khusani is offline Offline
Newbie Poster

Re: Forcing a page break inside a DIV.

 
0
  #5
Nov 19th, 2006
Originally Posted by sachu View Post
Just remove the Outer Div... What i mean is Dont put the Tables inside the DIV...

Remove the Outer Div a seee.. It should work...
No still it does not work.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC