I am displaying a summary and groups of data all from one tablein a database.
First I display summary information (where categoryID = 0) in adatagrid. When it goes into the datagrid_itemdatabind, I lookat the itemID and select everything from the database related tothat item - this is where i dyanamically create another datagridto display the group information for that item. Then I add thenewly created datagrid to a panel. This all works fine, but forprinting, I want to display one datagrid per page. Does anyoneknow how to do that? Or if this is not the best way to go aboutit, any tips would be appreciated!
Here is some code:
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =ListItemType.AlternatingItem Then
Dim dg As New DataGrid
Dim dv As DataView = testcaseSubDT.DefaultView
Dim categoryID As Integer = CInt(e.Item.Cells(0).Text)
dv.RowFilter = "itemID=" & categoryID
dg.DataSource = dv
dg.DataBind()
Dim separator As New Label
'When printing, try to put a page break -- THIS DOESN'T WORK
separator.Text = "<hr><p STYLE='page-break-before: always'></p>"& caseDesc
pnlReport.Controls.Add(separator)
pnlReport.Controls.Add(dg)
Also note: If I try to put the <p Style> anywhere in my HTML itdoesn't work
I've also tried setting a Style tag in the head area @div withthat style, but it doesn't seem to work either.
--------------------------------
From: mcgirk
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>CDhzNo6wvkKAmnSLvQ58Kg==</Id>