Problem printing a table

  • Thread starter Thread starter Amirallia
  • Start date Start date
A

Amirallia

Hello!

I have a wecontrol table in a page, this table has a number of variable
rows depending of the choice of the user.

But when the table has a large number of rows, the printing of the page
requires 2 pages . The first page is ok, but in the second page of the
printing I have no ligne of the row and no ligne of the column printing
on the page!

Any idea ?

Thanks
 
Once a time, I had a problem like you. But it is hard to guess without
seeing the code. My problem was caused by some additional style attributes
of datagrid(display width and height). I just cleared them.And then it
worked.
 
Yunus Emre ALPÖZEN a émis l'idée suivante :
Once a time, I had a problem like you. But it is hard to guess without seeing
the code. My problem was caused by some additional style attributes of
datagrid(display width and height). I just cleared them.And then it worked.

But I don't have a datagrid but a table, I add rows to this table with
source code

here is the code:

Sub CreateLine(ByVal pNbrLine As Integer)
Dim i, j As Integer
Dim lRows As TableRow

Try
For i = 1 To pNbrLine
lRows = New TableRow
For j = 1 To 63
Dim lCellVide As New TableCell
lRows.Cells.Add(lCellVide)
Next
Table1.Rows.Add(lRows)
Next

Catch ex As Exception
End Try
End Sub
 
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CreateLine(100)
End Sub
Sub CreateLine(ByVal pNbrLine As Integer)
Dim i, j As Integer
Dim lRows As TableRow

Try
For i = 1 To pNbrLine
lRows = New TableRow
For j = 1 To 63
Dim lCellVide As New TableCell
lCellVide.Text = i & "," & j
lRows.Cells.Add(lCellVide)
Next
Table1.Rows.Add(lRows)
Next

Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub

I modified your code as follows and I remove style attribute of the table
that is generated by VS.NET from HTML View. And It prints whole 3 pages. I
think your problem is similar caused by style attributes...

Am I right ?
 
Yunus Emre ALPÖZEN a exprimé avec précision :
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CreateLine(100)
End Sub
Sub CreateLine(ByVal pNbrLine As Integer)
Dim i, j As Integer
Dim lRows As TableRow

Try
For i = 1 To pNbrLine
lRows = New TableRow
For j = 1 To 63
Dim lCellVide As New TableCell
lCellVide.Text = i & "," & j
lRows.Cells.Add(lCellVide)
Next
Table1.Rows.Add(lRows)
Next

Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub

I modified your code as follows and I remove style attribute of the table
that is generated by VS.NET from HTML View. And It prints whole 3 pages. I
think your problem is similar caused by style attributes...

Am I right ?

Where do you remove style attributes ? In the HTML code?

Any example ?
 
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="SampleVB.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Table id="Table1" runat="server"></asp:Table>
</form>
</body>
</HTML>
--------------------------------
Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Table1 As System.Web.UI.WebControls.Table

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CreateLine(100)
End Sub
Sub CreateLine(ByVal pNbrLine As Integer)
Dim i, j As Integer
Dim lRows As TableRow

Try
For i = 1 To pNbrLine
lRows = New TableRow
For j = 1 To 63
Dim lCellVide As New TableCell
lCellVide.Text = i & "," & j
lRows.Cells.Add(lCellVide)
Next
Table1.Rows.Add(lRows)
Next

Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
End Class
 
Le 28.01.2005, Yunus Emre ALPÖZEN a supposé :
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="SampleVB.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:Table id="Table1" runat="server"></asp:Table>
</form>
</body>
</HTML>
--------------------------------
Public Class WebForm1
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents Table1 As System.Web.UI.WebControls.Table

'NOTE: The following placeholder declaration is required by the Web Form
Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
CreateLine(100)
End Sub
Sub CreateLine(ByVal pNbrLine As Integer)
Dim i, j As Integer
Dim lRows As TableRow

Try
For i = 1 To pNbrLine
lRows = New TableRow
For j = 1 To 63
Dim lCellVide As New TableCell
lCellVide.Text = i & "," & j
lRows.Cells.Add(lCellVide)
Next
Table1.Rows.Add(lRows)
Next

Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
End Class

if I remove style attributes, how can I set the position of my table ?
 
You can use flow layout and html tables to design your page... Otherwise, I
ve no idea....
 
Back
Top