Showing posts with label dynamic. Show all posts
Showing posts with label dynamic. Show all posts

Friday, March 9, 2012

defining background color in matrix

Hi All
In my report there is a dynamic matrix.
two section inside the data region need to be paint in two different
color.
i defined an Expression in the background properties.
the Expression define two ranges(four cordinates) in order to paint one
section
and more two ranges for the other section.
the problem occour while examine the data come from the DB. in those
junction
that there was no data involve the cell was'nt paint although it is in
the
range
of the painting.
i try to solve this by using the " is nothing" function but without any
successes.
one solution i had which is works was declaring temporary table int he
procedure ,addind rows to the temporary table plus the data it self
while
running
and then in the report to blank those cells by filter them.it work's
paint
those cells but damage the subtotal line(because new rows were adding
to the
table source).
if any knows how to solve this conflic i will very much appreciate
this.
thanks in advanced
Amir KrugliakHi
If this is reporting services then you may be better off posting to the
microsoft.public.sqlserver.reportingsvcs newsgroup.
John
"amir.krugliak@.gmail.com" wrote:

> Hi All
> In my report there is a dynamic matrix.
> two section inside the data region need to be paint in two different
> color.
> i defined an Expression in the background properties.
> the Expression define two ranges(four cordinates) in order to paint one
> section
> and more two ranges for the other section.
> the problem occour while examine the data come from the DB. in those
> junction
> that there was no data involve the cell was'nt paint although it is in
> the
> range
> of the painting.
> i try to solve this by using the " is nothing" function but without any
> successes.
> one solution i had which is works was declaring temporary table int he
> procedure ,addind rows to the temporary table plus the data it self
> while
> running
> and then in the report to blank those cells by filter them.it work's
> paint
> those cells but damage the subtotal line(because new rows were adding
> to the
> table source).
> if any knows how to solve this conflic i will very much appreciate
> this.
> thanks in advanced
> Amir Krugliak
>

Saturday, February 25, 2012

Default_Member

How can I make a default_member dynamic.

Somethin like this:

ALTERCUBECURRENTCUBE

UPDATEDIMENSION [Time],

DEFAULT_MEMBER=[Time].[By Year].[Year].&[ + datepart("YYYY",now()) + ];

Thanks in advance

Using a Default Member other than the ALL member may introduce confusion in your results. Still, if this is required, I wouldn't try to determine it dynamically for something like a year which will change relatively infrequently.

You can use AMO to change a dimension's default member programattically. Before you process your dimension, calculate the desired default member, compare it to the current default member, and then change it if necessary. I'm not certain if in doing this you invalidate the dimension's data. If so, you would need to reprocess the dimension and any relating measure groups.

Good luck,
Bryan

Friday, February 24, 2012

Default Value?

Hi, I'm creating a dynamic group of values using SELECT and UNION

Example:
(SELECT Description = 'Changed PhoneNumber from ' + @.old_PhoneNumber + ' to ' + @.PhoneNumber
WHERE @.PhoneNumber <> @.old_PhoneNumber UNION ALL

SELECT Description = 'Changed FaxNumber from ' + @.old_FaxNumber + ' to ' + @.FaxNumber
WHERE @.FaxNumber <> @.old_FaxNumber UNION ALL

SELECT Description = 'Changed EmailAddress from ' + @.old_EmailAddress + ' to ' + @.EmailAddress
WHERE @.EmailAddress <> @.old_EmailAddress)

The problem here is that SQL Server thinks "Description" is an int (by default probably) and gives me an error when I try to assign a string to it.

I'm taking that information and using it as a field in a INSERT INTO ... SELECT statement, so I don't think I am able to use a DECLARE statement or if that would even work.

Does anyone know how I can make it so that Description is always a varchar?

Maybe?

SELECT 'Changed PhoneNumber from ' + @.old_PhoneNumber + ' to ' + @.PhoneNumber AS Description

You could also do this:

SELECT CAST('Changed PhoneNumber from ' + @.old_PhoneNumber + ' to ' + @.PhoneNumber AS varchar) AS Description

OR:

SELECT 'Changed PhoneNumber from ' + CAST(@.old_PhoneNumber AS varchar) + ' to ' + cast(@.PhoneNumber AS varchar) AS Description

|||

The third option worked, but I only needed to do it with the Integers. Since there were integers in the string SQL Server tried to convert the entire string into an integer across every SELECT command in the union.

So since I had an integer many SELECTs down it was telling me "can't convert name to integer" even though there was no integer in sight of that particular SELECT statement. Pretty confusing if you ask me.