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 :

<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>

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.

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 :

<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>

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.

yes i'm using I.E 6. it was working before but suddenly the problem appeared.

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...

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.