Showing posts with label zero. Show all posts
Showing posts with label zero. Show all posts

Friday, March 30, 2012

How can I conserve the initial zero when convert numeric to string using STR()

Sorry to raise a stupid question but I tried many methods which did
work.
how can I conserve the initial zero when I try to convert STR(06) into
string in SQL statment?
It always gives me 6 instead of 06.

Thanks a lot.You can't "preserve" the zero. Integer 06 = Integer 6 = Integer
00000000006.

If you want to convert an integer to a varchar you can prepend a 0 character
to the result:

SELECT '0' + CAST(06 AS VARCHAR)

Returns '06'. The downside to this method is that if you do something like

SELECT '0' + CAST(10 AS VARCHAR)

You'll end up with '010' which may or may not be what you want. You can
build on this example with the SUBSTRING function to get exactly what you
really want out of it.

<angellian@.gmail.com> wrote in message
news:1148779910.070643.296910@.g10g2000cwb.googlegr oups.com...
> Sorry to raise a stupid question but I tried many methods which did
> work.
> how can I conserve the initial zero when I try to convert STR(06) into
> string in SQL statment?
> It always gives me 6 instead of 06.
> Thanks a lot.|||You are confusing the PHYSICAL display with the internal LOGICAL model.

This is SQL and not COBOL. There is no initial zero in a number; there
is an internal binary, BCD or whatever the hard uses representation.

Your next problem is that you do not understand that dispaly is NEVER
done in the database, but in the front end application. That is the
most basic concept of *any* tiered architecture, not just SQL.|||--CELKO-- (jcelko212@.earthlink.net) writes:
> Your next problem is that you do not understand that dispaly is NEVER
> done in the database, but in the front end application. That is the
> most basic concept of *any* tiered architecture, not just SQL.

Working so long as you have done in the database trade should have learnt
you to never say never.

There is at least one obvious case where formatting of output must be
done in SQL: to wit when the display is done in a standard query tool
like Query Analyzer. Which typically is the case for admin stuff.

--
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|||> This is SQL and not COBOL. There is no initial zero in a number; there
> is an internal binary, BCD or whatever the hard uses representation.

This is SQL SERVER not SQL and not COBOL, SQL SERVER has many facilities to
aid the developer in creating a highly scalable, robust and maintainable
architecture.

Standard SQL is very weak in terms of features that we need out in the real
world.

> Your next problem is that you do not understand that dispaly is NEVER
> done in the database, but in the front end application. That is the
> most basic concept of *any* tiered architecture, not just SQL.

"Display" can never be done in the database because the database is a
service and has such has no UI, we use tools to get at the data.

The big problem here is your continued misconception that ALL formatting
should be done in the front end application, have you actually sat down and
thought about what that means? The fundemental principle of tiered
architecture design and development is that formatting is done where it is
most sensible and efficient, in terms of development and support cost and in
terms of performance.

My blog entry on this covers in more detail:
http://sqlblogcasts.com/blogs/tonyr.../05/11/429.aspx

I see you use CTE, why don't you pull the results down into the application,
CTE's are a form of formatting for display purposes, as is COALESCE on the
SELECT clause, as is ORDER BY etc... Just where do you draw the line?

Anyway, you are still stuck in the mainframe model of all resources are in
the same box and that you use the VTAM protocol out to remote terminals.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials

"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1148830663.994422.182500@.y43g2000cwc.googlegr oups.com...
> You are confusing the PHYSICAL display with the internal LOGICAL model.
>
> This is SQL and not COBOL. There is no initial zero in a number; there
> is an internal binary, BCD or whatever the hard uses representation.
> Your next problem is that you do not understand that dispaly is NEVER
> done in the database, but in the front end application. That is the
> most basic concept of *any* tiered architecture, not just SQL.|||Something like this may help...Assuming your column name is COLUMN1 and
COLUMN1 has a numeric type.

select case
when COLUMN1 < 10 then '0' + cast(COLUMN1 as varchar(10))
end
when COLUMN1 > = 10 then cast(COLUMN1 as varchar(10)) end
......(rest of your statement...)

Hope this helps...|||Hi Angellian,

For 2 character string you can just use CASE...

declare @.number tinyint
set @.number = 2

select case when @.number between 0 and 9 then '0' else '' end + cast(
@.number as varchar(2) )

Otherwise, if your resultant string needs to be bigger than 2 characters do
this...

declare @.number int
declare @.string varchar(10)
declare @.size_of_fixed_string tinyint
set @.size_of_fixed_string = 10
set @.number = 40

print replicate( '0', @.size_of_fixed_string )

set @.string = left( replicate( '0', @.size_of_fixed_string ),
@.size_of_fixed_string - len( @.number ) ) + cast( @.number as varchar(10) )

print @.string

http://sqlblogcasts.com/blogs/tonyr.../05/29/765.aspx

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials

<angellian@.gmail.com> wrote in message
news:1148779910.070643.296910@.g10g2000cwb.googlegr oups.com...
> Sorry to raise a stupid question but I tried many methods which did
> work.
> how can I conserve the initial zero when I try to convert STR(06) into
> string in SQL statment?
> It always gives me 6 instead of 06.
> Thanks a lot.|||>> There is at least one obvious case where formatting of output must be done in SQL: to wit when the display is done in a standard query tool like Query Analyzer. <<

No, that formatting is done in the Query Analyzer, which is a program
and not part of SQL. Trust me, we never voted on a "standard query
tool" in ANSI X3H2.|||>> I see you use CTE, why don't you pull the results down into the application, CTE's are a form of formatting for display purposes, as is COALESCE on the SELECT clause, as is ORDER BY etc... Just where do you draw the line? <<

UNH? CTEs are virtual tables and have nothing to do with display. Do
ypou also think that VIEWs and derived tables are formatting for user
display? COALESCE is a function that works with NULLs and CAST() to
get another internal data type result.

Things like CONVERT() on dates or PRINT in T-SQL is formatting.|||Just cause I've seen a couple of examples using CASE; I use trick
similar to your second example:

SELECT RIGHT('0' +CONVERT(varchar(2), @.number), 2)

Granted, it only works on a two-digit number, but it saves typing. The
REPLICATE idea is pretty smooth, though.

Stu

Tony Rogerson wrote:
> Hi Angellian,
> For 2 character string you can just use CASE...
> declare @.number tinyint
> set @.number = 2
> select case when @.number between 0 and 9 then '0' else '' end + cast(
> @.number as varchar(2) )
> Otherwise, if your resultant string needs to be bigger than 2 characters do
> this...
> declare @.number int
> declare @.string varchar(10)
> declare @.size_of_fixed_string tinyint
> set @.size_of_fixed_string = 10
> set @.number = 40
> print replicate( '0', @.size_of_fixed_string )
> set @.string = left( replicate( '0', @.size_of_fixed_string ),
> @.size_of_fixed_string - len( @.number ) ) + cast( @.number as varchar(10) )
> print @.string
> http://sqlblogcasts.com/blogs/tonyr.../05/29/765.aspx
> --
> Tony Rogerson
> SQL Server MVP
> http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
> Server Consultant
> http://sqlserverfaq.com - free video tutorials
>
> <angellian@.gmail.com> wrote in message
> news:1148779910.070643.296910@.g10g2000cwb.googlegr oups.com...
> > Sorry to raise a stupid question but I tried many methods which did
> > work.
> > how can I conserve the initial zero when I try to convert STR(06) into
> > string in SQL statment?
> > It always gives me 6 instead of 06.
> > Thanks a lot.|||--CELKO-- wrote:
> >> I see you use CTE, why don't you pull the results down into the application, CTE's are a form of formatting for display purposes, as is COALESCE on the SELECT clause, as is ORDER BY etc... Just where do you draw the line? <<
> UNH? CTEs are virtual tables and have nothing to do with display. Do
> ypou also think that VIEWs and derived tables are formatting for user
> display? COALESCE is a function that works with NULLs and CAST() to
> get another internal data type result.
> Things like CONVERT() on dates or PRINT in T-SQL is formatting.

Hi Joe,

I didn't understand Tony's point about CTEs, but I think his point
about COALESCE stands. Surely, COALESCE is shorthand for having
formatting code at the front end like:

If Column1 is not null then
show Column1
Else if column2 is not null then
show Column2
Else if column3 is not null then
:
:
:
Else
show ColumnN
End If

Damien|||> UNH? CTEs are virtual tables and have nothing to do with display. Do
> ypou also think that VIEWs and derived tables are formatting for user
> display? COALESCE is a function that works with NULLs and CAST() to
> get another internal data type result.
> Things like CONVERT() on dates or PRINT in T-SQL is formatting.

Ok - I conceede CTEs, I was thinking about them within the scope of paging
on which you have in the past stated you would have the front end perform,
that literally means pushing a million rows over the network to the front
end.

> Things like CONVERT() on dates or PRINT in T-SQL is formatting.

The operator was trying to create a string with leading zeros which you
stated should be done in the front end.

Why on earth would you want to go to all the effort of using a 3GL / 4GL to
format the data when you can just simply do it in TSQL within the SQL Server
itself - nice and simple, nice and easy to support and maintain.

Your method relies on additional skills, the developer would need to
understand a programming language as well as SQL, that then translates into
a support and maintanence burden which costs money.

You can very easily do the formatting in the TSQL and use Integration
Services or DTS to export the data out to whatever you want - XML, XLS
etc...

Your recommendations around formatting date back to the 70's where rdbms
didn't have many facilities available for the developer other than SUM,
COUNT, MIN, MAX and AVG.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials

"--CELKO--" <jcelko212@.earthlink.net> wrote in message
news:1149114884.873451.172270@.g10g2000cwb.googlegr oups.com...
>>> I see you use CTE, why don't you pull the results down into the
>>> application, CTE's are a form of formatting for display purposes, as is
>>> COALESCE on the SELECT clause, as is ORDER BY etc... Just where do you
>>> draw the line? <<
> UNH? CTEs are virtual tables and have nothing to do with display. Do
> ypou also think that VIEWs and derived tables are formatting for user
> display? COALESCE is a function that works with NULLs and CAST() to
> get another internal data type result.
> Things like CONVERT() on dates or PRINT in T-SQL is formatting.|||>> Why on earth would you want to go to all the effort of using a 3GL / 4GL
>> to format the data when you can just simply do it in TSQL within the SQL
>> Server itself - nice and simple, nice and easy to support and maintain.

The general answer is that one would prefer to have the centralized database
as generic as possible so that it can support a variety of applications.

Having an application specific formatting at the central data source tend to
generate something called "application bias". Considering the OP's question,
given certain 5 applications requesting same data formatted in 5 different
ways, should he formulate a single generic query and do the formatting in
the application or should he create 5 different queries to support each
application? How about when the number of applications increases to 50? Or
say 500?

While it may appear to be efficient and easy to manage in the short term, it
can often be highly detrimental to the long term stability and management of
data centric systems.

This is nothing new but such bias is known to software engineers for decades
now. For details on why this separation of concern is important for data
oriented systems, ~Principles of Program Design~ by Michael Jackson is a
good book.

--
Anith|||--CELKO-- (jcelko212@.earthlink.net) writes:
>>> There is at least one obvious case where formatting of output must be
done in SQL: to wit when the display is done in a standard query tool like
Query Analyzer. <<
> No, that formatting is done in the Query Analyzer,

QA only has a standard formatting, with no options to specify a how a
certainly column should look like.

Thus, if you want a certain format when you look at the data in QA, SQL
is the only place to do formatting.

> which is a program and not part of SQL. Trust me, we never voted on a
> "standard query tool" in ANSI X3H2.

I never said so. I only meant to say that it is a plain query tool,
and about every RDBMS comes with one.

--
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|||Anith Sen (anith@.bizdatasolutions.com) writes:
> The general answer is that one would prefer to have the centralized
> database as generic as possible so that it can support a variety of
> applications.

I think the Perl has the right answer to this: There is more than one
way do it!

That is, if you can do things either in the server or the in the client/
middile layer, you can pick what fits best for the situation.

--
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|||I think of it the other way round, surely the 5 applications would call 1
single query and not different queries for different applications.

SQL Server is more a service orientated architecture, well - becoming that
anyway.

So, doing things centrally in the SQL Server is better because you only need
do it once and not in 5 places in 5 different langauges requiring 6
different skill sets.

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials

"Anith Sen" <anith@.bizdatasolutions.com> wrote in message
news:e5n83p$v6r$1@.nntp.aioe.org...
>>> Why on earth would you want to go to all the effort of using a 3GL / 4GL
>>> to format the data when you can just simply do it in TSQL within the SQL
>>> Server itself - nice and simple, nice and easy to support and maintain.
> The general answer is that one would prefer to have the centralized
> database as generic as possible so that it can support a variety of
> applications.
> Having an application specific formatting at the central data source tend
> to generate something called "application bias". Considering the OP's
> question, given certain 5 applications requesting same data formatted in 5
> different ways, should he formulate a single generic query and do the
> formatting in the application or should he create 5 different queries to
> support each application? How about when the number of applications
> increases to 50? Or say 500?
> While it may appear to be efficient and easy to manage in the short term,
> it can often be highly detrimental to the long term stability and
> management of data centric systems.
> This is nothing new but such bias is known to software engineers for
> decades now. For details on why this separation of concern is important
> for data oriented systems, ~Principles of Program Design~ by Michael
> Jackson is a good book.
> --
> Anith

Wednesday, March 28, 2012

How can i check file size equal zero or not with scrip task ?

Dear all,

Could you tell me which code of vb scrip that i can check file size as follow ?

Dim FSO, Fyl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fyl = CreateObject("File")

If FSO.FileExists("C:\temp\lcbseg.log") Then
Set Fyl = FSO.GetFile("C:\temp\lcbseg.log")
If Fyl.Size > 0 Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
End If
End if

Thanks

Best regards,

Kusuma

You need to do this in two stages, since there is no workflow script anymore.

Here is a sample for nthe Script Task. It uses a variable called FileSize, into which it stores the file size, surpirse!

Public Sub Main()

Dim info As System.IO.FileInfo = New System.IO.FileInfo("C:\File.txt")

Dim variables As New Variables

Dts.VariableDispenser.LockOneForWrite("FileSize", variables)

variables(0).Value = info.Length

variables.Unlock()

Dts.TaskResult = Dts.Results.Success

End Sub

Now you would use a precedenc constraint from the sript task to the next task, but be sure to include an expression. Double-click to get the UI, and try and expression like this-

@.[Use::FileSize] > 0

|||

I've tried to follow your code DarrenSQLIS, but it has the error "FileSize" for read/write access with error 0xC0010001 "The variable cannot be found. how can i fix this problem?

So i've some questions where can i declare FileSize variable. It's on SSIS menu=> varible,isn't it? and what's type of FileSize variable. For next what's property of expresstion to use @.[Use::FileSize] > 0.

Many thanks.

Best Regards,

Kusuma

|||I know you asked how do check for a file size equal to non zero in a script task, which can certainly be done with a script task as Darren illustrates.

Another technique for checking file existence and size simultaneously is use of "WMI Data Reader Task" with WQL. Use of the WMI data reader task will require a WMI connection manager, which is quick simple to configure, and available through the task's UI.

For example, the following WQL query checks for the existence and size of c:\boot.ini. simultaneously.

Select FileSize From CIM_Datafile Where Name = 'C:\\boot.ini'

After the WMI task, a downstream task can constrained by the following expression, which evaluates to true only for an existent, non zero byte file.

@.FileLength > "0\r\n"

NOTE, in this case, @.FileLength is a string variable, unlike the script task case. The reason the variable for file size is a string rather than a uint64 is that the WMI Data Reader task writes string and/or object variable types. The backslash is a special character to WMI, and as such is doubled up (escaped) in the WQL query.|||

KUS wrote:

Dear all,

Could you tell me which code of vb scrip that i can check file size as follow ?

Dim FSO, Fyl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fyl = CreateObject("File")

If FSO.FileExists("C:\temp\lcbseg.log") Then
Set Fyl = FSO.GetFile("C:\temp\lcbseg.log")
If Fyl.Size > 0 Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
End If
End if

Thanks

Best regards,

Kusuma

|||Hey hi . Could you tell me a VB code so that I can check a file size in a folder and mail to abc@.xyz.com if the file size is less than 10MB?|||First of all read the code above, it shows you how to get the file size into a variable. Then use an SMTP Send Mail Task to send the mail. To restrict the email to only files < 10MB, add an expression on the precendence constraint between the Script Task and Mail Task, @.Var < 10000

How can i check file size equal zero or not with scrip task ?

Dear all,

Could you tell me which code of vb scrip that i can check file size as follow ?

Dim FSO, Fyl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fyl = CreateObject("File")

If FSO.FileExists("C:\temp\lcbseg.log") Then
Set Fyl = FSO.GetFile("C:\temp\lcbseg.log")
If Fyl.Size > 0 Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
End If
End if

Thanks

Best regards,

Kusuma

You need to do this in two stages, since there is no workflow script anymore.

Here is a sample for nthe Script Task. It uses a variable called FileSize, into which it stores the file size, surpirse!

Public Sub Main()

Dim info As System.IO.FileInfo = New System.IO.FileInfo("C:\File.txt")

Dim variables As New Variables

Dts.VariableDispenser.LockOneForWrite("FileSize", variables)

variables(0).Value = info.Length

variables.Unlock()

Dts.TaskResult = Dts.Results.Success

End Sub

Now you would use a precedenc constraint from the sript task to the next task, but be sure to include an expression. Double-click to get the UI, and try and expression like this-

@.[Use::FileSize] > 0

|||

I've tried to follow your code DarrenSQLIS, but it has the error "FileSize" for read/write access with error 0xC0010001 "The variable cannot be found. how can i fix this problem?

So i've some questions where can i declare FileSize variable. It's on SSIS menu=> varible,isn't it? and what's type of FileSize variable. For next what's property of expresstion to use @.[Use::FileSize] > 0.

Many thanks.

Best Regards,

Kusuma

|||I know you asked how do check for a file size equal to non zero in a script task, which can certainly be done with a script task as Darren illustrates.

Another technique for checking file existence and size simultaneously is use of "WMI Data Reader Task" with WQL. Use of the WMI data reader task will require a WMI connection manager, which is quick simple to configure, and available through the task's UI.

For example, the following WQL query checks for the existence and size of c:\boot.ini. simultaneously.

Select FileSize From CIM_Datafile Where Name = 'C:\\boot.ini'

After the WMI task, a downstream task can constrained by the following expression, which evaluates to true only for an existent, non zero byte file.

@.FileLength > "0\r\n"

NOTE, in this case, @.FileLength is a string variable, unlike the script task case. The reason the variable for file size is a string rather than a uint64 is that the WMI Data Reader task writes string and/or object variable types. The backslash is a special character to WMI, and as such is doubled up (escaped) in the WQL query.
|||

KUS wrote:

Dear all,

Could you tell me which code of vb scrip that i can check file size as follow ?

Dim FSO, Fyl
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Fyl = CreateObject("File")

If FSO.FileExists("C:\temp\lcbseg.log") Then
Set Fyl = FSO.GetFile("C:\temp\lcbseg.log")
If Fyl.Size > 0 Then
Main = DTSStepScriptResult_ExecuteTask
Else
Main = DTSStepScriptResult_DontExecuteTask
End If
End if

Thanks

Best regards,

Kusuma

|||Hey hi . Could you tell me a VB code so that I can check a file size in a folder and mail to abc@.xyz.com if the file size is less than 10MB?|||First of all read the code above, it shows you how to get the file size into a variable. Then use an SMTP Send Mail Task to send the mail. To restrict the email to only files < 10MB, add an expression on the precendence constraint between the Script Task and Mail Task, @.Var < 10000

Monday, March 19, 2012

How can change the visibillity of a Chart Data Field?

Hi,
is it possible to toggle the visibillity of a char data item? Because if the
value is zero or null i dont want the column in the chart to be displayed.
Thanks alot
FlorianIf a datapoint value is null, it won't be displayed in the chart.
If you want to explicitly hide datapoint with other values (e.g. y-value =0), you can use an expression for the datapoint value similar to this to
replace the value with null (Nothing in VB): =iif(Fields!Y.Value = 0,
Nothing, Fields!Y.Value)
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Florian Kirchlechner" <Florian Kirchlechner@.discussions.microsoft.com>
wrote in message news:31A10DB1-6A82-4AE8-AF21-A4658087ADB5@.microsoft.com...
> Hi,
> is it possible to toggle the visibillity of a char data item? Because if
> the
> value is zero or null i dont want the column in the chart to be displayed.
> Thanks alot
> Florian|||Hi Robert,
thx for the reply - it really helped me :-)
But one more thing - can i hide the series label too? I tried it with your
suggestions but it didnt work.
Thanks and greets /Flo
"Robert Bruckner [MSFT]" wrote:
> If a datapoint value is null, it won't be displayed in the chart.
> If you want to explicitly hide datapoint with other values (e.g. y-value => 0), you can use an expression for the datapoint value similar to this to
> replace the value with null (Nothing in VB): =iif(Fields!Y.Value = 0,
> Nothing, Fields!Y.Value)
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Florian Kirchlechner" <Florian Kirchlechner@.discussions.microsoft.com>
> wrote in message news:31A10DB1-6A82-4AE8-AF21-A4658087ADB5@.microsoft.com...
> > Hi,
> >
> > is it possible to toggle the visibillity of a char data item? Because if
> > the
> > value is zero or null i dont want the column in the chart to be displayed.
> >
> > Thanks alot
> > Florian
>
>|||No, you cannot dynamically hide series labels. Did you look into adding a
filter on the dataset or the chart or the series grouping to filter out all
data points with values you don't want to show in the chart?
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Florian Kirchlechner" <FlorianKirchlechner@.discussions.microsoft.com> wrote
in message news:BA66D7C0-D108-4BF0-9474-D5DD2FADF994@.microsoft.com...
> Hi Robert,
> thx for the reply - it really helped me :-)
> But one more thing - can i hide the series label too? I tried it with
> your
> suggestions but it didnt work.
> Thanks and greets /Flo
> "Robert Bruckner [MSFT]" wrote:
>> If a datapoint value is null, it won't be displayed in the chart.
>> If you want to explicitly hide datapoint with other values (e.g. y-value
>> =>> 0), you can use an expression for the datapoint value similar to this to
>> replace the value with null (Nothing in VB): =iif(Fields!Y.Value = 0,
>> Nothing, Fields!Y.Value)
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> "Florian Kirchlechner" <Florian Kirchlechner@.discussions.microsoft.com>
>> wrote in message
>> news:31A10DB1-6A82-4AE8-AF21-A4658087ADB5@.microsoft.com...
>> > Hi,
>> >
>> > is it possible to toggle the visibillity of a char data item? Because
>> > if
>> > the
>> > value is zero or null i dont want the column in the chart to be
>> > displayed.
>> >
>> > Thanks alot
>> > Florian
>>|||Im looking for a method to filter the data points without a value and also to
not have their series labels displayed in the legend. Maybe i will overcome
that with manually generating the legend.
Thanks alot
Florian
"Robert Bruckner [MSFT]" wrote:
> No, you cannot dynamically hide series labels. Did you look into adding a
> filter on the dataset or the chart or the series grouping to filter out all
> data points with values you don't want to show in the chart?
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Florian Kirchlechner" <FlorianKirchlechner@.discussions.microsoft.com> wrote
> in message news:BA66D7C0-D108-4BF0-9474-D5DD2FADF994@.microsoft.com...
> > Hi Robert,
> > thx for the reply - it really helped me :-)
> > But one more thing - can i hide the series label too? I tried it with
> > your
> > suggestions but it didnt work.
> >
> > Thanks and greets /Flo
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> >> If a datapoint value is null, it won't be displayed in the chart.
> >> If you want to explicitly hide datapoint with other values (e.g. y-value
> >> => >> 0), you can use an expression for the datapoint value similar to this to
> >> replace the value with null (Nothing in VB): =iif(Fields!Y.Value = 0,
> >> Nothing, Fields!Y.Value)
> >>
> >> -- Robert
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >>
> >> "Florian Kirchlechner" <Florian Kirchlechner@.discussions.microsoft.com>
> >> wrote in message
> >> news:31A10DB1-6A82-4AE8-AF21-A4658087ADB5@.microsoft.com...
> >> > Hi,
> >> >
> >> > is it possible to toggle the visibillity of a char data item? Because
> >> > if
> >> > the
> >> > value is zero or null i dont want the column in the chart to be
> >> > displayed.
> >> >
> >> > Thanks alot
> >> > Florian
> >>
> >>
> >>
>
>|||It may be easier to filter the chart series groups, but generating a custom
legend is also possible. This blog article including a sample should get you
started: http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Florian Kirchlechner" <FlorianKirchlechner@.discussions.microsoft.com> wrote
in message news:2EC010BC-D1BA-4F57-9F92-CE0CAF37F6A9@.microsoft.com...
> Im looking for a method to filter the data points without a value and also
> to
> not have their series labels displayed in the legend. Maybe i will
> overcome
> that with manually generating the legend.
> Thanks alot
> Florian
>
> "Robert Bruckner [MSFT]" wrote:
>> No, you cannot dynamically hide series labels. Did you look into adding a
>> filter on the dataset or the chart or the series grouping to filter out
>> all
>> data points with values you don't want to show in the chart?
>> -- Robert
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> "Florian Kirchlechner" <FlorianKirchlechner@.discussions.microsoft.com>
>> wrote
>> in message news:BA66D7C0-D108-4BF0-9474-D5DD2FADF994@.microsoft.com...
>> > Hi Robert,
>> > thx for the reply - it really helped me :-)
>> > But one more thing - can i hide the series label too? I tried it with
>> > your
>> > suggestions but it didnt work.
>> >
>> > Thanks and greets /Flo
>> >
>> > "Robert Bruckner [MSFT]" wrote:
>> >
>> >> If a datapoint value is null, it won't be displayed in the chart.
>> >> If you want to explicitly hide datapoint with other values (e.g.
>> >> y-value
>> >> =>> >> 0), you can use an expression for the datapoint value similar to this
>> >> to
>> >> replace the value with null (Nothing in VB): =iif(Fields!Y.Value = 0,
>> >> Nothing, Fields!Y.Value)
>> >>
>> >> -- Robert
>> >> This posting is provided "AS IS" with no warranties, and confers no
>> >> rights.
>> >>
>> >>
>> >> "Florian Kirchlechner" <Florian
>> >> Kirchlechner@.discussions.microsoft.com>
>> >> wrote in message
>> >> news:31A10DB1-6A82-4AE8-AF21-A4658087ADB5@.microsoft.com...
>> >> > Hi,
>> >> >
>> >> > is it possible to toggle the visibillity of a char data item?
>> >> > Because
>> >> > if
>> >> > the
>> >> > value is zero or null i dont want the column in the chart to be
>> >> > displayed.
>> >> >
>> >> > Thanks alot
>> >> > Florian
>> >>
>> >>
>> >>
>>|||Since you said there is not a way to dynamically hide a label, is there a way
to always hide a series label? I have one line that should not have a label,
but if I set the label to "=Nothing", "=System.DBNULL.Value", or just leave
it blank it puts something automatic like "Series3" -- how can I remove this?
-diana
"Robert Bruckner [MSFT]" wrote:
> No, you cannot dynamically hide series labels. Did you look into adding a
> filter on the dataset or the chart or the series grouping to filter out all
> data points with values you don't want to show in the chart?
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
> "Florian Kirchlechner" <FlorianKirchlechner@.discussions.microsoft.com> wrote
> in message news:BA66D7C0-D108-4BF0-9474-D5DD2FADF994@.microsoft.com...
> > Hi Robert,
> > thx for the reply - it really helped me :-)
> > But one more thing - can i hide the series label too? I tried it with
> > your
> > suggestions but it didnt work.
> >
> > Thanks and greets /Flo
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> >> If a datapoint value is null, it won't be displayed in the chart.
> >> If you want to explicitly hide datapoint with other values (e.g. y-value
> >> => >> 0), you can use an expression for the datapoint value similar to this to
> >> replace the value with null (Nothing in VB): =iif(Fields!Y.Value = 0,
> >> Nothing, Fields!Y.Value)
> >>
> >> -- Robert
> >> This posting is provided "AS IS" with no warranties, and confers no
> >> rights.
> >>
> >>
> >> "Florian Kirchlechner" <Florian Kirchlechner@.discussions.microsoft.com>
> >> wrote in message
> >> news:31A10DB1-6A82-4AE8-AF21-A4658087ADB5@.microsoft.com...
> >> > Hi,
> >> >
> >> > is it possible to toggle the visibillity of a char data item? Because
> >> > if
> >> > the
> >> > value is zero or null i dont want the column in the chart to be
> >> > displayed.
> >> >
> >> > Thanks alot
> >> > Florian
> >>
> >>
> >>
>
>