Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Thursday, March 22, 2012

Cursor and cursorless performance

Hi

I am doing the Serial Balance Report

The data is given in a range format i need to culculate the balance,for your information below is an example

Given Stock In Serial Range

10000 - 19999

Stock Out

15000 - 15999

Balance (this is what i calculate out)

10000-14999

16000 -19999

First Loop

BEGIN

--Given the Stock Out Get the Source Stock In and put it into another cursor(Normarlly just 1 record will found)

SECOND LOOP

BEGIN

--calculation

END

END

Previously Im using 2 cursor to loop and perform the calculation, due to the slow performance i change it to cursorless.

I have found that the first 1000 of 55492(2 Month) data its use almost 10 min to finish up the loop, 2000 used 30 min. The performance is decreasing, I have use up to 17 hour but still havent finish 55492 records.

Please Advice.

You are going to have to be more specific, I think, unless this exact problem reminds them of a problem they have. Can you build a small example and show how you have done it?|||


IF OBJECT_ID('tempdb..#tblBalance') IS NOT NULL
DROP Table #tblBalance

Create Table #tblBalance
(
RowID numeric(18,0) IDENTITY(1, 1) not null,
SerialNoFrom nvarchar(50),
SerialNoTo nvarchar(50))

Declare @.SerialNoFrom varchar(50)
Declare @.SerialNoTo varchar(50)
Declare @.FrontSerialNoFrom nvarchar(50)
Declare @.EndSerialNoTo nvarchar(50)
Declare @.FrontSerialNoFromNext nvarchar(50)
Declare @.EndSerialNoToNext nvarchar(50)
Declare @.SKUCode nvarchar(50)
Declare @.SLoc nvarchar(10)
Declare @.Tmp nvarchar(12)
Declare @.tmpCount integer
Declare @.sql varchar(100)

Declare @.count int
Declare @.iRow int
Declare @.countNext int
Declare @.iRowNext int

SET @.count = (SELECT MAX(RowID) FROM multicom_Qty_Minus)

SET @.iRow = 1

Print 'Total Count' + convert(varchar,@.count)
WHILE @.iRow <= @.count
BEGIN
PRINT 'Current Count ' + Convert(varchar,@.iRow)
PRINT 'GET SERIAL NO FROM'
SET @.SerialNoFrom = (SELECT SerialNoFrom FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)
PRINT 'GET SERIAL NO TO'
SET @.SerialNoTo = (SELECT SerialNoTo FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)
PRINT 'GET SLOC'
SET @.SLoc = (SELECT SLoc FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)
PRINT 'GET SKUCode'
SET @.SKUCode = (SELECT SKUCode FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)

PRINT @.SerialNoFrom + '-' + @.SerialNoTo
PRINT 'SKUCode ' + @.SKUCode
PRINT 'SLoc ' + @.SLoc

INSERT INTO #tblBalance
SELECT SerialNoFrom,SerialNoTo FROM multicom WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND
QuantityPlus > 0 AND
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) = Quantity AND
LEN(SerialNoTo) = LEN(@.SerialNoTo) AND LEN(SerialNoFrom) = LEN(@.SerialNoFrom) AND
SKUCode = @.SKUCode AND SLoc = @.SLoc AND
convert(numeric,SerialNoFrom) <> convert(numeric,@.SerialNoFrom) AND
convert(numeric,SerialNoTo)<>convert(numeric,@.SerialNoTo)AND
((CONVERT(numeric,SerialNoFrom) <= CONVERT(numeric,@.SerialNoFrom) AND
CONVERT(numeric,SerialNoTo) >= CONVERT(numeric,@.SerialNoTo)) OR
(CONVERT(numeric,SerialNoTo) >= CONVERT(numeric,@.SerialNoTo) AND
CONVERT(numeric,SerialNoFrom)<= CONVERT(numeric,@.SerialNoFrom)))

SET @.countNext = @.@.ROWCOUNT
SET @.iRowNext = 1

-IF @.countNext == 0 then put the Searil into the ErrorQtyMinus
/*
--
--
*/
IF @.CountNext = 0
BEGIN
INSERT INTO multicom_Error_Qty_Minus
SELECT Plnt,SLoc,
SLocDescription,SKUCode,MvT,PostDate,DocDate,[Serial No (from Material Doc.)],[Serial No (from Delivery Item)],
MatDoc,Item,InvNo,Quantity,Sign,Payer,UserID,PONo,SOff,DeliveryNo,PODate,SOrg,Salesman,MatGroup,DC,SoldTo,CoCd,InvoiceDt,
SerialNoTo,SerialNoFrom,SLocFrom,SLocTo,SalesOffDesc,PayerName1,PrdName,MvTDesc,StdCost,PrdGrp4,QuantityPlus,QuantityMinus
FROM multicom_Qty_Minus WHERE RowID = @.iRow
END
PRINT 'Total 2nd loop COUNT'
PRINT @.countNext
WHILE @.iRowNext <= @.countNext
BEGIN
Print 'Current 2nd loop Count ' + convert(varchar,@.iRowNext)
SET @.FrontSerialNoFrom = (SELECT SerialNoFrom From #tblBalance WHERE RowID = @.iRowNext)
SET @.EndSerialNoTo = (SELECT SerialNoTo From #tblBalance WHERE RowID = @.iRowNext)
Print @.FrontSerialNoFrom + '-' + @.EndSerialNoTo

IF ISNUMERIC(@.FrontSerialNoFrom) = 1 AND ISNUMERIC(@.EndSerialNoTo) = 1 AND ISNUMERIC(@.SerialNoFrom)=1 AND ISNUMERIC(@.SerialNoTo)= 1
BEGIN
IF CONVERT(numeric,@.SerialNoFrom) > CONVERT(numeric,@.FrontSerialNoFrom)
BEGIN
SET @.Tmp = (CONVERT(numeric,@.SerialNoFrom) -1)
SET @.Tmp = REPLICATE('0',(12 - (len(@.Tmp)))) + @.Tmp
PRINT 'BALANCE'
PRINT @.FrontSerialNoFrom + '-' + CONVERT(nvarchar(12),@.Tmp)

PRINT 'QUANTITY'
PRINT (Convert(numeric,@.Tmp) - (Convert(numeric,@.FrontSerialNoFrom)) + 1)

Insert INTO multicom_Balance
Select Plnt,SLoc,SLocDescription,SKUCode,MvT,PostDate,DocDate,MatDoc,Item,
(Convert(numeric,@.Tmp) - (Convert(numeric,@.FrontSerialNoFrom)) + 1),
Convert(nvarchar(12),@.Tmp),@.FrontSerialNoFrom,SalesOffDesc,PayerName1,PrdName,MvTDesc,StdCost,QuantityPlus,
QuantityMinus From multicom_Qty_Minus WHERE RowID = @.iRow
END

IF CONVERT(numeric,@.EndSerialNoTo) > CONVERT(numeric,@.SerialNoTo)
BEGIN
SET @.Tmp = (CONVERT(numeric,@.SerialNoTo) + 1)
SET @.Tmp = REPLICATE('0',(12 - (len(@.Tmp)))) + @.Tmp
PRINT 'Last Balance'
PRINT CONVERT(nvarchar(12),@.Tmp) + '-' + @.EndSerialNoTo

PRINT 'QUANTITY'
PRINT (Convert(numeric,@.EndSerialNoTo) - (Convert(numeric,@.Tmp)) + 1)
Insert INTO multicom_Balance
Select Plnt,SLoc,SLocDescription,SKUCode,MvT,PostDate,DocDate,MatDoc,Item,
(Convert(numeric,@.EndSerialNoTo) - (Convert(numeric,@.Tmp)) + 1),
@.EndSerialNoTo,CONVERT(nvarchar(12),@.Tmp),SalesOffDesc,PayerName1,PrdName,MvTDesc,StdCost,QuantityPlus,
QuantityMinus From multicom_Qty_Minus WHERE RowID = @.iRow
END
SET @.FrontSerialNoFrom = ''
SET @.EndSerialNoTo = ''
END
SET @.iRowNext = @.iRowNext + 1
END
Truncate Table #tblBalance
SET @.iRow = @.iRow + 1
END

I think It is my problem not SQL SERVER problem, Is there any way i can speed up the query?

|||

I don;t know what kind of logic you are using behind this query... But I am willing to say few generic comments..

Replace the following statements

SET @.SerialNoFrom = (SELECT SerialNoFrom FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)
PRINT 'GET SERIAL NO TO'
SET @.SerialNoTo = (SELECT SerialNoTo FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)
PRINT 'GET SLOC'
SET @.SLoc = (SELECT SLoc FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)
PRINT 'GET SKUCode'
SET @.SKUCode = (SELECT SKUCode FROM multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity)

with

SELECT
@.SerialNoFrom=SerialNoFrom,
@.SerialNoTo =SerialNoTo,
@.SLoc=SLoc,
@.SKUCode=SKUCode
FROM
multicom_Qty_Minus WHERE isnumeric(SerialNoTo) = 1 and isnumeric(SerialNoFrom) = 1 AND SerialNoFrom <> '' AND SerialNoTo <> '' AND RowID = @.iRow AND SKUCode <> '100000017' AND
Case when SerialNoFrom <> '' AND SerialNoFrom <> '' AND isnumeric(SerialNoTo) = 1 AND isnumeric(SerialNoFrom) = 1 then
((Convert(numeric,SerialNoTo)-Convert(numeric,SerialNoFrom))+1) END = Quantity


Replace the following statements

SET @.FrontSerialNoFrom = (SELECT SerialNoFrom From #tblBalance WHERE RowID = @.iRowNext)
SET @.EndSerialNoTo = (SELECT SerialNoTo From #tblBalance WHERE RowID = @.iRowNext)

with

SELECT @.FrontSerialNoFrom=SerialNoFrom, @.EndSerialNoTo=SerialNoTo From #tblBalance WHERE RowID = @.iRowNext

When you assing the values from the Select statement you need not to use SET statement; Advantage the same query executed more than once to fetch the value when you use SET, but the suggested query will be executed once and fetch all the required data....

|||

WOW,Thanks a lot.

Monday, March 19, 2012

Current Date help

Hello DBA's:

I have a linked server to DB2. The date field in my DB2 source files is of the format 1031222 (7 character). The 1 indicates 21th century.Year 2000 and beyond. 03 is year 2003,12 is the month, 22 is the day. Now this date is the current date. Tommorow would be 1031223.

Records are added to this file on a daily basis with the current date. Now I need to query this file on a daily basis using my linked server. An example query would be.

Select *
From DB2LinkedServer.Filename
where Date = CurrentDate.

Now How do I implement this current date. I am not sure how do I include the function getdate() and get to the CurrentDate format of my source data.

ThanksDECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate()) ),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)
+ CONVERT(char(2),DATEPART(mm,GetDate()))
+ CONVERT(char(2),DATEPART(dd,GetDate()))
SELECT @.bogusDate|||Thanks a lot. That helped.
Originally posted by Brett Kaiser

DECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate()) ),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)
+ CONVERT(char(2),DATEPART(mm,GetDate()))
+ CONVERT(char(2),DATEPART(dd,GetDate()))
SELECT @.bogusDate|||Brett,

You had sent the me this piece of code pertaining to the current date help topic.

Bretts Code:

DECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate())
),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)

+ CONVERT(char(2),DATEPART(mm,GetDate()))
+ CONVERT(char(2),DATEPART(dd,GetDate()))
SELECT @.bogusDate

When you execute the above code for month < 10 or/and day < 10 you get - 1041 7 for Jan 7,2004. I want 1040107.

So I changed the above code to -

DECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate())
),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)

+ CASE WHEN SUBSTRING(CONVERT(char(2),DATEPART(mm,GetDate())), 1,2) < 10
THEN '0'+CONVERT(char(2),DATEPART(mm,GetDate()))
ELSE CONVERT(char(2),DATEPART(mm,GetDate()))
END

+ CASE WHEN SUBSTRING(CONVERT(char(2),DATEPART(dd,GetDate())), 1,2) < '10'
THEN '0'+CONVERT(char(2),DATEPART(dd,GetDate()))
ELSE CONVERT(char(2),DATEPART(dd,GetDate()))
END
SELECT @.bogusDate

--

However the day part doesn't change. I have been able to modify the month. Can you help me fix the code.

Thanks for your help.

Vivek

Originally posted by Brett Kaiser

DECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate()) ),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)
+ CONVERT(char(2),DATEPART(mm,GetDate()))
+ CONVERT(char(2),DATEPART(dd,GetDate()))
SELECT @.bogusDate|||My Bad:

DECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate())
),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)
+ RIGHT(REPLICATE('0',2)+CONVERT(varchar(2),DATEPART (mm,GetDate())),2)
+ RIGHT(REPLICATE('0',2)+CONVERT(varchar(2),DATEPART (dd,GetDate())),2)
SELECT @.bogusDate

HAPPY NEW YEAR|||Thanks Brett. Happy New Year to you too.
Originally posted by Brett Kaiser
My Bad:

DECLARE @.bogusDate char(7)
SELECT @.bogusDate = CASE WHEN SUBSTRING(CONVERT(char(4),DATEPART(yyyy,GetDate())
),1,1) = 2 THEN '1' ELSE '0' END
+ RIGHT(CONVERT(char(4),DATEPART(yyyy,GetDate())),2)
+ RIGHT(REPLICATE('0',2)+CONVERT(varchar(2),DATEPART (mm,GetDate())),2)
+ RIGHT(REPLICATE('0',2)+CONVERT(varchar(2),DATEPART (dd,GetDate())),2)
SELECT @.bogusDate

HAPPY NEW YEAR

Current Date Format

How do I know the current Date Format of the Database?
MadhivananMadhivanan (madhivanan2001@.gmail.com) writes:
> How do I know the current Date Format of the Database?
There isn't one. The database itself does not have a date format. Dates
in SQL Server are stored as a binary value, as the number of days since
1990-01-01.
However, there is a session-specific setting for dateformat is controlled
with the command SET DATEFORMAT, and which also is affected by SET LANGUAGE
and the user's default language. This setting controls how date literals
are interpreted, nothing else. You can get this setting with help of
DBCC USEROPTIONS.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Thanks Erland
Madhivanan

Current Activity - Host Question

This is a multi-part message in MIME format.
--=_NextPart_000_0006_01C52627.EE921BE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
When looking at the Current Activity screen in EM, why is that the Host = computer is displayed in some cases & not present in others? For example, I have one generic report user, and in some cases I see the = server name they are connecting to the sql server from and in other = cases I don't. Doesn't appear to be any rhyme or reason. Is some = setting not properly set?
Any direction on helping me understand this will be appreciated.
--=_NextPart_000_0006_01C52627.EE921BE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
When looking at the = Current Activity screen in EM, why is that the Host computer is displayed in = some cases & not present in others?
For example, I = have one generic report user, and in some cases I see the server name they are = connecting to the sql server from and in other cases I don't. Doesn't appear = to be any rhyme or reason. Is some setting not properly = set?

Any direction on = helping me understand this will be appreciated.
--=_NextPart_000_0006_01C52627.EE921BE0--The setting is done from the client application (in the connection string). Perhaps the app doesn't
set it properly?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"JLS" <jlshoop@.hotmail.com> wrote in message news:%23CcqYHlJFHA.656@.TK2MSFTNGP14.phx.gbl...
When looking at the Current Activity screen in EM, why is that the Host computer is displayed in
some cases & not present in others?
For example, I have one generic report user, and in some cases I see the server name they are
connecting to the sql server from and in other cases I don't. Doesn't appear to be any rhyme or
reason. Is some setting not properly set?
Any direction on helping me understand this will be appreciated.|||This is a multi-part message in MIME format.
--=_NextPart_000_00AE_01C5262A.B5A21F30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
It depends on the client. Some client libraries and versions grab the =name field automatically. Others wait for the application to populate =it. ADO.Net does populate the machine name automatically.
-- Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"JLS" <jlshoop@.hotmail.com> wrote in message =news:%23CcqYHlJFHA.656@.TK2MSFTNGP14.phx.gbl...
When looking at the Current Activity screen in EM, why is that the =Host computer is displayed in some cases & not present in others? For example, I have one generic report user, and in some cases I see =the server name they are connecting to the sql server from and in other =cases I don't. Doesn't appear to be any rhyme or reason. Is some =setting not properly set?
Any direction on helping me understand this will be appreciated.
--=_NextPart_000_00AE_01C5262A.B5A21F30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

It depends on the client. Some =client libraries and versions grab the name field automatically. Others =wait for the application to populate it. ADO.Net does populate the machine =name automatically.
-- Geoff N. HitenMicrosoft SQL Server MVPSenior =Database AdministratorCareerbuilder.com
I support the Professional Association for SQL Serverhttp://www.sqlpass.org">www.sqlpass.org
"JLS" wrote =in message news:%23CcqYHlJFHA.6=56@.TK2MSFTNGP14.phx.gbl...
When looking at the =Current Activity screen in EM, why is that the Host computer is displayed in =some cases & not present in others?
For example, I =have one generic report user, and in some cases I see the server name they are connecting to the sql server from and in other cases I don't. =Doesn't appear to be any rhyme or reason. Is some setting not properly set?

Any direction on =helping me understand this will be =appreciated.

--=_NextPart_000_00AE_01C5262A.B5A21F30--|||Geoff & Tibor,
Thank you for this information, now I know in which direction to begin.
Thanx!

Currency Symbol Problem

I am currently writing a report in SQL 2005 RS and have a problem with the format of a currency field. I am creating the report through the 'SQL Server Business Intelligence Development Studio'

In the report preview (and live) it shows the prefix for the field to be $, and yet when I look at the custom format for the field it shows it as being Format Currency and the sample shows the output will be £1,234.00.

If I change the format to percentage or whatever it does exactly what you would expect it to do.

I have checked all the regional settings on my machine to UK in the various places you can and still it wants the result to be dollars.

Anybody, help please!!!!

Try setting the Report.Language property explicitly to en-UK.

Alternatively, set the Report.Language based on the user's language setting: =User!Language

Note: format code (such as currency) only have an impact if the textbox value is a numeric datatype and not already a string.

-- Robert

|||

I could not find the reference to which you referred, however following along the lines that you suggested I noticed that in the properties for the textbox, under 'International' there was a setting for 'Language', so I selected all of the offending boxes and changed their International properties from Default (U.S. I guess) to English (United Kingdom), and bingo, problem solved.

Thanks for pointing me in the right direction.

Regards

|||

The Report.Language is available through the VS properties window - which contains a drop down list with all items contained in the report. Select "Report" from the drop down.

The Report.Language property is a global setting for the entire report, while the Textbox.Language property will only impact that particular item.

-- Robert

Currency formatting: how to change to use another locale... or is US format hard coded?

How to I change the formatting of my currency based members according to the actual currency that they are defined in rather than the default US format? (in my case GBP).

Answers to this can be found here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=887100&SiteID=1

I got sorta the same problem..

|||

FYI: Direct link to answer:

http://sqljunkies.com/WebLog/mosha/archive/2005/10/13/mdx_format_currency.aspx

Am I right in thinking that I should create a Script Command in the Calculuations tab to set the appropriate languages for my measures?

eg:

Language([Measures].[GBPEQUIV-SENSITIVIES]) = 2057;

Language([Measures].[GBPEQUIV-STRESS]) = 2057;

BTW: I also changed the server locale to English-UK to get a default setting.

|||

Yeah I think you could do that, I have a script command like that with: Language(this) = 1053

Currency Formatting

Is there a way to format currency for check print using the reporting
services software? For example, instead of displaying $32,469.68, I could
display "thirty-two thousand four hundred sixty-nine and 68/100 dollars".
--
K. ThomasI would use a UDF on the SQL side to return this as a string
"K. Thomas" wrote:
> Is there a way to format currency for check print using the reporting
> services software? For example, instead of displaying $32,469.68, I could
> display "thirty-two thousand four hundred sixty-nine and 68/100 dollars".
> --
> K. Thomas|||Or you could write code and put in a custom assembly. In RS Books Online
look for "assembly references" in the index.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
news:3199963D-FEDA-4E92-B278-F50E38DEC8F6@.microsoft.com...
>I would use a UDF on the SQL side to return this as a string
> "K. Thomas" wrote:
>> Is there a way to format currency for check print using the reporting
>> services software? For example, instead of displaying $32,469.68, I
>> could
>> display "thirty-two thousand four hundred sixty-nine and 68/100 dollars".
>> --
>> K. Thomas|||Jeff,
In terms of efficiency, I stand well corrected,
Thanks,
Tony
"Jeff A. Stucker" wrote:
> Or you could write code and put in a custom assembly. In RS Books Online
> look for "assembly references" in the index.
> --
> Cheers,
> '(' Jeff A. Stucker
> \
> Business Intelligence
> www.criadvantage.com
> ---
> "Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
> news:3199963D-FEDA-4E92-B278-F50E38DEC8F6@.microsoft.com...
> >I would use a UDF on the SQL side to return this as a string
> >
> > "K. Thomas" wrote:
> >
> >> Is there a way to format currency for check print using the reporting
> >> services software? For example, instead of displaying $32,469.68, I
> >> could
> >> display "thirty-two thousand four hundred sixty-nine and 68/100 dollars".
> >> --
> >> K. Thomas
>
>|||I have no idea which would be more efficient, I just like knowing there are
multiple options... ;-)
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
news:2C1B882D-A985-4CD0-B791-46A4BF12F8B3@.microsoft.com...
> Jeff,
> In terms of efficiency, I stand well corrected,
> Thanks,
> Tony
> "Jeff A. Stucker" wrote:
>> Or you could write code and put in a custom assembly. In RS Books Online
>> look for "assembly references" in the index.
>> --
>> Cheers,
>> '(' Jeff A. Stucker
>> \
>> Business Intelligence
>> www.criadvantage.com
>> ---
>> "Logicalman" <tony9scott45us@.com7cast.net34> wrote in message
>> news:3199963D-FEDA-4E92-B278-F50E38DEC8F6@.microsoft.com...
>> >I would use a UDF on the SQL side to return this as a string
>> >
>> > "K. Thomas" wrote:
>> >
>> >> Is there a way to format currency for check print using the reporting
>> >> services software? For example, instead of displaying $32,469.68, I
>> >> could
>> >> display "thirty-two thousand four hundred sixty-nine and 68/100
>> >> dollars".
>> >> --
>> >> K. Thomas
>>

Currency Format with Comma Delimination

Is there a way to convert a field to Currency format with
a comma as a seperator.
ie
50000 would be $50,000
1234567 would be $1,234,567
etc.
I am just looking to do this via the SELECT statement.
Any suggestions would be helpful.
Use CONVERT function to do this.
Try something as:
SELECT '$'+ CONVERT(VARCHAR(50), money_column, 1) AS column_name
FROM <table>
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com
|||That works good to put the $ sign in. But is there also a
way to put the commas in?

>--Original Message--
>Use CONVERT function to do this.
>Try something as:
>SELECT '$'+ CONVERT(VARCHAR(50), money_column, 1) AS
column_name
>FROM <table>
>
>--
>Vishal Parkar
>vgparkar@.yahoo.co.in | vgparkar@.hotmail.com
>
>.
>
|||yes,
-- if column has datatype money then you can use query i've mentioned
earlier.
-- or else you will explicitly have to convert numeric value to money.
-- see 2nd query below.
create table t(money_column money)
insert into t values (123456)
SELECT '$' + CONVERT(VARCHAR(50), money_column, 1) AS column_name
FROM t
-- query if datatype is not meney
create table t(money_column int)
insert into t values (123456)
SELECT '$' + CONVERT(VARCHAR(50), cast(money_column as money), 1) AS
column_name
FROM t
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com
|||

Quote:

Originally posted by Vishal Parkar
Use CONVERT function to do this.
Try something as:
SELECT '$'+ CONVERT(VARCHAR(50), money_column, 1) AS column_name
FROM <table>
Vishal Parkar
vgparkar@.yahoo.co.in | vgparkar@.hotmail.com

This code works, but when I insert the markup that I need (*1.40) I get the dollar signs and 4 leading 0's at the end. IE, $4.500000
How do I get these 0's to drop? Here is the code
SELECT Product, [BU/ST], Pack, '$' + CONVERT(VARCHAR(50), UnitPrice * 1.40, 1) AS UnitPrice
FROM dbo.Regional
ORDER BY Flower

Currency format when exporting to excel

Hi,

I have a problem with the number format when i export my reports to excel with Reporting Services. I set numbers as currency with the command FormatCurrency() in visual studio, but when i export the report to excel, the numbers are considered as text.

Does anyone have a solution?
Thanks in advance.

Use the Format property on the cell/textbox, for currency the format string should be c<number decimal places>, i.e. c0 prints the currency figure with no decimal places. Once you have done this, remove the FormatCurrency() function from the expression as it overrides anything you have in the Format property. The reason the FormatCurrency() does not work when exporting to Excel is because its return value is a string, so Excel is confused - is it a currency or is it a string?

|||Thanks a lot, it works perfectly!!!! I'm so releaved

Currency Format Issue

Please Help!

I am stuggeling with a amount measure in my cube. The format of the measure is set to currency but i always shows the dollar($) sign no matter the regional settings or the language setting of the report.

How can i fix this problem as i do not know where to start looking. Everyone keeps saying the currency will change according to the language setting of the report or language setting under properties of sql 2005 analysis services.

Thanks in advance,

Jacques kruger

I have struggled with the same problem. This solution work if you have the same currency in a column: (### ### ### ###.##) or (### ### ### ###.##EUR) with a currency. Note the blanks as a thousand separator and the dot as decimal).

HTH

Thomas Ivarsson

|||

I have found this link to more information in Mosha's Blog: http://www.sqljunkies.com/WebLog/mosha/archive/2005/10/13/mdx_format_currency.aspx

Regards

Thomas Ivarsson

Sunday, March 11, 2012

Currency format in reporting services

I have what is likely a simple question but I have had no luck in tracking
down an answer so far. I have a report that I've created in RS that is for an
English company and I want to display the output in pounds as opposed to $.
When I go to a given text-box and click the format/currency option all I get
is $. I realize that RS tries to default to the currency setting on the
location the report is run but since the report will be hosted in the states
that's not going to help. All I need to do is format a text box as pounds!
Anyone have any ideas?
Thanks in advance.I noticed that if you click on the text box and look at the properties for it
that there is a language property. Change it from default to English (United
Kingdom) and that will change the currency symbol to the other symbol. I had
something formatted as currency and tried this and it seemed to work.
"littleren" wrote:
> I have what is likely a simple question but I have had no luck in tracking
> down an answer so far. I have a report that I've created in RS that is for an
> English company and I want to display the output in pounds as opposed to $.
> When I go to a given text-box and click the format/currency option all I get
> is $. I realize that RS tries to default to the currency setting on the
> location the report is run but since the report will be hosted in the states
> that's not going to help. All I need to do is format a text box as pounds!
> Anyone have any ideas?
> Thanks in advance.|||Thank You Kim! It worked perfectly.
"KimB" wrote:
> I noticed that if you click on the text box and look at the properties for it
> that there is a language property. Change it from default to English (United
> Kingdom) and that will change the currency symbol to the other symbol. I had
> something formatted as currency and tried this and it seemed to work.
> "littleren" wrote:
> > I have what is likely a simple question but I have had no luck in tracking
> > down an answer so far. I have a report that I've created in RS that is for an
> > English company and I want to display the output in pounds as opposed to $.
> > When I go to a given text-box and click the format/currency option all I get
> > is $. I realize that RS tries to default to the currency setting on the
> > location the report is run but since the report will be hosted in the states
> > that's not going to help. All I need to do is format a text box as pounds!
> >
> > Anyone have any ideas?
> >
> > Thanks in advance.|||I'm glad it helped!
"littleren" wrote:
> Thank You Kim! It worked perfectly.
>
> "KimB" wrote:
> > I noticed that if you click on the text box and look at the properties for it
> > that there is a language property. Change it from default to English (United
> > Kingdom) and that will change the currency symbol to the other symbol. I had
> > something formatted as currency and tried this and it seemed to work.
> >
> > "littleren" wrote:
> >
> > > I have what is likely a simple question but I have had no luck in tracking
> > > down an answer so far. I have a report that I've created in RS that is for an
> > > English company and I want to display the output in pounds as opposed to $.
> > > When I go to a given text-box and click the format/currency option all I get
> > > is $. I realize that RS tries to default to the currency setting on the
> > > location the report is run but since the report will be hosted in the states
> > > that's not going to help. All I need to do is format a text box as pounds!
> > >
> > > Anyone have any ideas?
> > >
> > > Thanks in advance.|||Hi,
Is it possible to apply your machine's Regional Settings to the currency
symbol Meaning, when I change my Windows' Regional Settings to English/UK,
currency will display with a pound symbol, if South Africa, with an R, or if
US. with a $?
Regards,
PM
"KimB" wrote:
> I'm glad it helped!
> "littleren" wrote:
> > Thank You Kim! It worked perfectly.
> >
> >
> > "KimB" wrote:
> >
> > > I noticed that if you click on the text box and look at the properties for it
> > > that there is a language property. Change it from default to English (United
> > > Kingdom) and that will change the currency symbol to the other symbol. I had
> > > something formatted as currency and tried this and it seemed to work.
> > >
> > > "littleren" wrote:
> > >
> > > > I have what is likely a simple question but I have had no luck in tracking
> > > > down an answer so far. I have a report that I've created in RS that is for an
> > > > English company and I want to display the output in pounds as opposed to $.
> > > > When I go to a given text-box and click the format/currency option all I get
> > > > is $. I realize that RS tries to default to the currency setting on the
> > > > location the report is run but since the report will be hosted in the states
> > > > that's not going to help. All I need to do is format a text box as pounds!
> > > >
> > > > Anyone have any ideas?
> > > >
> > > > Thanks in advance.

Currency Format

The $ must appears only on certain total levels and has to be in the same position in the column regardless of the value for financial reporting. In other words, I don't want the $ to float next the most significant digit in the value. See the example below from Excel. Using an IIF statement I can concatenate the $ to the string when it is a certain group level. However, I have tried many various formatting strings but can't find one that results in a fixed number of characters so that the $ will always appears in the same position in the column.

Anyone have a way to do this?

General Government

222

3.45%

$ 405,590,654

1.98%

Public Buildings

194

3.01%

375,453,314

1.83%

Other Facilities

22

0.34%

21,324,140

0.1%

Property Acquisition

6

0.09%

8,813,200

0.04%

Grand Total

6,439

100.0%

$ 20,507,977,298

100.0%

I did get this to work by adding a column to the grouping. That somehow causes the heading size to increase (?) and takes much more time than coding a format code in an expression (I have many reports to do).

Can you try something like this in your field's expression:

="$" & Space(30 - len(Fields!Total.Value)) & Fields!Total.Value

The 30 in my example would have to be higher than the maximum number of digits in your Total field. This will put spaces between the $ and the actual number you are showing, but only enough to make the $ symbols align.

Hope this helps.

Jarret

|||

This is close, but the proportional font keeps the $ from lining up.

I am not a VB programmer so I have a little trouble finding the appropriate string and format functions.

Thanks for your reply.

|||

Could you change to a fixed-width font so that it would line up?

Or, you could add a column to the left of the field that has the $ symbol in it, but only for the group header and footer. This way, it would always line up.

Jarret

|||

I did the add a column and it causes the group headers to grow and be ugly. I am hoping for a solution where I can code something in the expression. If not, I may have someone code me a little VB routine to use.

Thanks.

Currency Format

I'd like currency format of $#,###
but when i specify that, I dont get any values for 0 I just get a $
which is somewhat expected.
If I specify C, I get the cents, which I dont care about.
Anyone knowhow I might achieve C currency format, that doesnt include
cents, but displays 0 when the value is 0?
Thanks in advance
Weston WeemsWeston,
Check out the FORMATCURRENCY function.
HTH
Jerry
"Weston Weems" <wweems@.nospam_itsucksGMAIL.COM> wrote in message
news:uFR4buHxFHA.664@.tk2msftngp13.phx.gbl...
> I'd like currency format of $#,###
> but when i specify that, I dont get any values for 0 I just get a $ which
> is somewhat expected.
> If I specify C, I get the cents, which I dont care about.
> Anyone knowhow I might achieve C currency format, that doesnt include
> cents, but displays 0 when the value is 0?
> Thanks in advance
> Weston Weems

Currency Format

Hi,
How sould I format a Currency Column without decimals ?
ThanksSet the format to C0.
Andy Potter

Currency Exporting to Excel

Hi,
In one of my reports I have some fields that are currency fields displayed
with the currency format string (C). However, when I export these to Excel
(2003) I get the little yellow warning that says Number stored as text. And
if I try to do a sum by dragging across the cells and clicking the sigma
button at the top, it causes it to put an odd formula in the top row.
Is there an easy fix so that #'s exported as currency remain tied to excel
as currency?
Thanks,
ChrisI tried this on a matrix in RS2005 and it worked OK.
The format was c0. I do remember it being an issue in 2000. I don't
think there was a way round it in the report definition.
The only thing you could try is, in Excel, highlight the column and
format the cell to currency. If this works you will be able to do a SUM.
Cheers
Chris
Chris Taylor wrote:
> Hi,
> In one of my reports I have some fields that are currency fields
> displayed with the currency format string (C). However, when I
> export these to Excel (2003) I get the little yellow warning that
> says Number stored as text. And if I try to do a sum by dragging
> across the cells and clicking the sigma button at the top, it causes
> it to put an odd formula in the top row.
> Is there an easy fix so that #'s exported as currency remain tied to
> excel as currency?
> Thanks,
> Chris|||Tried formatting C0, stlil getting the text formatted as #.
MS any insight on this?
"Chris" <mr.mcgoo@.gmail.com> wrote in message
news:uPH9wVvQGHA.2704@.TK2MSFTNGP15.phx.gbl...
>I tried this on a matrix in RS2005 and it worked OK.
> The format was c0. I do remember it being an issue in 2000. I don't
> think there was a way round it in the report definition.
> The only thing you could try is, in Excel, highlight the column and
> format the cell to currency. If this works you will be able to do a SUM.
> Cheers
> Chris
>
> Chris Taylor wrote:
>> Hi,
>> In one of my reports I have some fields that are currency fields
>> displayed with the currency format string (C). However, when I
>> export these to Excel (2003) I get the little yellow warning that
>> says Number stored as text. And if I try to do a sum by dragging
>> across the cells and clicking the sigma button at the top, it causes
>> it to put an odd formula in the top row.
>> Is there an easy fix so that #'s exported as currency remain tied to
>> excel as currency?
>> Thanks,
>> Chris
>
> --
>|||Hi Chris,
Please modify the column width in Excel. I have tested in my side on RS
2005, it works fine.
Wei Lu
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
=====================================================When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Nope. I just tried this; both FormatCurrency and Format c0 send a
number as text, causing Excel to just put a Smart Tag on it and ignore
it in functions. I know that converting numbers to text is the entire
purpose of those two functions, but making them the sole means of
formatting numbers makes the Excel export function about as useless as
nipples on the Batsuit.
Wei Lu: I think Chris Taylor means "text formatted as number" and not
"the column's too narrow, so Excel puts in pound signs to tell you to
resize the column."

Currency conversion

Hi all,
I have an application based in Germany where the currency is the following
format: #.###,00
Users enter values in the above format but SQL Server requires the standard
format: #,###.00
Is there a way that I can tell SQL Server to convert formats automatically
or should I do the conversion in my code?
Regards,
IvanIvan Debono wrote:

> Hi all,
> I have an application based in Germany where the currency is the following
> format: #.###,00
> Users enter values in the above format but SQL Server requires the standar
d
> format: #,###.00
> Is there a way that I can tell SQL Server to convert formats automatically
> or should I do the conversion in my code?
> Regards,
> Ivan
Applications can do better formating of data than SQL Server.
Regards
Amish Shah

Currency $ sign.....

I have a column of salary that is in money datatype and i want to format it
so the $ shows up in my table'
Thanks
S.Please disregard...I better do this on the GUI side...;-)
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:OrChakxzDHA.832@.TK2MSFTNGP09.phx.gbl...
> I have a column of salary that is in money datatype and i want to format
it
> so the $ shows up in my table'
> Thanks
> S.
>|||You beat me to it, definitely something for the front end :-)
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"SMAN" <ksanti@.nycap.rr.com> wrote in message
news:%23qGNYqxzDHA.2056@.TK2MSFTNGP10.phx.gbl...
> Please disregard...I better do this on the GUI side...;-)
>
> "SMAN" <ksanti@.nycap.rr.com> wrote in message
> news:OrChakxzDHA.832@.TK2MSFTNGP09.phx.gbl...
> > I have a column of salary that is in money datatype and i want to format
> it
> > so the $ shows up in my table'
> >
> > Thanks
> >
> > S.
> >
> >
>

Currency - not $

Hi

I have a cube with a sales amount measure. When I choose the format string to currency i get a $ infront of it when i browse the cube.

What should I do to get a £ infront or maybe SEK in the back (SEK = Swedish Kronor)

Thanks for answers

//Patrik

Try changing the format string to #,#.00 kr.

/Per

|||

Well, that worked.

But it seems to be a work around, and not the final solution. You must be able to select what type of currency the currency format code is.

/Patrik

|||

Yes, I agree. Should be possible - calculated members work fine.

Maybe Frederik knows - can ask him during the coffe break.

/Per

|||Change the language setting in the properties section for the cube in Business Intelligence Development Studio. Then you will get the correct regional display of the currencies.|||

Thanks man...that did it.

I think thats the only Language setting that I didn't change :P

//Patrik

Thursday, March 8, 2012

Culture overriding custom format

Hi, I've been having a weird problem with a report I'm making. I've done douzan of em, and the problem only appeared in one. Let say I have a text field, and I give it a format property (for the sake of the example, imagine its a date, and I set it as yyyy/MM/dd. Same result if I would use an expression with the Format function).

Now, depending on culture, the slashes gets overrided. Everything else work (so if I put yyyy/MM, the format is recognised and the day won't show...but it will use dashes instead of slashes, for example, with us culture).

How do I get it to always respect my format? I have, like I said, douzans of other reports and it works fine, the format string gets applied exactly: I don't know what the hell I could have changed. All the culture settings are at default, like in the reports that do work... I've tried diff-ing the source, can't see anything weird, but I'm sure I'm just being blind.

Any ideas?

Thank you.

The DateSeparator is defined on the DateTimeFomatInfo objects and the slash is being "translated" to the current culture.

If there's not an option to have the slash in the format string not interpreted as a DateSeparator, the only thing I can think of is to add a .Replace(CultureInfo.CurrentCulture.DateTimeFormat.DateSeparator, "/") to the end of your Format statement.

|||

Just found this stumbling around on something else. Try "yyyy'/'mm'/'dd" as your format string. Found ithere, so you can fuss at Microsoft if it doesn't work.

|||

Makes sense. Yeah, escaping the slashes (let say, yyyy\/MM\/dd ) worked too.

But then, what do I do with numeric formats? (since the date was just an example). #,##0.00
Works fine in most of my reports, but in that particular one, no matter what format I put, the number gets translated with the current culture. What mostly gets me, is that it works in all the reports! Just not -that- one...ugh.|||

Those separators are also defined in a culture-specific way. I'd recheck that one report and make sure that you haven't accidentally specified a culture or that you did specify a culture on the other reports.

|||

Yup, you're right... I'm baffled, I tested the other reports, and not only did they have cultures set, but the formats never worked (I had a formula that switched the Language setting depending on a parameter set by the user, and the culture I always ended up printing my report coincidently had the correct separators).

My apologies for misleading you, I know it can be annoying when you're trying to help someone and they give you the wrong info :)

At least now I know I can backslash escape the magical separators... That is quite awkward that it does that, especially since its a bit different from the behavior of .NET formatters... Oh well!

Saturday, February 25, 2012

cube measures on rows in reporting services....

Is there anyway for reporting services to display measures on rows instead
of columns as in Excel?
I'm trying to format my data in rows but this doesn't seems possible in
reporting services... does anyone has any examples of how this can be done?Create a shared datasource to Foodmart 200 and try this RDL. HEre is a sample
report that i created with measures on rows.
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefinition"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Textbox Name="textbox1">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<BackgroundColor>Brown</BackgroundColor>
<BorderWidth>
<Bottom>3pt</Bottom>
</BorderWidth>
<BorderColor>
<Bottom>Black</Bottom>
</BorderColor>
<BorderStyle>
<Bottom>Solid</Bottom>
</BorderStyle>
<FontSize>18pt</FontSize>
<TextAlign>Center</TextAlign>
<Color>White</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>textbox1</rd:DefaultName>
<Height>0.33in</Height>
<CanGrow>true</CanGrow>
<Value>Report20</Value>
</Textbox>
<Matrix Name="matrix1">
<Corner>
<ReportItems>
<Textbox Name="textbox4">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>5</ZIndex>
<rd:DefaultName>textbox4</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value />
</Textbox>
</ReportItems>
</Corner>
<Height>0.72in</Height>
<Style />
<MatrixRows>
<MatrixRow>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox2">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<ZIndex>2</ZIndex>
<rd:DefaultName>textbox2</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!Measures_Unit_Sales.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
<Height>0.24in</Height>
</MatrixRow>
<MatrixRow>
<MatrixCells>
<MatrixCell>
<ReportItems>
<Textbox Name="textbox3">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
</Style>
<rd:DefaultName>textbox3</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=First(Fields!Measures_Profit.Value)</Value>
</Textbox>
</ReportItems>
</MatrixCell>
</MatrixCells>
<Height>0.24in</Height>
</MatrixRow>
</MatrixRows>
<MatrixColumns>
<MatrixColumn>
<Width>1in</Width>
</MatrixColumn>
</MatrixColumns>
<DataSetName>FoodMart_2000</DataSetName>
<ColumnGroupings>
<ColumnGrouping>
<DynamicColumns>
<Grouping Name="matrix1_Customers_Country">
<GroupExpressions>
<GroupExpression>=Fields!Customers_Country.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Sorting>
<SortBy>
<SortExpression>=Fields!Customers_Country.Value</SortExpression>
<Direction>Ascending</Direction>
</SortBy>
</Sorting>
<ReportItems>
<Textbox Name="Customers_Country">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<FontSize>12pt</FontSize>
<Color>DarkRed</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>4</ZIndex>
<rd:DefaultName>Customers_Country</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>=Fields!Customers_Country.Value</Value>
</Textbox>
</ReportItems>
</DynamicColumns>
<Height>0.24in</Height>
</ColumnGrouping>
</ColumnGroupings>
<Width>2in</Width>
<Top>0.33in</Top>
<RowGroupings>
<RowGrouping>
<Width>1in</Width>
<StaticRows>
<StaticRow>
<ReportItems>
<Textbox Name="textbox7">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<FontSize>12pt</FontSize>
<Color>DarkRed</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>3</ZIndex>
<rd:DefaultName>textbox7</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Units</Value>
</Textbox>
</ReportItems>
</StaticRow>
<StaticRow>
<ReportItems>
<Textbox Name="textbox8">
<Style>
<PaddingLeft>2pt</PaddingLeft>
<FontFamily>Times New Roman</FontFamily>
<FontSize>12pt</FontSize>
<Color>DarkRed</Color>
<PaddingBottom>2pt</PaddingBottom>
<PaddingTop>2pt</PaddingTop>
<PaddingRight>2pt</PaddingRight>
<FontWeight>700</FontWeight>
</Style>
<ZIndex>1</ZIndex>
<rd:DefaultName>textbox8</rd:DefaultName>
<CanGrow>true</CanGrow>
<Value>Profit</Value>
</Textbox>
</ReportItems>
</StaticRow>
</StaticRows>
</RowGrouping>
</RowGroupings>
</Matrix>
</ReportItems>
<Style />
<Height>2.25in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="FoodMart 2000">
<DataSourceReference>FoodMart 2000</DataSourceReference>
</DataSource>
</DataSources>
<Width>5in</Width>
<DataSets>
<DataSet Name="FoodMart_2000">
<Fields>
<Field Name="Customers_Country">
<DataField>[Customers].[Country].[MEMBER_CAPTION]</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="Measures_Unit_Sales">
<DataField>[Measures].[Unit Sales]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
<Field Name="Measures_Profit">
<DataField>[Measures].[Profit]</DataField>
<rd:TypeName>System.Object</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>FoodMart 2000</DataSourceName>
<CommandText>select
{{[Customers].[Country].Members}}on rows,
{ [Measures].[Unit Sales],[Measures].[Profit]} on columns
from Sales</CommandText>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<BottomMargin>1in</BottomMargin>
<Language>en-US</Language>
</Report>
"Nestor" wrote:
> Is there anyway for reporting services to display measures on rows instead
> of columns as in Excel?
> I'm trying to format my data in rows but this doesn't seems possible in
> reporting services... does anyone has any examples of how this can be done?
>
>