page formatting problem with tables and datagrids - especially printing

Discussion in 'ASP .Net' started by mark, Jun 8, 2004.

  1. mark

    mark Guest

    I have one page with a series of reports to be printed like :-
    (bear with me ill try to explain the best i can!)

    report one - checkbox1
    report two - checkbox2
    report three - checkbox3

    and so on

    finally a button to process the reports is pressed
    which sends true for each report needed to a reports page

    which is set out like this :-

    label1
    datagrid1
    label2

    label3
    datagrid2
    label4

    label5
    datagrid3
    label6

    these are all in a table and set to visible - false
    i set them to visible from the true response passed from the other page

    works great - i can have all reports on a page and switch them off and on at
    will - problem is when it comes to printing
    when the labels/datagrids have been set to visible = false theres a lot of
    empty table tags - which causes the bottomost reports
    to print half way down the page

    eg

    <TR>
    <TD>

    </TD>
    </TR>
    <TR>
    <TD></TD>
    </TR>
    <TR>
    <TD></TD>
    </TR>
    <TR>
    <TD></TD>
    </TR>
    <TR>

    is there anyway of disposing of these blank rows before printing ?

    thanks

    mark
     
    mark, Jun 8, 2004
    #1
    1. Advertising

  2. You might try this
    replace the table with ASP:Table and set the related TableCell and TableRow to invisible when you set the label and datagrid to invisible
    <asp:Table id="Table2" runat="server"><asp:TableRow ID="tr1"><asp:TableCell ID="tc1"
    label
    datagrid
    label
    </asp:TableCell></asp:TableRow><asp:TableRow ID="tr2"><asp:TableCell ID="tc2"
    label
    datagrid
    label
    </asp:TableCell></asp:TableRow><asp:TableRow ID="tr3"><asp:TableCell ID="tc3"
    label
    datagrid
    label
    </asp:TableCell></asp:TableRow></asp:Table

    If 1 is invisble the
    tc1.Visible = Fals
    tr1.Visible = Fals
    End If
     
    =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=, Jun 8, 2004
    #2
    1. Advertising

  3. mark

    mark Guest

    "Bin Song, MCP" <> wrote in message
    news:...
    > You might try this:
    > replace the table with ASP:Table and set the related TableCell and

    TableRow to invisible when you set the label and datagrid to invisible.
    > <asp:Table id="Table2" runat="server"><asp:TableRow

    ID="tr1"><asp:TableCell ID="tc1">
    > label1
    > datagrid1
    > label2
    > </asp:TableCell></asp:TableRow><asp:TableRow ID="tr2"><asp:TableCell

    ID="tc2">
    > label3
    > datagrid2
    > label4
    > </asp:TableCell></asp:TableRow><asp:TableRow ID="tr3"><asp:TableCell

    ID="tc3">
    > label5
    > datagrid3
    > label6
    > </asp:TableCell></asp:TableRow></asp:Table>
    >
    > If 1 is invisble then
    > tc1.Visible = False
    > tr1.Visible = False
    > End If


    ill try that thanks!

    mark
     
    mark, Jun 9, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mike
    Replies:
    3
    Views:
    416
    Virgil Green
    Jul 11, 2005
  2. Replies:
    2
    Views:
    355
  3. fdm
    Replies:
    3
    Views:
    796
    Richard
    Oct 20, 2009
  4. Justin C

    Modules for PDFs especially tables.

    Justin C, Jan 21, 2010, in forum: Perl Misc
    Replies:
    12
    Views:
    170
    Eric Pozharski
    Jan 29, 2010
  5. Replies:
    1
    Views:
    82
    Martin Honnen
    Jan 23, 2005
Loading...

Share This Page