Showing posts with label sale. Show all posts
Showing posts with label sale. Show all posts

Thursday, March 22, 2012

Bar graphic chart is not in the same order with data table

Hi All,

I have a very simple bar-graphic report that has the following data:

Sale Region Total Sale

A 1,000,000

B 350,000

On the table, the data is sort by the Sale Region, so the A would come before the B. But on the bar-chart, the B is always displayed before the A. If it is a vertical bar chart, and then the B is on the left, the A is on the right. And if it's a hoz. bar chart, the B bar is on the top, and the A bar is on the bottom. I try to modify the RDL to make the bars displayed in order, but failed after many tries.

Here is the RDL code that I wrote in an attempt to make the bars display in ASC order, but does not work:

<CategoryGroupings>

<CategoryGrouping>

<DynamicCategories>

<Sorting>

<SortBy>

<SortExpression>Fields!SaleRegion.Value</SortExpression>

</SortBy>

</Sorting>

<Grouping Name="Chart1CategoryGroup">

<GroupExpressions>

<GroupExpression>=RowNumber(Nothing)</GroupExpression>

</GroupExpressions>

</Grouping>

<Label>=Fields!SaleRegion.Value</Label>

</DynamicCategories>

</CategoryGrouping>

</CategoryGroupings>

Can someone shed a light?

Thanks in advance

You are missing the "=" in the SortExpression. Right now it is just a constant string "Fields!SaleRegionValue".

Change it to:
<SortExpression>=Fields!SaleRegion.Value</SortExpression>

-- Robert

|||

That's it! Thanks Robert. You surely have a pair of hawk's eyes.

I have the chart sorted in order the way I wanted it too. However, I could not get the table order in the same way. I event go into the VS2005 report designer, set the sort property of the table. But no matter what order I set, the table is always displayed in a non-order. I added an ORDER BY clause in the SQL retrieve statement, the table is still displayed in a kind of random order.

Is this a known problem with Reporting Service? Or are there properties that I have to set in order for the table displayed on an ASC or DESC sequence?

Thanks in advance.

|||

It sounds like you have an explicit table detail group or a table group expression defined. In that case, you have to add the sorting directly on the grouping expression.

-- Robert

sql