Hi all, i have a question, i'm making a report in visual studio, where
i have a textbox which i fill with a value from a database and i wanna
know how you can change certain strings withing the filled value...
example:
This is the expression for the textbox:
=First(Fields!MyFieldName.Value, "Parametri")
=Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
So, the thing is, i've filled my textbox with a value from a database,
which is in my case, the value is a simple sentence...which has a word
'date' in it...so my question is how can i search that value
(sentence) and find the word "date" and replace it with something, for
example, today's date..?
That means if my textbox value is "bla bla bla date bla bla bla", i
wanna be able to change the word "date" to today's date or any other
word...so that in the report preview instead of "date" it says today's
date...
THANX!On Jun 28, 4:23 am, ApeX <mmo...@.gmail.com> wrote:
> Hi all, i have a question, i'm making a report in visual studio, where
> i have a textbox which i fill with a value from a database and i wanna
> know how you can change certain strings withing the filled value...
> example:
> This is the expression for the textbox:
> =First(Fields!MyFieldName.Value, "Parametri")
> =Replace(Fields!MyFieldName.Value.ToString(), "date", "current date")
> So, the thing is, i've filled my textbox with a value from a database,
> which is in my case, the value is a simple sentence...which has a word
> 'date' in it...so my question is how can i search that value
> (sentence) and find the word "date" and replace it with something, for
> example, today's date..?
> That means if my textbox value is "bla bla bla date bla bla bla", i
> wanna be able to change the word "date" to today's date or any other
> word...so that in the report preview instead of "date" it says today's
> date...
> THANX!
What you have is pretty close to correct. You should be able to use
something like this:
=Replace(CStr(Fields!MyFieldName.Value), "date", "current date") -or-
if you want the actual date time, you could use:
=Replace(CStr(Fields!MyFieldName.Value), "date", CStr(Now()))
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment