Showing posts with label vb6. Show all posts
Showing posts with label vb6. Show all posts

Friday, March 23, 2012

frustrating formats

there are times i realize why people are resistant to .net...
in vb6, i can use: format$(fields!phonenumber,"(###) ###-####")
in vbnet:
1 - problem: no support for string formatting, only numbers
compensate: use csng
result: format(csng(fields!phonenumber),"(###) ###-####")
2 - new problem: empty strings result in an error
compensate: use iif function
result: iif ( len(trim(fields!phonenumber))=0,"",
format(csng(fields!phonenumber),"(###) ###-####"))
3 - new problem: vbnet evaluates ALL THREE EXPRESSIONS, regardless of the
condition. so empty strings still result in an error.
this is inexplicable.
iif(<condition>,<truepart>,<falsepart>) replaces:
if <condition> then
<truepart>
else
<falsepart>
end if
why are all 3 being evaluated?
so, half an hour later, i have no solution.
simple need: i want to display a phone number properly formatted if one
exists, and nothing if it doesn't.
please help!
dushan bilbijaTry an expression like this.
=iif(Fields!phonenumber.Value = Nothing, "",
format(csng(fields!phonenumber.Value),"(###) ###-####"))
Bruce Johnson [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Dushan Bilbija" <dbilbija@.msn.com> wrote in message
news:uBwTRH0iEHA.2664@.TK2MSFTNGP11.phx.gbl...
> there are times i realize why people are resistant to .net...
> in vb6, i can use: format$(fields!phonenumber,"(###) ###-####")
> in vbnet:
> 1 - problem: no support for string formatting, only numbers
> compensate: use csng
> result: format(csng(fields!phonenumber),"(###) ###-####")
> 2 - new problem: empty strings result in an error
> compensate: use iif function
> result: iif ( len(trim(fields!phonenumber))=0,"",
> format(csng(fields!phonenumber),"(###) ###-####"))
> 3 - new problem: vbnet evaluates ALL THREE EXPRESSIONS, regardless of the
> condition. so empty strings still result in an error.
> this is inexplicable.
> iif(<condition>,<truepart>,<falsepart>) replaces:
> if <condition> then
> <truepart>
> else
> <falsepart>
> end if
> why are all 3 being evaluated?
> so, half an hour later, i have no solution.
> simple need: i want to display a phone number properly formatted if one
> exists, and nothing if it doesn't.
> please help!
> dushan bilbija
>

Friday, February 24, 2012

Free CR w/VS6 Enterprise

The folder info is:

Crystal Reports is shipped and installed as part of
the VB installation package except in VB6. This can
be found in \common\tools\crysrep
double click on crystl32.exe to install.Just be aware of the License Agreement (http://msdn2.microsoft.com/en-us/library/aa288179(vs.71).aspx)

4.2 You may not use the Software or a Server/Web Application on a rental or timesharing basis or to operate a service bureau facility for the benefit of third-parties unless you first acquire an Application Service Provider License from Crystal Decisions. The Runtime Software may be installed on only one server in each Server Environment, and only one instance of the Runtime Software per Server/Web Application may be utilized on that Server at any one time.

4.3 This license agreement does not in itself give you any right to distribute Server/Web Applications to third parties.

There are other restrictions (see the link), but these are the two that most often come into play.|||oddly enough, I couldn't find it in the Tools folder.

Seems to me that I installed it on the old machine, but never used it.