473,769 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

page formatting problem with tables and datagrids - especially printing

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
Nov 18 '05 #1
2 1328
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:T ableCell ID="tc1"
label
datagrid
label
</asp:TableCell></asp:TableRow><a sp:TableRow ID="tr2"><asp:T ableCell ID="tc2"
label
datagrid
label
</asp:TableCell></asp:TableRow><a sp:TableRow ID="tr3"><asp:T ableCell ID="tc3"
label
datagrid
label
</asp:TableCell></asp:TableRow></asp:Table

If 1 is invisble the
tc1.Visible = Fals
tr1.Visible = Fals
End If
Nov 18 '05 #2

"Bin Song, MCP" <an*******@disc ussions.microso ft.com> wrote in message
news:FF******** *************** ***********@mic rosoft.com...
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:T ableCell ID="tc1"> label1
datagrid1
label2
</asp:TableCell></asp:TableRow><a sp:TableRow ID="tr2"><asp:T ableCell ID="tc2"> label3
datagrid2
label4
</asp:TableCell></asp:TableRow><a sp:TableRow ID="tr3"><asp:T ableCell 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
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1854
by: Rob Meade | last post by:
Hi all, Ok - this leads on from speaking to a couple here and in the SQL server group... I've an application which allows the user to type in their text into a form, they add 'happy' tags around their words, the app then replaces these with the html equivalent and saves it to the database... Thus far this has been working very well.
12
2189
by: Jim H | last post by:
We ahve a .NET web page that we dynamically create a bunch of DataGrids and add them to a place holder. When the user hits submit we need to go through all of the DataGrids to get some data. We can't seem to find the grids on the post back, the PlaceHolder.Controls.Count is 0. How do we get that data back. The DataGrids have check boxes that the user may have checked. Those are the rows we want to get so we can't just requery and...
1
1146
by: Jason Shohet | last post by:
Someone in my group created an aspx with 12 tables on it, each with several rows in the table. In codebehind, we often make 1 or more tables visible / invisible. (However within each table, there is no need to make individual rows visible / invisible). I always believed that tables are much more overhead than just having 1 table with lots of rows (Is that true?). So, I suggested, "Just have 1 table, and the <tr> 's we'll make...
0
1041
by: Mike Fellows | last post by:
i have a function (shown below) that accepts a web datagrid and populates it with a dataset when i display my datagrid it shows the date as 00/00/0000 00:00:00 i need to format the time from the end of the date i cant do this in the designer as the webform i use with the datagrid on uses many different functions so i cant format it with the designer
2
1214
by: Philip Rayne | last post by:
I have 2 datagrids, both with databound columns that I have dynamically added. I have an EditCommandColumn on both grids. EnableViewState is enabled on both of the grids. When I click the edit link on the grids I need to repopulate/rebind the grids which I presume is correct. When I click the update button I cannot find my databound columns that I have edited. I have searched google and tried all the obvious examples, but I am just...
5
2745
by: tshad | last post by:
I have been trying to figure out what the Datagrid is doing to create its formatting. I found that some of my Datagrids have a 3D type of border and sometime it has a straight line. I finally found that it comes down to whether there is a "rules=all" attribute (which gives me just a thin black line). If that attribute is not there, you get a 3D effect. I haven't yet been able to figure out what causes it. Here is the table def that...
4
974
by: Mr. B | last post by:
In VB.net, if you set up a print routine... and all works fine (including a print preview)... setting the Page # (1, 2, 3, 4, etc) is easy. HOW can you get the final number of pages? Such as Page 1 of THREE? I know you can get the final number once the routine has gone through each page... but what I want to know is how to ADD the number of pages to be printed to each page (page 1 of 3, page 2 of 3...). I'm not clear IF one can add...
4
3647
by: Ed Jay | last post by:
I generate a DHTML page (a medical report) with dynamically generated text based on user input (answers to questions). The page length changes dynamically. I desire that when the page is printed and reaches a specific length, it terminates printing that page, prints a page number, and then begins to print the next page using the same header and format as the previous page. The page uses no tables or paragraph elements, only CSS. IOW, I...
5
5445
by: Andreas Prilop | last post by:
Firefox 3 (like older versions) ignores TR { page-break-before: always } for the first row of a TBODY. Sample page: http://www.unics.uni-hannover.de/nhtcapri/temp/1000.html Choose "Print Preview". Internet Explorer 6/7 prints every row onto a new page;
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7408
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6673
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.