Question

How do I keep my data from being cut off?

Asked by: ddrhoward

I have a problem where my data that's being populated into labels is being cut off.  The upper part of the words are on one page and the bottom part are on the second page.
I used the code below to separate the paragraphs whenever there is an actual break in the paragraph. But is there anyway to stop the slicing of the words.

bln = IsDBNull(ChargeReader("vchremarks"))
                If bln = False Then
                    lblremarks.Text = Replace(ChargeReader("vchremarks"), vbCrLf, "<br/>")
                Else
                    lblremarks.Text = "None"
                End If

                                  
1:
2:
3:
4:
5:
6:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-06-15 at 12:01:15ID24493286
Tags

Visual Studio 2003 vb.net

Topics

Programming for ASP.NET

,

Visual Studio

,

Microsoft Visual Basic.Net

Participating Experts
3
Points
0
Comments
10

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Stamping ID's on paragraphs in Word
    I need to sycronize paragraphs in word with records in a content table in SQLserver. So I need to find a way to stamp a record id onto a paragraph. It needs to stay with the paragraph regardless of what the user does, ie start new paragraphs before it, cut/paste etc... Now t...
  2. Retrieving database values simply into paragraphs and not i…
    Hi all I want to retrieve a single row from a database, and embed values from certain columns into a paragraph. All the examples I can find online use a datagrid which displays the data as a huge, well, errm, grid or at least in tabular form. The database values are only si...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: MaxOvrdrv2Posted on 2009-06-15 at 12:07:36ID: 24631919

i've never heard of this happening before on a web page... are you talking about PRINTING a page?

 

by: x_comPosted on 2009-06-15 at 12:09:00ID: 24631936

Hi ddrhoward,
You may try <pre> tag to preserve all the rendered HTML based on the entered.
http://www.w3schools.com/tags/tag_pre.asp
eg:
If bln = False Then
                    lblremarks.Text = "<pre>" & Replace(ChargeReader("vchremarks"), vbCrLf, "<br/>") & "</pre>"
                Else
                    lblremarks.Text = "None"
                End If

 

by: ddrhowardPosted on 2009-06-15 at 13:45:24ID: 24632876

Yes I'm talking about printing a page.

 

by: x_comPosted on 2009-06-15 at 20:38:41ID: 24634728

Hi ddrhoward,
Can you elaborate further regarding the what is your problem on printing and post some of the other code snippet for inspection? Do you need CSS help? Please clarify.

 

by: techprocessPosted on 2009-06-15 at 23:01:51ID: 24635167

Try to add 2 to 3 <Br /> in your code because the page margins are more then one line.

hope this helps....

 

by: MaxOvrdrv2Posted on 2009-06-16 at 04:48:42ID: 24637010

since you're talking about printing a page, here's how you do it:

bln = IsDBNull(ChargeReader("vchremarks"))
               If bln = False Then
                    lblremarks.Text = Replace(ChargeReader("vchremarks"), vbCrLf, "<br/>")
                    lblremarks.Text+="<div style=""page-break-after:always;""></div>"
                Else
                    lblremarks.Text = "None"
                End If
                                              
1:
2:
3:
4:
5:
6:
7:

Select allOpen in new window

 

by: ddrhowardPosted on 2009-06-16 at 10:58:32ID: 24640538

the div style tag didn't work either. and just to elaborate a bit more. I'm populating information from the database onto a webpage and users will be printing from that page.  Well when you get to the end of the page where the last line will be, it cuts off the data because it's really running out of room.  Instead of populating the whole line on the next page, it printing the top half on one page and printing the second half on page 2.  I hope I elaborated enough.  Here's some more code snippet.

 Sub GetReportNotes()
 
        Dim connFF As New SqlConnection(Application("connFF"))
        Dim cmdRN As New SqlCommand("spFFPrintNotes2", connFF)
        cmdRN.CommandType = CommandType.StoredProcedure
        Dim RN As SqlDataReader
        Dim bln As Boolean
        Dim bln2 As Boolean
        Dim bln3 As Boolean
 
        Dim Casenumber As New SqlParameter("@casenumber", SqlDbType.VarChar)
        Casenumber.Value = Session("Casenumber")
        lblcasenumber.Text = Session("Casenumber")
        cmdRN.Parameters.Add(Casenumber)
 
        Try
            connFF.Open()
            RN = cmdRN.ExecuteReader
            Do While RN.Read()
                lblreportdate.Text = RN("dtreportdate")
                lblCounty.Text = RN("vchcounty")
                lblDSFM.Text = RN("vchdsfm")
                lblcasestatus.Text = RN("vchstatus")
                lblcasetype.Text = RN("vchcasetype")
                lblcausetype.Text = RN("vchcausetype")
                lblcausedetails.Text = RN("vchcausedetails")
 
                bln = IsDBNull(RN("vchownerfirst"))
                If bln = False Then
                    lblownername.Text = RN("vchownerfirst") + " " + RN("vchownerlast")
                Else
                    lblownername.Text = RN("vchbusiness")
                End If
 
                bln = IsDBNull(RN("vchoccupantfirst")) 'Occupant is null
                bln2 = IsDBNull(RN("vchownerfirst")) 'owner is null
                bln3 = IsDBNull(RN("vchbusiness2")) 'business is null
 
                If bln = True And bln2 = True And bln3 = False Then
                    lbloccupantname.Text = RN("vchbusiness2")
                ElseIf bln = True And bln2 = True And bln3 = True Then
                    lbloccupantname.Text = "None"
                Else
                    lbloccupantname.Text = RN("vchoccupantfirst") + " " + RN("vchoccupantlast")
                End If
 
                bln = IsDBNull(RN("txtnotes"))
                If bln = False Then
                    lblnotes.Text = Replace(RN("txtnotes"), vbCrLf, "<br/>")
                       Else
                    lblnotes.Text = ""
                End If
            Loop
            RN.Close()
            connFF.Close()
 
        Catch er As Exception
            LogError(er.ToString, "GetReportNotes()-CaseNotesPrintOut.aspx")
            Exit Try
        Finally
            connFF.Close()
        End Try
    End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:

Select allOpen in new window

 

by: MaxOvrdrv2Posted on 2009-06-16 at 11:17:51ID: 24640730

add the page-break-after on the last label's style on your page... it should clear a page rather than print cut in half...

also, could you show me your HTML maybe it's something in there as well... just to be sure.

thanks.

 

by: ddrhowardPosted on 2009-06-16 at 11:25:35ID: 24640803

How would you add the page-break in that label? on html?  By the way here's the Html code..

%@ Page Language="vb" AutoEventWireup="false" Codebehind="CaseNotesPrintOut.aspx.vb" Inherits="FireForms2.CaseNotesPrintOut"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>CaseNotesPrintOut</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<asp:hyperlink id="HyperLink1" style="Z-INDEX: 102; LEFT: 16px; POSITION: absolute; TOP: 8px" runat="server"
				Font-Size="Medium" NavigateUrl="javascript:window.print()" Width="32px">Print</asp:hyperlink><asp:image id="Image1" style="Z-INDEX: 126; LEFT: 336px; POSITION: absolute; TOP: 8px" runat="server"
				Width="156px" ImageUrl="marshal3.png" BorderColor="White" Height="112px"></asp:image>
			<HR style="Z-INDEX: 100; LEFT: 8px; WIDTH: 110.81%; POSITION: absolute; TOP: 64px; HEIGHT: 8px"
				width="110.81%" color="#000099" SIZE="8">
			<asp:label id="Label1" style="Z-INDEX: 101; LEFT: 576px; POSITION: absolute; TOP: 32px" runat="server"
				Font-Size="X-Large" Width="268px">Report Narrative</asp:label><asp:label id="Label12" style="Z-INDEX: 104; LEFT: 8px; POSITION: absolute; TOP: 400px" runat="server"
				Font-Size="Large">Notes:</asp:label><asp:label id="lblnotes" style="Z-INDEX: 105; LEFT: 184px; POSITION: absolute; TOP: 400px"
				runat="server" Font-Size="Large" Width="656px" Text=""></asp:label><asp:label id="Label2" style="Z-INDEX: 106; LEFT: 8px; POSITION: absolute; TOP: 120px" runat="server"
				Font-Size="Large">Casenumber:</asp:label><asp:label id="lblcasenumber" style="Z-INDEX: 107; LEFT: 184px; POSITION: absolute; TOP: 120px"
				runat="server" Font-Size="Large" Text=""></asp:label><asp:label id="Label22" style="Z-INDEX: 108; LEFT: 8px; POSITION: absolute; TOP: 144px" runat="server"
				Font-Size="Large">Report Date:</asp:label><asp:label id="lblreportdate" style="Z-INDEX: 109; LEFT: 184px; POSITION: absolute; TOP: 144px"
				runat="server" Font-Size="Large" Text=""></asp:label><asp:label id="Label21" style="Z-INDEX: 110; LEFT: 8px; POSITION: absolute; TOP: 168px" runat="server"
				Font-Size="Large">DSFM:</asp:label><asp:label id="lblDSFM" style="Z-INDEX: 111; LEFT: 184px; POSITION: absolute; TOP: 168px" runat="server"
				Font-Size="Large" Text=""></asp:label><asp:label id="Label6" style="Z-INDEX: 112; LEFT: 8px; POSITION: absolute; TOP: 192px" runat="server"
				Font-Size="Large" Width="56px">County:</asp:label><asp:label id="lblCounty" style="Z-INDEX: 113; LEFT: 184px; POSITION: absolute; TOP: 192px"
				runat="server" Font-Size="Large" Text=""></asp:label><asp:label id="Label5" style="Z-INDEX: 114; LEFT: 8px; POSITION: absolute; TOP: 216px" runat="server"
				Font-Size="Large">Status:</asp:label><asp:label id="lblcasestatus" style="Z-INDEX: 115; LEFT: 184px; POSITION: absolute; TOP: 216px"
				runat="server" Font-Size="Large" Width="600px" Height="24px" Text=""></asp:label><asp:label id="Label18" style="Z-INDEX: 116; LEFT: 8px; POSITION: absolute; TOP: 240px" runat="server"
				Font-Size="Large">Case Type:</asp:label><asp:label id="lblcasetype" style="Z-INDEX: 117; LEFT: 184px; POSITION: absolute; TOP: 240px"
				runat="server" Font-Size="Large" Width="600px" Text=""></asp:label><asp:label id="Label17" style="Z-INDEX: 118; LEFT: 8px; POSITION: absolute; TOP: 264px" runat="server"
				Font-Size="Large">Cause Type:</asp:label><asp:label id="lblcausetype" style="Z-INDEX: 119; LEFT: 184px; POSITION: absolute; TOP: 264px"
				runat="server" Font-Size="Large" Width="600px" Text=""></asp:label><asp:label id="Label9" style="Z-INDEX: 120; LEFT: 8px; POSITION: absolute; TOP: 288px" runat="server"
				Font-Size="Large" Width="88px">Cause Details:</asp:label><asp:label id="lblcausedetails" style="Z-INDEX: 121; LEFT: 184px; POSITION: absolute; TOP: 288px"
				runat="server" Font-Size="Large" Width="608px" Height="48px" Text=""></asp:label><asp:label id="Label10" style="Z-INDEX: 122; LEFT: 8px; POSITION: absolute; TOP: 336px" runat="server"
				Font-Size="Large">Owner Name:</asp:label><asp:label id="lblownername" style="Z-INDEX: 123; LEFT: 184px; POSITION: absolute; TOP: 336px"
				runat="server" Font-Size="Large" Width="600px" Text=""></asp:label><asp:label id="Label11" style="Z-INDEX: 124; LEFT: 8px; POSITION: absolute; TOP: 360px" runat="server"
				Font-Size="Large">Occupant Name:</asp:label><asp:label id="lbloccupantname" style="Z-INDEX: 125; LEFT: 184px; POSITION: absolute; TOP: 360px"
				runat="server" Font-Size="Large" Width="600px" Text=""></asp:label></form>
	</body>
</HTML>
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:

Select allOpen in new window

 

by: MaxOvrdrv2Posted on 2009-06-16 at 11:31:38ID: 24640859

ah AH! there's the problem really... it's because you are setting a fixed size, with position:absolute to your labels that this is happening probably.

try these 2 things, one after the other, and let me know.

try this first:
 
<asp:label id="lbloccupantname" style="Z-INDEX: 125; LEFT: 184px; POSITION: absolute; TOP: 360px; height:100%;" runat="server" Font-Size="Large" Width="600px" Text=""></asp:label>
 
if that doesn't work, try this instead:
 
<asp:label id="lbloccupantname" style="Z-INDEX: 125; LEFT: 184px; POSITION: absolute; TOP: 360px; page-break-after:always;" runat="server" Font-Size="Large" Width="600px" Text=""></asp:label>
                                              
1:
2:
3:
4:
5:
6:
7:

Select allOpen in new window

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...