Showing posts with label converted. Show all posts
Showing posts with label converted. Show all posts

Thursday, March 29, 2012

formula question

I have this crystal formula

How can this be converted to a reporting services Expression

if {ITEMCODE} in ["A","B"]

then "TypeA"

else if

{ITEMCODE} in ["C","D"]

then "TypeB"

else

"TypeC"

Use this:

=iif((Fields!ITEMCODE.Value = "A" OR Fields!ITEMCODE.Value = "B") ,"TypeA",IIF((Fields!ITEMCODE.Value = "C" OR Fields!ITEMCODE.Value = "D"),"TypeB","TypeC"))

Hope this will work.

Regards,

Manoj Verma

|||

Hi Manoj

Is this the only way.

one of my formulas may have to have upto 100 or's?

Thanks for your help

|||

I don't think you may have any other option or if it is there then i'm not able to figure out.

Sorry....

Regards

Manoj Verma

|||

Thanks for your help Manoj

I will have to group them another way using another table!

Friday, March 23, 2012

Formatting numbers with commas in TSQL

Once I've converted my floats to chars using STR, is there an easy way
to put commas in separating the thousands.

i.e. convert
53000000.12
to
53,000,000.12

I'm thinking I'll have to do it with a user defined function and the
various string functions myself but was wondering if anyone had an
easier way?

Cheers
Dave"David Sharp" <dave@.daveandcaz.freeserve.co.uk> wrote in message
news:ca434844.0312150306.34760a0@.posting.google.co m...
> Once I've converted my floats to chars using STR, is there an easy way
> to put commas in separating the thousands.
> i.e. convert
> 53000000.12
> to
> 53,000,000.12
> I'm thinking I'll have to do it with a user defined function and the
> various string functions myself but was wondering if anyone had an
> easier way?

Yes, do it at your presentation layer, not at the DB layer.

> Cheers
> Dave|||Hi Dave

You shouldnt really do any formatting of numbers in the database. It
should be done on the client.

Sam

dave@.daveandcaz.freeserve.co.uk (David Sharp) wrote in message news:<ca434844.0312150306.34760a0@.posting.google.com>...
> Once I've converted my floats to chars using STR, is there an easy way
> to put commas in separating the thousands.
> i.e. convert
> 53000000.12
> to
> 53,000,000.12
> I'm thinking I'll have to do it with a user defined function and the
> various string functions myself but was wondering if anyone had an
> easier way?
> Cheers
> Dave|||dave@.daveandcaz.freeserve.co.uk (David Sharp) wrote in message news:<ca434844.0312150306.34760a0@.posting.google.com>...
> Once I've converted my floats to chars using STR, is there an easy way
> to put commas in separating the thousands.
> i.e. convert
> 53000000.12
> to
> 53,000,000.12
> I'm thinking I'll have to do it with a user defined function and the
> various string functions myself but was wondering if anyone had an
> easier way?
> Cheers
> Dave

You could do this TSQL by creating your own functions, but you should
probably do it in the front end application instead, if possible. The
format above is incorrect in Spain and Germany, for example - a client
application can retrieve locale information and format the output
accordingly much more easily than doing it on the server side.

Simon|||"David Sharp" <dave@.daveandcaz.freeserve.co.uk> wrote in message
news:ca434844.0312150306.34760a0@.posting.google.co m...
> Once I've converted my floats to chars using STR, is there an easy way
> to put commas in separating the thousands.
> i.e. convert
> 53000000.12
> to
> 53,000,000.12
> I'm thinking I'll have to do it with a user defined function and the
> various string functions myself but was wondering if anyone had an
> easier way?

IMHO, this is a job for the Presentation Layer/GUI. I wouldn't store commas,
or format the numbers for me. I'd rather handle this on the client side so I
am not storing needless data (, and .) in the database, and so I can format
the data properly according to regional setting on the client side.

--
BV.
WebPorgmaster - www.IHeartMyPond.com
Work at Home, Save the Environment - www.amothersdream.com|||> Once I've converted my floats to chars using STR, is there an easy way
> to put commas in separating the thousands.
> i.e. convert
> 53000000.12
> to
> 53,000,000.12
> I'm thinking I'll have to do it with a user defined function and the
> various string functions myself but was wondering if anyone had an
> easier way?
> Cheers
> Dave
Hi Dave,

If you really want to do it in TSQL. Cast as Money. Then convert
using style 1. "convert(varchar,cast(myVar as money),1)" - Louis|||Thanks to everyone who replied and of course who are absolutely
correct that this sort of data formatting should be done in a
presentation layer rather than the db.

Unfortunately in this specific case, the text is being generated to
annotate a simple calculation performed in a stored proc called by a
trigger and so doesn't have a presentation layer in which to do the
formatting.

Thanks Louis for highlighting a possible solution.

louisducnguyen@.hotmail.com (louis nguyen) wrote in message news:<b0e9d53.0312151608.7c1f93f2@.posting.google.com>...
> If you really want to do it in TSQL. Cast as Money. Then convert
> using style 1. "convert(varchar,cast(myVar as money),1)" - Louissql

Wednesday, March 7, 2012

format print range when converted to Excel?

I have a report that the user can print right from the RS site on three pages (each page one page wide). However, when I have the server email the report as an attachment in Excel; Excel tries to print it on four pages with one of the pages spilling over into the fourth page.

How can I get Excel to format the print version just as I have on the RS site?

I have had the same problem. It almost seems that anything that I export to excel looks like it grows when it is printed in excel. I posted a question referring to that and never got an answer.|||

Anyone else?

Is there a way to format the report to print at 80% in Excel without the user having to make the change in Excel?

|||

KimberlyL wrote:

I have had the same problem. It almost seems that anything that I export to excel looks like it grows when it is printed in excel. I posted a question referring to that and never got an answer.

I also have this problem. I have tried to minimize tables, move around objects, etc. but nothing works. The report looks good in direct print and export to other formats but when it comes to print from the exported excel report it is always to wide.

Has anyone got a solution or work around for this problem?

Thanks

/Mats

|||

I hope that Microsoft can fix this in a future release. I get many complaints about this. My users want to print from Excel without intervention and I cannot find a work around for this.

format print range when converted to Excel?

I have a report that the user can print right from the RS site on three pages (each page one page wide). However, when I have the server email the report as an attachment in Excel; Excel tries to print it on four pages with one of the pages spilling over into the fourth page.

How can I get Excel to format the print version just as I have on the RS site?

I have had the same problem. It almost seems that anything that I export to excel looks like it grows when it is printed in excel. I posted a question referring to that and never got an answer.|||

Anyone else?

Is there a way to format the report to print at 80% in Excel without the user having to make the change in Excel?

|||

KimberlyL wrote:

I have had the same problem. It almost seems that anything that I export to excel looks like it grows when it is printed in excel. I posted a question referring to that and never got an answer.

I also have this problem. I have tried to minimize tables, move around objects, etc. but nothing works. The report looks good in direct print and export to other formats but when it comes to print from the exported excel report it is always to wide.

Has anyone got a solution or work around for this problem?

Thanks

/Mats

|||

I hope that Microsoft can fix this in a future release. I get many complaints about this. My users want to print from Excel without intervention and I cannot find a work around for this.

format print range when converted to Excel?

I have a report that the user can print right from the RS site on three pages (each page one page wide). However, when I have the server email the report as an attachment in Excel; Excel tries to print it on four pages with one of the pages spilling over into the fourth page.

How can I get Excel to format the print version just as I have on the RS site?

I have had the same problem. It almost seems that anything that I export to excel looks like it grows when it is printed in excel. I posted a question referring to that and never got an answer.|||

Anyone else?

Is there a way to format the report to print at 80% in Excel without the user having to make the change in Excel?

|||

KimberlyL wrote:

I have had the same problem. It almost seems that anything that I export to excel looks like it grows when it is printed in excel. I posted a question referring to that and never got an answer.

I also have this problem. I have tried to minimize tables, move around objects, etc. but nothing works. The report looks good in direct print and export to other formats but when it comes to print from the exported excel report it is always to wide.

Has anyone got a solution or work around for this problem?

Thanks

/Mats

|||

I hope that Microsoft can fix this in a future release. I get many complaints about this. My users want to print from Excel without intervention and I cannot find a work around for this.

|||You can report the same in connect site by referring to Http://connect.microsoft.com.
FYI