Showing posts with label lines. Show all posts
Showing posts with label lines. Show all posts

Wednesday, March 7, 2012

Bug - outline and color change for bar graphs

This option is new and came out with SP1
I tried to put an outline as well as color in the bar graphs.
Unfortunately, the lines didn't show...no matter how I tried...
seems like a bug to me...What exactly do you mean with "outline"?
Do you mean specific a border color different from the fill color of bars?
This works in SP1 and an example for this is attached below.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
<?xml version="1.0" encoding="utf-8"?>
<Report
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
tion"
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
<RightMargin>1in</RightMargin>
<Body>
<ReportItems>
<Chart Name="newChart1">
<ThreeDProperties>
<Rotation>30</Rotation>
<Inclination>20</Inclination>
<Shading>Real</Shading>
<WallThickness>25</WallThickness>
<DrawingStyle>Cylinder</DrawingStyle>
<Clustered>true</Clustered>
</ThreeDProperties>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<Color>Firebrick</Color>
</Style>
<Legend>
<Visible>true</Visible>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Position>RightCenter</Position>
</Legend>
<Palette>Excel</Palette>
<ChartData>
<ChartSeries>
<DataPoints>
<DataPoint>
<DataValues>
<DataValue>
<Value>=Fields!UnitsInStock.Value</Value>
</DataValue>
</DataValues>
<DataLabel>
<Style />
</DataLabel>
<Style>
<BackgroundColor>Blue</BackgroundColor>
<BorderWidth>
<Default>1.5pt</Default>
</BorderWidth>
<BorderColor>
<Default>Yellow</Default>
</BorderColor>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<Marker>
<Size>6pt</Size>
</Marker>
</DataPoint>
</DataPoints>
</ChartSeries>
</ChartData>
<CategoryAxis>
<Axis>
<Title>
<Caption>Products</Caption>
<Style />
</Title>
<Style>
<FontSize>8pt</FontSize>
</Style>
<MajorGridLines>
<Style>
<BorderWidth>
<Default>1.5pt</Default>
</BorderWidth>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderStyle>
<Default>Dotted</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MajorTickMarks>Outside</MajorTickMarks>
<MinorTickMarks>Outside</MinorTickMarks>
<MajorInterval>5</MajorInterval>
<MinorInterval>1</MinorInterval>
<CrossAt>0</CrossAt>
<Margin>true</Margin>
<Visible>true</Visible>
</Axis>
</CategoryAxis>
<DataSetName>Northwind</DataSetName>
<PointWidth>55</PointWidth>
<Type>Column</Type>
<Top>0.25in</Top>
<Title>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Title>
<Width>6.375in</Width>
<CategoryGroupings>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="newChart1_CategoryGroup2">
<GroupExpressions>
<GroupExpression>=Fields!CategoryName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Label />
</DynamicCategories>
</CategoryGrouping>
<CategoryGrouping>
<DynamicCategories>
<Grouping Name="CategoryGroup1">
<GroupExpressions>
<GroupExpression>=Fields!ProductName.Value</GroupExpression>
</GroupExpressions>
</Grouping>
<Label>=Fields!ProductName.Value</Label>
</DynamicCategories>
</CategoryGrouping>
</CategoryGroupings>
<Height>3.25in</Height>
<SeriesGroupings>
<SeriesGrouping>
<StaticSeries>
<StaticMember>
<Label>Stock</Label>
</StaticMember>
</StaticSeries>
</SeriesGrouping>
</SeriesGroupings>
<Subtype>Plain</Subtype>
<PlotArea>
<Style>
<BackgroundColor>OldLace</BackgroundColor>
</Style>
</PlotArea>
<Left>0.25in</Left>
<ValueAxis>
<Axis>
<Title>
<Caption>Amount</Caption>
<Style />
</Title>
<Style>
<BorderColor>
<Default>IndianRed</Default>
</BorderColor>
<FontSize>8pt</FontSize>
</Style>
<MajorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderColor>
<Default>Blue</Default>
</BorderColor>
<BorderStyle>
<Default>Dashed</Default>
</BorderStyle>
</Style>
</MajorGridLines>
<MinorGridLines>
<ShowGridLines>true</ShowGridLines>
<Style>
<BorderColor>
<Default>CornflowerBlue</Default>
</BorderColor>
<BorderStyle>
<Default>Dotted</Default>
</BorderStyle>
</Style>
</MinorGridLines>
<MinorTickMarks>Cross</MinorTickMarks>
<Min>0</Min>
<MajorInterval>20</MajorInterval>
<MinorInterval>5</MinorInterval>
<Interlaced>true</Interlaced>
<Margin>true</Margin>
<Visible>true</Visible>
<Scalar>true</Scalar>
</Axis>
</ValueAxis>
</Chart>
</ReportItems>
<Style />
<Height>3.625in</Height>
</Body>
<TopMargin>1in</TopMargin>
<DataSources>
<DataSource Name="Northwind">
<rd:DataSourceID>32d95cbf-5e5b-4fb3-a37a-39b9506b8c80</rd:DataSourceID>
<ConnectionProperties>
<DataProvider>SQL</DataProvider>
<ConnectString>data source=(local);initial
catalog=Northwind</ConnectString>
<IntegratedSecurity>true</IntegratedSecurity>
</ConnectionProperties>
</DataSource>
</DataSources>
<Width>6.75in</Width>
<DataSets>
<DataSet Name="Northwind">
<Fields>
<Field Name="ProductID">
<DataField>ProductID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="ProductName">
<DataField>ProductName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="SupplierID">
<DataField>SupplierID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="CategoryID">
<DataField>CategoryID</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
<Field Name="QuantityPerUnit">
<DataField>QuantityPerUnit</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="UnitPrice">
<DataField>UnitPrice</DataField>
<rd:TypeName>System.Decimal</rd:TypeName>
</Field>
<Field Name="UnitsInStock">
<DataField>UnitsInStock</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="UnitsOnOrder">
<DataField>UnitsOnOrder</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="ReorderLevel">
<DataField>ReorderLevel</DataField>
<rd:TypeName>System.Int16</rd:TypeName>
</Field>
<Field Name="Discontinued">
<DataField>Discontinued</DataField>
<rd:TypeName>System.Boolean</rd:TypeName>
</Field>
<Field Name="CategoryName">
<DataField>CategoryName</DataField>
<rd:TypeName>System.String</rd:TypeName>
</Field>
<Field Name="NullUnits">
<DataField>NullUnits</DataField>
<rd:TypeName>System.Int32</rd:TypeName>
</Field>
</Fields>
<Query>
<DataSourceName>Northwind</DataSourceName>
<CommandText>SELECT TOP 10 *, NULL AS NullUnits
FROM [Alphabetical list of products]
WHERE (UnitsOnOrder > 0)</CommandText>
<Timeout>30</Timeout>
</Query>
</DataSet>
</DataSets>
<LeftMargin>1in</LeftMargin>
<rd:SnapToGrid>true</rd:SnapToGrid>
<rd:DrawGrid>true</rd:DrawGrid>
<rd:ReportID>4792d607-5639-4c89-ac36-2794e9e78a74</rd:ReportID>
<BottomMargin>1in</BottomMargin>
</Report>|||You can contact me offline.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sam" <Sam@.discussions.microsoft.com> wrote in message
news:BF7949E8-8EC3-4680-8738-A89B210B9C6B@.microsoft.com...
> Robert,
> We have seen other (possible bug or something we miss) issues with stacked
bar chart and they are:
> 1) Legend colors do not consistently match the assigned colors of data
series.
> 2) Legend, when arranged in the form of a column, shows in reverse order.
> I can get you the images of the charts, or if you can spare some time, I
can send you the ms intranet url showing the reports.
> Thanks,
> Sam
>
> "Robert Bruckner [MSFT]" wrote:
> > What exactly do you mean with "outline"?
> > Do you mean specific a border color different from the fill color of
bars?
> > This works in SP1 and an example for this is attached below.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <Report
> >
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2003/10/reportdefini
> > tion"
> >
xmlns:rd="">http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
> > <RightMargin>1in</RightMargin>
> > <Body>
> > <ReportItems>
> > <Chart Name="newChart1">
> > <ThreeDProperties>
> > <Rotation>30</Rotation>
> > <Inclination>20</Inclination>
> > <Shading>Real</Shading>
> > <WallThickness>25</WallThickness>
> > <DrawingStyle>Cylinder</DrawingStyle>
> > <Clustered>true</Clustered>
> > </ThreeDProperties>
> > <Style>
> > <BorderStyle>
> > <Default>Solid</Default>
> > </BorderStyle>
> > <Color>Firebrick</Color>
> > </Style>
> > <Legend>
> > <Visible>true</Visible>
> > <Style>
> > <BorderStyle>
> > <Default>Solid</Default>
> > </BorderStyle>
> > </Style>
> > <Position>RightCenter</Position>
> > </Legend>
> > <Palette>Excel</Palette>
> > <ChartData>
> > <ChartSeries>
> > <DataPoints>
> > <DataPoint>
> > <DataValues>
> > <DataValue>
> > <Value>=Fields!UnitsInStock.Value</Value>
> > </DataValue>
> > </DataValues>
> > <DataLabel>
> > <Style />
> > </DataLabel>
> > <Style>
> > <BackgroundColor>Blue</BackgroundColor>
> > <BorderWidth>
> > <Default>1.5pt</Default>
> > </BorderWidth>
> > <BorderColor>
> > <Default>Yellow</Default>
> > </BorderColor>
> > <BorderStyle>
> > <Default>Solid</Default>
> > </BorderStyle>
> > </Style>
> > <Marker>
> > <Size>6pt</Size>
> > </Marker>
> > </DataPoint>
> > </DataPoints>
> > </ChartSeries>
> > </ChartData>
> > <CategoryAxis>
> > <Axis>
> > <Title>
> > <Caption>Products</Caption>
> > <Style />
> > </Title>
> > <Style>
> > <FontSize>8pt</FontSize>
> > </Style>
> > <MajorGridLines>
> > <Style>
> > <BorderWidth>
> > <Default>1.5pt</Default>
> > </BorderWidth>
> > <BorderStyle>
> > <Default>Solid</Default>
> > </BorderStyle>
> > </Style>
> > </MajorGridLines>
> > <MinorGridLines>
> > <ShowGridLines>true</ShowGridLines>
> > <Style>
> > <BorderStyle>
> > <Default>Dotted</Default>
> > </BorderStyle>
> > </Style>
> > </MinorGridLines>
> > <MajorTickMarks>Outside</MajorTickMarks>
> > <MinorTickMarks>Outside</MinorTickMarks>
> > <MajorInterval>5</MajorInterval>
> > <MinorInterval>1</MinorInterval>
> > <CrossAt>0</CrossAt>
> > <Margin>true</Margin>
> > <Visible>true</Visible>
> > </Axis>
> > </CategoryAxis>
> > <DataSetName>Northwind</DataSetName>
> > <PointWidth>55</PointWidth>
> > <Type>Column</Type>
> > <Top>0.25in</Top>
> > <Title>
> > <Style>
> > <BorderStyle>
> > <Default>Solid</Default>
> > </BorderStyle>
> > </Style>
> > </Title>
> > <Width>6.375in</Width>
> > <CategoryGroupings>
> > <CategoryGrouping>
> > <DynamicCategories>
> > <Grouping Name="newChart1_CategoryGroup2">
> > <GroupExpressions>
> >
> > <GroupExpression>=Fields!CategoryName.Value</GroupExpression>
> > </GroupExpressions>
> > </Grouping>
> > <Label />
> > </DynamicCategories>
> > </CategoryGrouping>
> > <CategoryGrouping>
> > <DynamicCategories>
> > <Grouping Name="CategoryGroup1">
> > <GroupExpressions>
> >
> > <GroupExpression>=Fields!ProductName.Value</GroupExpression>
> > </GroupExpressions>
> > </Grouping>
> > <Label>=Fields!ProductName.Value</Label>
> > </DynamicCategories>
> > </CategoryGrouping>
> > </CategoryGroupings>
> > <Height>3.25in</Height>
> > <SeriesGroupings>
> > <SeriesGrouping>
> > <StaticSeries>
> > <StaticMember>
> > <Label>Stock</Label>
> > </StaticMember>
> > </StaticSeries>
> > </SeriesGrouping>
> > </SeriesGroupings>
> > <Subtype>Plain</Subtype>
> > <PlotArea>
> > <Style>
> > <BackgroundColor>OldLace</BackgroundColor>
> > </Style>
> > </PlotArea>
> > <Left>0.25in</Left>
> > <ValueAxis>
> > <Axis>
> > <Title>
> > <Caption>Amount</Caption>
> > <Style />
> > </Title>
> > <Style>
> > <BorderColor>
> > <Default>IndianRed</Default>
> > </BorderColor>
> > <FontSize>8pt</FontSize>
> > </Style>
> > <MajorGridLines>
> > <ShowGridLines>true</ShowGridLines>
> > <Style>
> > <BorderColor>
> > <Default>Blue</Default>
> > </BorderColor>
> > <BorderStyle>
> > <Default>Dashed</Default>
> > </BorderStyle>
> > </Style>
> > </MajorGridLines>
> > <MinorGridLines>
> > <ShowGridLines>true</ShowGridLines>
> > <Style>
> > <BorderColor>
> > <Default>CornflowerBlue</Default>
> > </BorderColor>
> > <BorderStyle>
> > <Default>Dotted</Default>
> > </BorderStyle>
> > </Style>
> > </MinorGridLines>
> > <MinorTickMarks>Cross</MinorTickMarks>
> > <Min>0</Min>
> > <MajorInterval>20</MajorInterval>
> > <MinorInterval>5</MinorInterval>
> > <Interlaced>true</Interlaced>
> > <Margin>true</Margin>
> > <Visible>true</Visible>
> > <Scalar>true</Scalar>
> > </Axis>
> > </ValueAxis>
> > </Chart>
> > </ReportItems>
> > <Style />
> > <Height>3.625in</Height>
> > </Body>
> > <TopMargin>1in</TopMargin>
> > <DataSources>
> > <DataSource Name="Northwind">
> >
> > <rd:DataSourceID>32d95cbf-5e5b-4fb3-a37a-39b9506b8c80</rd:DataSourceID>
> > <ConnectionProperties>
> > <DataProvider>SQL</DataProvider>
> > <ConnectString>data source=(local);initial
> > catalog=Northwind</ConnectString>
> > <IntegratedSecurity>true</IntegratedSecurity>
> > </ConnectionProperties>
> > </DataSource>
> > </DataSources>
> > <Width>6.75in</Width>
> > <DataSets>
> > <DataSet Name="Northwind">
> > <Fields>
> > <Field Name="ProductID">
> > <DataField>ProductID</DataField>
> > <rd:TypeName>System.Int32</rd:TypeName>
> > </Field>
> > <Field Name="ProductName">
> > <DataField>ProductName</DataField>
> > <rd:TypeName>System.String</rd:TypeName>
> > </Field>
> > <Field Name="SupplierID">
> > <DataField>SupplierID</DataField>
> > <rd:TypeName>System.Int32</rd:TypeName>
> > </Field>
> > <Field Name="CategoryID">
> > <DataField>CategoryID</DataField>
> > <rd:TypeName>System.Int32</rd:TypeName>
> > </Field>
> > <Field Name="QuantityPerUnit">
> > <DataField>QuantityPerUnit</DataField>
> > <rd:TypeName>System.String</rd:TypeName>
> > </Field>
> > <Field Name="UnitPrice">
> > <DataField>UnitPrice</DataField>
> > <rd:TypeName>System.Decimal</rd:TypeName>
> > </Field>
> > <Field Name="UnitsInStock">
> > <DataField>UnitsInStock</DataField>
> > <rd:TypeName>System.Int16</rd:TypeName>
> > </Field>
> > <Field Name="UnitsOnOrder">
> > <DataField>UnitsOnOrder</DataField>
> > <rd:TypeName>System.Int16</rd:TypeName>
> > </Field>
> > <Field Name="ReorderLevel">
> > <DataField>ReorderLevel</DataField>
> > <rd:TypeName>System.Int16</rd:TypeName>
> > </Field>
> > <Field Name="Discontinued">
> > <DataField>Discontinued</DataField>
> > <rd:TypeName>System.Boolean</rd:TypeName>
> > </Field>
> > <Field Name="CategoryName">
> > <DataField>CategoryName</DataField>
> > <rd:TypeName>System.String</rd:TypeName>
> > </Field>
> > <Field Name="NullUnits">
> > <DataField>NullUnits</DataField>
> > <rd:TypeName>System.Int32</rd:TypeName>
> > </Field>
> > </Fields>
> > <Query>
> > <DataSourceName>Northwind</DataSourceName>
> > <CommandText>SELECT TOP 10 *, NULL AS NullUnits
> > FROM [Alphabetical list of products]
> > WHERE (UnitsOnOrder > 0)</CommandText>
> > <Timeout>30</Timeout>
> > </Query>
> > </DataSet>
> > </DataSets>
> > <LeftMargin>1in</LeftMargin>
> > <rd:SnapToGrid>true</rd:SnapToGrid>
> > <rd:DrawGrid>true</rd:DrawGrid>
> > <rd:ReportID>4792d607-5639-4c89-ac36-2794e9e78a74</rd:ReportID>
> > <BottomMargin>1in</BottomMargin>
> > </Report>
> >
> >
> >
> >

Tuesday, February 14, 2012

Breaking out data from a text field type

In my database there is a text field type that is used to enter street
address. This address could be a few lines long, each line with a
carriage return at the end.
Is there a way to search for these carriage returns and break out what
is in each line seperately?

Thanks.
Mike[posted and mailed, please reply in news]

Mike (mrea@.ohiotravelbag.com) writes:
> In my database there is a text field type that is used to enter street
> address. This address could be a few lines long, each line with a
> carriage return at the end.
> Is there a way to search for these carriage returns and break out what
> is in each line seperately?

Is that really the datatype text? That seems a bit over kill for a street
address. They would very rarely be over 8000 bytes. Or even 4000 if you
are using varchar.

The functions to use are substring and charindex. And char(13) for the
CRs. Or char(13) + char(10) if it's actually CR + LF. charindex does not
handle text beyond the varchar limit, but I don't think this would be
an issue.

You could also do:

SELECT @.adr = adr FROM tbl WHERE ..
SELECT str
FROM iter_charlist_to_table(@.adr, char(13))
ORDER BY listpos

You find this function on
http://www.sommarskog.se/arrays-in-...list-of-strings

Note that if you need to use char(13) + char(10) as delimiter, you
will have to change the function. (And not only the length of delimiter.)

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

Friday, February 10, 2012

Borderstyle and Padding

I need a table similar to Fig-1 on my report. The subtotal and total lines need top padding and solid border at top and bottom. I’m currently using bottom padding of 20pt on the sub total row and setting the border style property of the sub total and total rows to solid at top and bottom. But the problem is that the sub total rows are being padded first and then the border at the bottom is being set to solid. As a result, my table looks something similar to figure 2, which is not acceptable to my customer. I also tried by setting the top padding of the lines below subtotals, but it doesn't give me what I need. Any way I can set the border before padding? Appreciate your help.

Figure-1

A

10

B

20

C

30

Sub Total

60

D

20

E

10

F

50

Sub Total

80

TOTAL

140

Figure-2

A

10

B

20

C

30

Sub Total

60

D

20

E

10

F

50

Sub Total

80

TOTAL

140


You can accomplish this by adding another row to the grouping footer where the subtotal row is located. To add a row in the Report Designer, right-click on the gray box to the left of the row and choose "insert row below." Be sure to remove the extra padding from the subtotal row.

Ian|||

Ian,

Clicking on the gray box on the subtotal row selects the entire row and when I right click it just gives me options to add row groups and not rows. Is there any other way? Thanks

|||What authoring application are you using? The VS 2005 Report Designer? There should be a "Insert Row" menu option on the context menu. Are you using a matirx or a table? You seem to be describing the behavior for a matrix subtotal.

From your description, I thought you were using a table with a detail group, a grouping that has only the "Include group footer" checked, for the subtotal, and the table footer enabled, for the total. My solution only works in this scenario. This solution won't work for a Matrix, since the subtotal is derived from the group being subtotaled, and cannot have another row added to it. There are ways to accomplish this in a Matrix, but it is not as straightforward as adding an empty row.

Ian|||I should have been more specific. I'm using a matrix and not a table.