| | |
Forcing a page break inside a DIV.
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
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#:
the CSS Classes:
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.
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#:
ASP.NET Syntax (Toggle Plain Text)
if (rowCount == 25) { tableName.CssClass = "MainTable"; } else { tableName.CssClass = "MainTableWithoutBreak; } divName.Controls.Add(tableName);
the CSS Classes:
ASP.NET Syntax (Toggle Plain Text)
.MainTable { TABLE-LAYOUT:auto;PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-TOP:0px;PADDING-BUTTOM:0px;PAGE-BREAK-AFTER:always;WIDTH:100% }
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.
•
•
Join Date: Nov 2006
Posts: 2
Reputation:
Solved Threads: 0
Ar eu showing this Report in IE.. ?
•
•
•
•
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#:
ASP.NET Syntax (Toggle Plain Text)
if (rowCount == 25) { tableName.CssClass = "MainTable"; } else { tableName.CssClass = "MainTableWithoutBreak; } divName.Controls.Add(tableName);
the CSS Classes:
ASP.NET Syntax (Toggle Plain Text)
.MainTable { TABLE-LAYOUT:auto;PADDING-RIGHT:0px;PADDING-LEFT:0px;PADDING-TOP:0px;PADDING-BUTTOM:0px;PAGE-BREAK-AFTER:always;WIDTH:100% }
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.
![]() |
Similar Threads
- How to create Dynamic Page Break in HTML? (JavaScript / DHTML / AJAX)
- Keep a Row from Breaking Across a Page (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: Frames in .NET
- Next Thread: Maintaining Sessions
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax alltypeofvideos appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class control countryselector dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash folder form gridview gudi iis image javascript list listbox login maps microsoft mobile mouse mssql nameisnotdeclared news novell numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail richtextbox rows schoolproject search security select sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webdevelopment webprogramming webservice wizard xsl





