Showing posts with label word. Show all posts
Showing posts with label word. Show all posts

Friday, March 9, 2012

Expression to get the last word of the fields

Hi,

How do i get the last word of a field in an expression?

Thanks

MosheDeutsch wrote:

Hi,

How do i get the last word of a field in an expression?

Thanks

Its a string manipulation problem right? There are lots of string functions available to you in the expression language. Check them out in the top right hand corner of the expression editor.

-Jamie

|||

I am aware of all the string functions available in the expression editor, how would I last word of a field using the functions available?

Thanks

|||Well, with Perl this would be easy!

But for your issue, what defines a "word"? How many words are there in the field? Is the number of words in a field consistent across all rows? What if the field only has one "word"? Etc... Show us some data.|||

Its not consistent across all rows, a word is delimited by a space, will always have more then one word, I am sure its possible to do it with code but I would like to now how I can do it with the expression builder

Thanks

|||You'd probably be better off trying this in a script component.|||

I was trying to eliminate script, i am not so familiar with script, but it that’s the only way I will need a sample please

Thanks

|||Add a script component to your dataflow... Add an Output Column, LastWord, of type string. Make sure that the field you are working on is selected as an input to the script component.

Then, here's your script... Note the "your-field-here" location, which represents the input field name that you are trying to get the last word of.

Imports System
Imports System.Data
Imports System.Math
Imports System.Text.RegularExpressions
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper

Public Class ScriptMain
Inherits UserComponent

Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim WordArray As Array
Dim RegExprObj As Regex
Dim ArrayLength As Integer

RegExprObj = New Regex(" ")
WordArray = RegExprObj.Split(row.your-field-here)
ArrayLength = WordArray.Length
Row.LastWord = WordArray.GetValue(ArrayLength - 1).ToString
End Sub

End Class|||As an aside, I didn't know how to do this prior to you asking your question. Using Google was a big help, by the way. Search for "vb.net regular expressions" and go from there.

I don't guarantee that this is the best way to solve your problem, but it works with my test data.

You might also want to be sure that your field is trimmed before coming into this script component.|||

Thanks so much, I will try it

|||

MosheDeutsch wrote:

I am aware of all the string functions available in the expression editor, how would I last word of a field using the functions available?

Thanks

Have you actually attempted this or do you just want someone else to do your work for you?

A combination of FINDSTRING, SUBSTRING and REVERSE should be able to do it for you.

This worked for me (where [Column] is the name of a column with a sentance in it):

REVERSE(SUBSTRING(REVERSE([Column]),1,FINDSTRING(REVERSE([Column])," ",1)))

I'll stick a demo package up on my blog as well. Look in about an hour.

-Jamie

|||

Jamie Thomson wrote:

Have you actually attempted this or do you just want someone else to do your work for you?

A combination of FINDSTRING, SUBSTRING and REVERSE should be able to do it for you.

This worked for me (where [Column] is the name of a column with a sentance in it):

REVERSE(SUBSTRING(REVERSE([Column]),1,FINDSTRING(REVERSE([Column])," ",1)))

I'll stick a demo package up on my blog as well. Look in about an hour.

-Jamie

More than one way to solve the problem... Let your testing be the judge of what's correct for you.|||

Yes I did try different ways to do it with a combination of FINDSTRING, SUBSTRING and LEN I never used the REVERSE now I will for sure know the different ways how to use it and how powerful it is.

Thanks for every one

|||

Phil Brammer wrote:


More than one way to solve the problem... Let your testing be the judge of what's correct for you.

Amen to that.

There's usually more than one way to solve a problem in SSIS.

-Jamie

|||

Here's the demo:

Extract last word from a sentance
(http://blogs.conchango.com/jamiethomson/archive/2006/11/22/SSIS_3A00_-Extract-last-word-from-a-sentance.aspx)

-Jamie

Wednesday, March 7, 2012

expression

In RS, is it possible to code an expression so that if a field contains the
word "STAT" that whole row is highlighted in another color? If not, how about
a that field?
I can do it with numeric values, not text.
Thanks.On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> In RS, is it possible to code an expression so that if a field contains the
> word "STAT" that whole row is highlighted in another color? If not, how about
> a that field?
> I can do it with numeric values, not text.
> Thanks.
In Layout view, select the field that you want to change the
background color for and select F4 (for the Properties window). To the
right of Background Color, select <Expression...> and enter an
expression similar to the following:
=iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
Hope this helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||That worked. I ad the syntax wrong. Thanks!
"EMartinez" wrote:
> On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> > In RS, is it possible to code an expression so that if a field contains the
> > word "STAT" that whole row is highlighted in another color? If not, how about
> > a that field?
> >
> > I can do it with numeric values, not text.
> >
> > Thanks.
>
> In Layout view, select the field that you want to change the
> background color for and select F4 (for the Properties window). To the
> right of Background Color, select <Expression...> and enter an
> expression similar to the following:
> =iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
> Hope this helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant
>|||On May 24, 9:12 pm, brian <b...@.discussions.microsoft.com> wrote:
> That worked. I ad the syntax wrong. Thanks!
> "EMartinez" wrote:
> > On May 24, 2:46 pm, brian <b...@.discussions.microsoft.com> wrote:
> > > In RS, is it possible to code an expression so that if a field contains the
> > > word "STAT" that whole row is highlighted in another color? If not, how about
> > > a that field?
> > > I can do it with numeric values, not text.
> > > Thanks.
> > In Layout view, select the field that you want to change the
> > background color for and select F4 (for the Properties window). To the
> > right of Background Color, select <Expression...> and enter an
> > expression similar to the following:
> > =iif(Fields!FieldName.Value Like "*STAT*", "Orange", "White")
> > Hope this helps.
> > Regards,
> > Enrique Martinez
> > Sr. Software Consultant
You're welcome. Glad I could be of assistance.
Regards,
Enrique Martinez
Sr. Software Consultant

Friday, February 24, 2012

Exporting to word or RTF

Is there a way to export to word or at least RTF format?
I was using another reporting tool which can export to RTF, so my clients
are used to export their reports to RTF and they want to keep that feature
but i havent been able to find a way for them to do it.Microsoft doesn't have an RTF or Word renderer in the current release (but
there may be other companies selling their own Reporting Services renderers
that might provide one).
--
This post is provided 'AS IS' with no warranties, and confers no rights. All
rights reserved. Some assembly required. Batteries not included. Your
mileage may vary. Objects in mirror may be closer than they appear. No user
serviceable parts inside. Opening cover voids warranty. Keep out of reach of
children under 3.
"Rodrigo Sánchez" <rodrigoss@.netshoreprogramming.com> wrote in message
news:O1fVF6FkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> Is there a way to export to word or at least RTF format?
> I was using another reporting tool which can export to RTF, so my clients
> are used to export their reports to RTF and they want to keep that feature
> but i havent been able to find a way for them to do it.
>|||Do you know of a company selling that kind of extension?
Its really difficult to undestand why didnt microsoft included an export to
word filter to my costumers
"Chris Hays [MSFT]" <chays@.online.microsoft.com> escribió en el mensaje
news:eoTkfbGkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> Microsoft doesn't have an RTF or Word renderer in the current release (but
> there may be other companies selling their own Reporting Services
renderers
> that might provide one).
> --
> This post is provided 'AS IS' with no warranties, and confers no rights.
All
> rights reserved. Some assembly required. Batteries not included. Your
> mileage may vary. Objects in mirror may be closer than they appear. No
user
> serviceable parts inside. Opening cover voids warranty. Keep out of reach
of
> children under 3.
> "Rodrigo Sánchez" <rodrigoss@.netshoreprogramming.com> wrote in message
> news:O1fVF6FkEHA.3160@.TK2MSFTNGP10.phx.gbl...
> > Is there a way to export to word or at least RTF format?
> > I was using another reporting tool which can export to RTF, so my
clients
> > are used to export their reports to RTF and they want to keep that
feature
> > but i havent been able to find a way for them to do it.
> >
> >
>|||I am new to Reporting Services and have not actually started to use it yet, since I have a similar requirement in that I need to include RTF reporting. We currently allow storing of data in RTF into our sql database. Our current reports are developed using MsAccess, with an added ocx control, FMS Access Memo Control, to allow for reporting of RTF data. It seems to me that the current version of Reporting Services does NOT allow for reporting of RTF or to RTF. Hopefully the next version will be better,
good luck, and if you can offer any advice/suggestions that you have come across, it would be appreciated.
Sandra
>--Original Message--
>Do you know of a company selling that kind of extension?
>Its really difficult to undestand why didnt microsoft included an export to
>word filter to my costumers
>"Chris Hays [MSFT]" <chays@.online.microsoft.com> escribi=F3 en el mensaje
>news:eoTkfbGkEHA.3160@.TK2MSFTNGP10.phx.gbl...
>> Microsoft doesn't have an RTF or Word renderer in the current release (but
>> there may be other companies selling their own Reporting Services
>renderers
>> that might provide one).
>> -- >> This post is provided 'AS IS' with no warranties, and confers no rights.
>All
>> rights reserved. Some assembly required. Batteries not included. Your
>> mileage may vary. Objects in mirror may be closer than they appear. No
>user
>> serviceable parts inside. Opening cover voids warranty. Keep out of reach
>of
>> children under 3.
>> "Rodrigo S=E1nchez" <rodrigoss@.netshoreprogramming.com> wrote in message
>> news:O1fVF6FkEHA.3160@.TK2MSFTNGP10.phx.gbl...
>> > Is there a way to export to word or at least RTF format?
>> > I was using another reporting tool which can export to RTF, so my
>clients
>> > are used to export their reports to RTF and they want to keep that
>feature
>> > but i havent been able to find a way for them to do it.
>> >
>> >
>>
>
>.
>

Exporting to word

Hi,

I'm using Crystal Reports in Microsoft Visual C# .NET version 1.1.

I've never used Crystal reports before, so I'm just finding my way around. I have created a very simply report embedded in a windows form which just displays a few columns from a database table.

My problem is this: When I click the "export" button I just get an egg timer.

I gather that there may be some dll's requirered for the exporting functionality to work. Could this be the problem? If so, where do I get then from? Or do I have to implement some code myself which will enable the export dialog to appear?

many thanks for any help offered.

update: I've just tried the exe on someone elses machine and it worked ok, so I think this is a problem with my .NET installation.http://support.businessobjects.com/library/kbase/articles/c2010787.asp



Hi,

I'm using Crystal Reports in Microsoft Visual C# .NET version 1.1.

I've never used Crystal reports before, so I'm just finding my way around. I have created a very simply report embedded in a windows form which just displays a few columns from a database table.

My problem is this: When I click the "export" button I just get an egg timer.

I gather that there may be some dll's requirered for the exporting functionality to work. Could this be the problem? If so, where do I get then from? Or do I have to implement some code myself which will enable the export dialog to appear?

many thanks for any help offered.

update: I've just tried the exe on someone elses machine and it worked ok, so I think this is a problem with my .NET installation.|||http://support.businessobjects.com/library/kbase/articles/c2010787.asp

Many thanks for the reply, but that isn't my problem.

When I click the "export" button I just get an egg timer. I am not trying to export a TIF, and I don't get any error message.