Showing posts with label print. Show all posts
Showing posts with label print. Show all posts

Sunday, March 11, 2012

bug in string processing if the GO keyword is inside the string

I encoutered a strange behavior using the exec command and I could repreduce
the behavior with the print command:
the command:
print '1
2
3'
is doing it's jub, but if i add go inside the string I get the floowing
error:
print '1
2
go
3'
Server: Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark before the character string '1
2
'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '1
2
'.
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '3'.
Server: Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark before the character string '
'.
can someone explain that or point me to a fix I'm using SQL 2000 SP4 on
windows 2003 server with service pack 1
this problem also occurs is the string is sent as a parameter to a stored
procedure using the exec command.
please helpMartin,
This is not a bug. Go is a command that tells SQL Server that this is the
end of a batch of T-SQL statements. If you execute some code in Query
Analyzer and one line has the go word alone, SQL Server will take this as th
e
Go command. For example, try this
print '1
2
go 3
4'
Anyway, I would avoid the go word at the beginning of a line, if possible.
Ben Nevarez, MCDBA, OCP
Database Administrator
"martin" wrote:

> I encoutered a strange behavior using the exec command and I could repredu
ce
> the behavior with the print command:
> the command:
> print '1
> 2
> 3'
> is doing it's jub, but if i add go inside the string I get the floowing
> error:
> print '1
> 2
> go
> 3'
> Server: Msg 105, Level 15, State 1, Line 1
> Unclosed quotation mark before the character string '1
> 2
> '.
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near '1
> 2
> '.
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near '3'.
> Server: Msg 105, Level 15, State 1, Line 1
> Unclosed quotation mark before the character string '
> '.
>
> can someone explain that or point me to a fix I'm using SQL 2000 SP4 on
> windows 2003 server with service pack 1
> this problem also occurs is the string is sent as a parameter to a stored
> procedure using the exec command.
> please help
>
>|||well, ben,
of course it's a bug
if I get a string as input from a user of a web application, and encode the
string as required like replacing a single apostrophe ' with 2 '' in order
to not break the SQL syntax the same goes with the GO keyword or other
keyword like SELECT.
what exactly should I do in order to pass this kind of a parameter to a
stored procedure? encode it with some way to it's numric ascii
representation?
just image that I will ask you to avoid the END keyword in the beggining of
a sentence in your reply to me, would that not be considered as a bug?
not all string passes as a parameter to a stored procedure are in my control
at all. most of them are not.
"Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
news:968CB5C7-A808-4767-BAAC-C2F59114E390@.microsoft.com...
> Martin,
> This is not a bug. Go is a command that tells SQL Server that this is the
> end of a batch of T-SQL statements. If you execute some code in Query
> Analyzer and one line has the go word alone, SQL Server will take this as
> the
> Go command. For example, try this
> print '1
> 2
> go 3
> 4'
> Anyway, I would avoid the go word at the beginning of a line, if possible.
> Ben Nevarez, MCDBA, OCP
> Database Administrator
>
> "martin" wrote:
>|||martin wrote:
> well, ben,
> of course it's a bug
> if I get a string as input from a user of a web application, and encode th
e
> string as required like replacing a single apostrophe ' with 2 '' in order
> to not break the SQL syntax the same goes with the GO keyword or other
> keyword like SELECT.
>
If you accept string input in that manner and use it for dynamic SQL
then your web application is buggy, dangerous and insecure. This
problem is called SQL Injection and is one important reason why you
should never create dynamic strings out of unverified,
non-parameterized user input. The proper and safe way to do it is to
use parameters in your client code (the ADO parameters collection if
you are using ADO for example).
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||martin
> what exactly should I do in order to pass this kind of a parameter to a
> stored procedure? encode it with some way to it's numric ascii
> representation?
It is not a bug, please post exactly what are you doing in order to help
you?
"martin" <news.microsoft.com> wrote in message
news:eAcI3PCbGHA.3812@.TK2MSFTNGP04.phx.gbl...
> well, ben,
> of course it's a bug
> if I get a string as input from a user of a web application, and encode
> the string as required like replacing a single apostrophe ' with 2 '' in
> order to not break the SQL syntax the same goes with the GO keyword or
> other keyword like SELECT.
> what exactly should I do in order to pass this kind of a parameter to a
> stored procedure? encode it with some way to it's numric ascii
> representation?
> just image that I will ask you to avoid the END keyword in the beggining
> of a sentence in your reply to me, would that not be considered as a bug?
> not all string passes as a parameter to a stored procedure are in my
> control at all. most of them are not.
>
>
>
>
>
> "Ben Nevarez" <BenNevarez@.discussions.microsoft.com> wrote in message
> news:968CB5C7-A808-4767-BAAC-C2F59114E390@.microsoft.com...
>|||well,
so please explain that:
my app does uses ADO.NET and ado.net succeedes to execute SQL statements
that fails to execute in query analyzer.
is there some magic here?
after executing stored procedure with command object, adding a string
parameter
in the profiler I see the following SQL statement executed from ADO.NET:
declare @.P1 int
set @.P1=33
exec sp_insert_string '748F4655-9106-4D45-A0A2-1AA95C4C8912', 2, N'test',
N'--test
go
-- test
', N'asd', N'James', NULL, @.P1 output
select @.P1
the same stored procedure fails to execute from query analyzer.
I thought the answer will be in some changes to the default behavior of
ADO.NET so I also executed the line performed by ADO.NET to set default
execution variables, with no help:
-- network protocol: TCP/IP
set quoted_identifier on
set implicit_transactions off
set cursor_close_on_commit off
set ansi_warnings on
set ansi_padding on
set ansi_nulls on
set concat_null_yields_null on
set language us_english
set dateformat mdy
set datefirst 7
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:1146383014.820122.76100@.j33g2000cwa.googlegroups.com...
> martin wrote:
> If you accept string input in that manner and use it for dynamic SQL
> then your web application is buggy, dangerous and insecure. This
> problem is called SQL Injection and is one important reason why you
> should never create dynamic strings out of unverified,
> non-parameterized user input. The proper and safe way to do it is to
> use parameters in your client code (the ADO parameters collection if
> you are using ADO for example).
> --
> David Portas, SQL Server MVP
> Whenever possible please post enough code to reproduce your problem.
> Including CREATE TABLE and INSERT statements usually helps.
> State what version of SQL Server you are using and specify the content
> of any error messages.
> SQL Server Books Online:
> http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
> --
>|||I've just checked this out on SSMS the SQL 2005 replacement for Query
Analyser.
The problem has been fixed as the print command works perfectly.
The are problems with the Query Analyser SQL interpreter. In a nutshell,
avoid placing Go on it's own at the begginning of the line.
You could change your calling code to do something like
Print '1
2
' + 'Go
3
4'
It's a bodge I know, but it should work ok.
To "Fix" the problem you should upgrade to SQL2005, as I doubt that there
will be another SP for SQL2000.
As mentioned by one of the other posters, you need to make sure that you are
not suseptable to a SQL Injection attack.
OK, you might say that all user input must go through your front end, and
that's 100% secure. But consider the what if scenario.
The simplest way to avoid injection attacks is to use Parameterized queries,
or stored procedures.
The important thing is that any Dynamic SQL uses the sp_executesql command
and uses the parameters properly. i.e. Do not build your query like it's
adhoc sql.
Colin.
"martin" <news.microsoft.com> wrote in message
news:%23GW81yBbGHA.3916@.TK2MSFTNGP03.phx.gbl...
>I encoutered a strange behavior using the exec command and I could
>repreduce the behavior with the print command:
> the command:
> print '1
> 2
> 3'
> is doing it's jub, but if i add go inside the string I get the floowing
> error:
> print '1
> 2
> go
> 3'
> Server: Msg 105, Level 15, State 1, Line 1
> Unclosed quotation mark before the character string '1
> 2
> '.
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near '1
> 2
> '.
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near '3'.
> Server: Msg 105, Level 15, State 1, Line 1
> Unclosed quotation mark before the character string '
> '.
>
> can someone explain that or point me to a fix I'm using SQL 2000 SP4 on
> windows 2003 server with service pack 1
> this problem also occurs is the string is sent as a parameter to a stored
> procedure using the exec command.
> please help
>|||martin wrote:
> well,
> so please explain that:
> my app does uses ADO.NET and ado.net succeedes to execute SQL statements
> that fails to execute in query analyzer.
> is there some magic here?
> after executing stored procedure with command object, adding a string
> parameter
> in the profiler I see the following SQL statement executed from ADO.NET:
> declare @.P1 int
> set @.P1=33
> exec sp_insert_string '748F4655-9106-4D45-A0A2-1AA95C4C8912', 2, N'test',
> N'--test
> go
> -- test
> ', N'asd', N'James', NULL, @.P1 output
> select @.P1
> the same stored procedure fails to execute from query analyzer.
>
GO is not a T-SQL statement. It is a batch separator used by Query
Analyzer and the other client utilities so this behaviour is correct.
BTW you sould not use the sp_ prefix for user procs. sp_ is reserved
for system procs and may adversely affect performance and reliability
if used in databases other than Master.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--|||Ben Nevarez (BenNevarez@.discussions.microsoft.com) writes:
> This is not a bug. Go is a command that tells SQL Server that this is the
> end of a batch of T-SQL statements.
No. GO is just an identifier as far as SQL Server is concerned. That is,
it is not a command or anything.
However, it is a command that is used by many client-tools to signify
the end of batch, that's true.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Thursday, March 8, 2012

bug in exception handling (begin try... begin catch...)?

begin try
-- insert ...
select * from nonexistingtableorfunction;
end try
begin catch
print 'catch me if you can'; -- line will not be printed
end catch;
begin try
exec doNotExitingprocedure;
end try
begin catch
print 'this line is printed :-)';
end catch;
Why this different behaviour?
If you wrap 1. example in anthother proc with exception handling
(begin try... begin catch...),
the wrapping proc will catch the error.
The above behaviour is not what I would expect compared with other
languages such as Java, C#, PL/SQL...
Greetings
B. D. JensenI think this is one of numerous reasons I have noticed a distinct lack of
uptake on the new TRY mechanism. Until it really does catch errors I won't
use it, nor advise my clients to.
"B D Jensen" <bjorn.d.jensen@.gmail.com> wrote in message
news:1191585968.457460.319780@.o80g2000hse.googlegroups.com...
> begin try
> -- insert ...
> select * from nonexistingtableorfunction;
> end try
> begin catch
> print 'catch me if you can'; -- line will not be printed
> end catch;
>
> begin try
> exec doNotExitingprocedure;
> end try
> begin catch
> print 'this line is printed :-)';
> end catch;
>
> Why this different behaviour?
> If you wrap 1. example in anthother proc with exception handling
> (begin try... begin catch...),
> the wrapping proc will catch the error.
>
> The above behaviour is not what I would expect compared with other
> languages such as Java, C#, PL/SQL...
> Greetings
> B. D. Jensen
>|||B D,
I believe that what is happening here is that in your first example, the
batch is failing with a syntax error:
Msg 208, Level 16, State 1, Line 1
Invalid object name 'nonexistingtableorfunction'.
This means that it failed at compile time and never executed. Since it
never executed, the try / catch had no chance to do anything.
In your second example, the called routine got the same error as above and
never executed.
However, in this case the calling routine is running just fine and the try /
catch sees that the called routine got an error.
At least, that is what it looks like to me.
RLF
"B D Jensen" <bjorn.d.jensen@.gmail.com> wrote in message
news:1191585968.457460.319780@.o80g2000hse.googlegroups.com...
> begin try
> -- insert ...
> select * from nonexistingtableorfunction;
> end try
> begin catch
> print 'catch me if you can'; -- line will not be printed
> end catch;
>
> begin try
> exec doNotExitingprocedure;
> end try
> begin catch
> print 'this line is printed :-)';
> end catch;
>
> Why this different behaviour?
> If you wrap 1. example in anthother proc with exception handling
> (begin try... begin catch...),
> the wrapping proc will catch the error.
>
> The above behaviour is not what I would expect compared with other
> languages such as Java, C#, PL/SQL...
> Greetings
> B. D. Jensen
>|||Take a look at the BOL here:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/3a5711f5-4f6d-49e8-b1eb-53645181bc40.htm
In your first case, the missing object caused the batch to terminate, and
TRY/CATCH won't help if the batch is terminated. In your second case, the
batch is not terminated and TRY/CATCH works.
Yuu can place a PRINT statement at the end of each batch to see whether the
batch is terminated before it reaches the end.
Linchi
"B D Jensen" wrote:
> begin try
> -- insert ...
> select * from nonexistingtableorfunction;
> end try
> begin catch
> print 'catch me if you can'; -- line will not be printed
> end catch;
>
> begin try
> exec doNotExitingprocedure;
> end try
> begin catch
> print 'this line is printed :-)';
> end catch;
>
> Why this different behaviour?
> If you wrap 1. example in anthother proc with exception handling
> (begin try... begin catch...),
> the wrapping proc will catch the error.
>
> The above behaviour is not what I would expect compared with other
> languages such as Java, C#, PL/SQL...
> Greetings
> B. D. Jensen
>

Tuesday, February 14, 2012

Break line inside print statement

Hello,
I need to break one line that im printing inside one script. The line is very large and i don=B4t know how to do it.
Best RegardsNot sure exactly what you mean, but perhaps below?
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'there'
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i don´t know how to do
it.
Best Regards|||I'm not sure I understand correctly but
select "Hello" + char(13) + char(10) + "World"
will come out as
Hello
World
rgds
Paul
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i don´t know how to do
it.
Best Regards

Break line inside print statement

Hello,
I need to break one line that im printing inside one=20
script. The line is very large and i don=B4t know how to do=20
it.
Best Regards
Not sure exactly what you mean, but perhaps below?
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'there'
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards
|||I'm not sure I understand correctly but
select "Hello" + char(13) + char(10) + "World"
will come out as
Hello
World
rgds
Paul
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards

Break line inside print statement

Hello,
I need to break one line that im printing inside one=20
script. The line is very large and i don=B4t know how to do=20
it.
Best RegardsNot sure exactly what you mean, but perhaps below?
SELECT 'Hello' + CHAR(13) + CHAR(10) + 'there'
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message news:9c5101c4
3422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards|||I'm not sure I understand correctly but
select "Hello" + char(13) + char(10) + "World"
will come out as
Hello
World
rgds
Paul
"CC&JM" <anonymous@.discussions.microsoft.com> wrote in message
news:9c5101c43422$e3448ef0$a101280a@.phx.gbl...
Hello,
I need to break one line that im printing inside one
script. The line is very large and i dont know how to do
it.
Best Regards

Sunday, February 12, 2012

BPA Questions

Does BPA only read the database being scaned?
How do I print the report?
I only have a copy button, where's the print button?
Does BPA write anything to the database being scanned?
Thanks
> Does BPA only read the database being scaned?
Yes

> How do I print the report?
You can use Copy Report and paste it into Word and print from that
There is also the option to use Reporting Services to report on the results
and you can print from that, save to PDF etc
There are examples of reports that come with it

> I only have a copy button, where's the print button?
I don't think there is one (see above)

> Does BPA write anything to the database being scanned?
No
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Robert Salazar" <RobertSalazar@.discussions.microsoft.com> wrote in message
news:3747E300-1A39-4F44-91ED-71487D15179C@.microsoft.com...
> Does BPA only read the database being scaned?
> How do I print the report?
> I only have a copy button, where's the print button?
> Does BPA write anything to the database being scanned?
> Thanks
>
|||Hi Guys,
I was playing with the BPA and looks good but found that it does not
check for the SA password when I change it to Null or modify it to be
blank.
Is it something wrong with my machine or BPA does not check the
passwords at all.
I thought the BPA should pick up the accounts which have blank
passwords or the same name etc and this should be on the top of list
for the BPA tool to do .
Let me know your thoughts guys.
Cheers
--Ramesh
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message news:<ur9jiI$aEHA.2840@.TK2MSFTNGP11.phx.gbl>...[vbcol=seagreen]
> Yes
> You can use Copy Report and paste it into Word and print from that
> There is also the option to use Reporting Services to report on the results
> and you can print from that, save to PDF etc
> There are examples of reports that come with it
> I don't think there is one (see above)
> No
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Robert Salazar" <RobertSalazar@.discussions.microsoft.com> wrote in message
> news:3747E300-1A39-4F44-91ED-71487D15179C@.microsoft.com...
|||Hi Ramesh
BPA currently does not have any security checks. To do security you can use
Baseline Security Analyzer (http://www.microsoft.com/mbsa )
- Christian
___________________________
Christian Kleinerman
Program Manager, SQL Engine
This posting is provided "AS IS" with no warranties, and confers no rights.
"rams" <ramesh_sql@.yahoo.com> wrote in message
news:5ea6b47e.0407191828.41423a18@.posting.google.c om...
> Hi Guys,
> I was playing with the BPA and looks good but found that it does not
> check for the SA password when I change it to Null or modify it to be
> blank.
> Is it something wrong with my machine or BPA does not check the
> passwords at all.
> I thought the BPA should pick up the accounts which have blank
> passwords or the same name etc and this should be on the top of list
> for the BPA tool to do .
> Let me know your thoughts guys.
> Cheers
> --Ramesh
>
> "Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:<ur9jiI$aEHA.2840@.TK2MSFTNGP11.phx.gbl>...[vbcol=seagreen]
results[vbcol=seagreen]
message[vbcol=seagreen]

Friday, February 10, 2012

border line not displaying properly

hi,

when i preview a report in report manager, i am not able to view borderline (right side), but when i take a print out, it is printing properly all the border lines.

i am uisng a subreport and placing it in a table.when subreport width is smaller than the cell it is placed in, the border line on right side is not displaying but in print it is displaying

with regards

suresh babu

I wasn't able to duplicate this behavior. I created a 2" wide subreport with a simple textbox on it. I then created a parent report with a simple 1 row table and placed the subreport in the middle, 3" wide cell. The right-side borders showed up in Report Manager regardless of whether I placed the borders on the table cell or on the subreport body.

Would you mind opening an issue via the below url and attaching your reports so I can take a look?

http://lab.msdn.microsoft.com/ProductFeedback/Default.aspx

Thank you.

|||

I have a similar problem, although it doesn't involve a SubReport.

I have a table with about 8 columns. For 1 row in the table, I want several of the rows to be underlined - which was handled by setting the border property of the TextBoxes. The data was underlined until I entered formulas/expressions to 3 of the Text Boxes. Now, the boxes with expressions do not show the underlines when the report is displayed, but the underlines do show up on the printed report. Text boxes without expressions are fine.

|||

If you would send a sample report (preferably one that goes against one of our sample databases) to the above URL, we'll take a look.

Thanks, Donovan.

|||

Sorry, can't provide a sample.

I will provide a little more info. I tried removing the expressions from the boxes that did not have a border - the border did not come back.

In one row, I have 8 columns. I set the bottom border to 1Pt. Solid for 7 of the text boxes. The border displayed for 4 of the 7 text boxes.

I resolved my problem by setting the top border of the row below to 1 Pt. Solid. I did this for all 7 columns. The report now displays and prints fine.

I believe, but can't prove, that the top border is displaying for 3 columns and the bottom border is displaying for the other 4 columns.

I am pretty sure that the bottom border originally displayed for all 7 columns when I began the report design. I think the border disappeared when I added the expressions - but I can't say that this is absolutely correct.

border line not displaying properly

hi,

when i preview a report in report manager, i am not able to view borderline (right side), but when i take a print out, it is printing properly all the border lines.

i am uisng a subreport and placing it in a table.when subreport width is smaller than the cell it is placed in, the border line on right side is not displaying but in print it is displaying

with regards

suresh babu

I wasn't able to duplicate this behavior. I created a 2" wide subreport with a simple textbox on it. I then created a parent report with a simple 1 row table and placed the subreport in the middle, 3" wide cell. The right-side borders showed up in Report Manager regardless of whether I placed the borders on the table cell or on the subreport body.

Would you mind opening an issue via the below url and attaching your reports so I can take a look?

http://lab.msdn.microsoft.com/ProductFeedback/Default.aspx

Thank you.

|||

I have a similar problem, although it doesn't involve a SubReport.

I have a table with about 8 columns. For 1 row in the table, I want several of the rows to be underlined - which was handled by setting the border property of the TextBoxes. The data was underlined until I entered formulas/expressions to 3 of the Text Boxes. Now, the boxes with expressions do not show the underlines when the report is displayed, but the underlines do show up on the printed report. Text boxes without expressions are fine.

|||

If you would send a sample report (preferably one that goes against one of our sample databases) to the above URL, we'll take a look.

Thanks, Donovan.

|||

Sorry, can't provide a sample.

I will provide a little more info. I tried removing the expressions from the boxes that did not have a border - the border did not come back.

In one row, I have 8 columns. I set the bottom border to 1Pt. Solid for 7 of the text boxes. The border displayed for 4 of the 7 text boxes.

I resolved my problem by setting the top border of the row below to 1 Pt. Solid. I did this for all 7 columns. The report now displays and prints fine.

I believe, but can't prove, that the top border is displaying for 3 columns and the bottom border is displaying for the other 4 columns.

I am pretty sure that the bottom border originally displayed for all 7 columns when I began the report design. I think the border disappeared when I added the expressions - but I can't say that this is absolutely correct.