•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,488 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,436 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 4264 | Replies: 4
![]() |
•
•
Join Date: Oct 2006
Location: Jordan
Posts: 13
Reputation:
Rep Power: 2
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#:
if (rowCount == 25)
{
tableName.CssClass = "MainTable";
}
else
{
tableName.CssClass = "MainTableWithoutBreak;
}
divName.Controls.Add(tableName);the CSS Classes:
.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 8:48 am. Reason: No code tags.
•
•
Join Date: Nov 2006
Posts: 2
Reputation:
Rep Power: 0
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#:
if (rowCount == 25) { tableName.CssClass = "MainTable"; } else { tableName.CssClass = "MainTableWithoutBreak; } divName.Controls.Add(tableName);
the CSS Classes:
.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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- 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: how to show data from database in label?


Linear Mode