Showing posts with label expression. Show all posts
Showing posts with label expression. Show all posts

Monday, March 19, 2012

How to set up font size and color

I would like to know how to set up the font size and color in expression
window.
Thank you!I used the following to format my table row group:
=iif( Fields!TotalType.Value ="MyValue","D0",iif(Fields!TotalType.Value
="YourValue","P0","C0"))
and this expression for the cell background color:
=iif( Fields!TotalType.Value <> "MyValue" ,"LightGrey",Nothing)
Just select the object and type the expression in the appropriate field in
the Properties window for that object. You should be able to use the same
sort of expression of the font.
"Michelle" wrote:
> I would like to know how to set up the font size and color in expression
> window.
> Thank you!|||Thank you, daw. It helps.
"daw" wrote:
> I used the following to format my table row group:
> =iif( Fields!TotalType.Value ="MyValue","D0",iif(Fields!TotalType.Value
> ="YourValue","P0","C0"))
> and this expression for the cell background color:
> =iif( Fields!TotalType.Value <> "MyValue" ,"LightGrey",Nothing)
> Just select the object and type the expression in the appropriate field in
> the Properties window for that object. You should be able to use the same
> sort of expression of the font.
> "Michelle" wrote:
> > I would like to know how to set up the font size and color in expression
> > window.
> >
> > Thank you!

Monday, March 12, 2012

how to set the autofresh parameter through expression?

if the user chooses type=a
then the autofresh is true,eg.every 10secs.It should be something like this:
=iif(Parameters!type = "a", 10, 0)
This same pattern is used to write lots of expressions for conditional
formatting for instance in the FontWeight property for a textbox cell
you can place:
=iif(Value > 0, Bold,Normal)
This will bold all values greater than 0. Notice that you don't in
this case you can reference just value, but if you you wanted to base
it off another cell you would need to do something like this:
=iif(ReportItems!Textbox1.Value > 0, Bold,Normal)
Occasionally values such as colors have to be in quotes e.g. "Black".
Others such as FontWeight have constants associated with them.
Collections that can be accessed in this way are:
ReportItems
Globals
Parameters
Fields|||thanks a lot,
how to get all the collections that can be accessed?
i mean the specific parameter? e.g the auto refesh of the report?
can you show me some sites that are helpful for beginner?|||Except for ReportItems all of the collections are enumerated when you
go into the expression editor for a cell or property. For ReportItems
just click on the item to find out its name. If it has a nonspecific
name I recommend renaming it before you reference it.
I haven't been able to find any good sites. Books on reporting services
will give you a basic overview, but I haven't found any that go beyond
that. Most of what I have learned has been hacking it out trial and
error, patient googling for references to specific topics, and digging
around Microsoft's documentation, which is fairly spartan. This news
group is really one of the best sources of information, and
unfortunately I only found it a few days ago. I access it through
google groups(there are other ways, I recommend google). Google lets
you search just this news group for information. The group has been
around a while so queries for 'expression' or 'collection' turn up lots
of hits. Search the group first before posting a question.|||i also found the google group a few days ago, my mother language is not
english,so it is a little difficult for me to express my question
clearly,i really know that what i have asked is old,but patient
googling for referernces means costing much time,unfortunately i have
little time on that project.
i really apprecaite those who help me.thanks.

Wednesday, March 7, 2012

How to set empty a space from a derived column expression?

hi,

This field comes from a flat file and sometimes own zero and sometimes own a empty position (after 'EUR'):

2006053000499236000005307700108287457080200408287452006052953990000000010000EUR
2006053000499236004414989200101423426004400501423422006052953990000000010000EUR0

[Column 12] == "0" ? [Column 12] : ?

TIA

What is the data type of [Column 12]?

-Jamie

|||

At destination?

[char](1) COLLATE Modern_Spanish_CI_AS NULL,

|||

No. In the pipeline.

If it is DT_STR then your expression will be:

[Column 12] == "0" ? [Column 12] : NULL(DT_STR,1,1252)

If it is DT_WSTR then it'll be

[Column 12] == "0" ? [Column 12] : NULL(DT_WSTR,1)

-Jamie

|||

I've got string [DT_STR] as datatype in my flat file definition and string [DT_WSTR] as datatype column on the right 'Expression' field (Derived Column)

I've allocated as you said this line:

[Column 12] == "0" ? [Column 12] : NULL(DT_WSTR,1)

And remains in black, ok but when I launch the package appears this:

Error at Camara Recibida [OLE DB Destination [9902]]: Columns "Derived Column 1_12" and "Rein" cannot convert between unicode and non-unicode string data types.

Error at Camara Recibida [DTS.Pipeline]: "component "OLE DB Destination" (9902)" failed validation and returned validation status "VS_ISBROKEN".

Error at Camara Recibida [DTS.Pipeline]: One or more component failed validation.

Error at Camara Recibida: There were errors during task validation.

|||

So you are inputting a DT_STR but outputting a DT_WSTR? Is that correct? That seems like a strange thing to do to me but of course, it is entirely up to you. If it were me I would use the same type on the output as on the input - but it is your choice.

If you want to output a DT_STR then the expression should be:

[Column 12] == "0" ? [Column 12] : NULL(DT_STR,1,1252)

If you want to output a DT_WSTR then the expression should be:

[Column 12] == "0" ? (DT_WSTR, 1)[Column 12] : NULL(DT_WSTR,1)

-Jamie

P.S. Please try and include all relevant information when posting a problem. If you are trying to do some data conversion then one of the most obvious things to state is the types of the input columns and what types you require the output to have.

|||

That's fine now.

Thanks a lot indeed for your help.