Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Services / Reporting Services / October 2005

Tip: Looking for answers? Try searching our database.

how to draw a straight line in the chart?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Spirit - 27 Oct 2005 16:36 GMT
I want to draw a straight line whose parameter can be set in a
variaty.how to get it?
Robert Bruckner [MSFT] - 28 Oct 2005 02:56 GMT
If this is a line chart or a column chart, you could just add another data
series and plot that series as line (in case of a column chart, select the
"plot data as line" checkbox on the appearance tab). Set the data value
expression a parameter-dependent value, e.g. =Parameters!Threshold.Value and
set the BorderColor property
accordingly.

-- Robert
Signature

This posting is provided "AS IS" with no warranties, and confers no rights.


>I want to draw a straight line whose parameter can be set in a
> variaty.how to get it?
Spirit - 29 Oct 2005 16:56 GMT
select '2' as constant from ............
do you mean like that?
Robert Bruckner [MSFT] - 31 Oct 2005 00:17 GMT
You could also do it by using expressions. Attached a sample report at the
bottom of this posting which has a dynamic target line in the chart.

-- Robert
Signature

This posting is provided "AS IS" with no warranties, and confers no rights.


> select '2' as constant from ............
> do you mean like that?

============================================================

<?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>
     <Chart Name="TotalSalesByYear">
       <ThreeDProperties>
         <Rotation>30</Rotation>
         <Inclination>30</Inclination>
         <Shading>Simple</Shading>
         <WallThickness>50</WallThickness>
       </ThreeDProperties>
       <Style />
       <Legend>
         <Visible>true</Visible>
         <Style>
           <BorderStyle>
             <Default>Solid</Default>
           </BorderStyle>
           <Color>Brown</Color>
         </Style>
         <Position>RightCenter</Position>
       </Legend>
       <Palette>Pastel</Palette>
       <ChartData>
         <ChartSeries>
           <DataPoints>
             <DataPoint>
               <DataValues>
                 <DataValue>
                   <Value>=Sum(Fields!UnitPrice.Value *
Fields!Quantity.Value)</Value>
                 </DataValue>
               </DataValues>
               <DataLabel />
               <Style>
                 <BackgroundGradientEndColor>Black</BackgroundGradientEndColor>
                 <BackgroundGradientType>TopBottom</BackgroundGradientType>
                 <BackgroundColor>Blue</BackgroundColor>
                 <BorderWidth>
                   <Default>2pt</Default>
                 </BorderWidth>
                 <BorderColor>
                   <Default>Yellow</Default>
                 </BorderColor>
                 <BorderStyle>
                   <Default>Solid</Default>
                 </BorderStyle>
               </Style>
               <Marker>
                 <Size>6pt</Size>
               </Marker>
             </DataPoint>
           </DataPoints>
         </ChartSeries>
         <ChartSeries>
           <DataPoints>
             <DataPoint>
               <DataValues>
                 <DataValue>
                   <Value>=(Sum(Fields!UnitPrice.Value *
Fields!Quantity.Value)+8000)*1.15</Value>
                 </DataValue>
               </DataValues>
               <Style>
                 <BorderWidth>
                   <Default>6pt</Default>
                 </BorderWidth>
                 <BorderColor>
                   <Default>=iif((Sum(Fields!UnitPrice.Value *
Fields!Quantity.Value)+8000)*1.15 &gt; 100000, "Aqua", "Green")</Default>
                 </BorderColor>
                 <BorderStyle>
                   <Default>Solid</Default>
                 </BorderStyle>
               </Style>
               <Marker>
                 <Type>Diamond</Type>
                 <Size>10pt</Size>
               <Style>
                 <BackgroundColor>Yellow</BackgroundColor>
               </Style>

               </Marker>
             </DataPoint>
           </DataPoints>
           <PlotType>Line</PlotType>
         </ChartSeries>
         <ChartSeries>
           <DataPoints>
             <DataPoint>
               <DataValues>
                 <DataValue>
                   <Value>=iif(Year(Fields!OrderDate.Value) = 1996, 75000,
iif(Year(Fields!OrderDate.Value) = 1997, 90000, 115000))</Value>
                 </DataValue>
               </DataValues>
               <DataLabel />
               <Style>
                 <BorderWidth>
                   <Default>10pt</Default>
                 </BorderWidth>
                 <BorderColor>
                   <Default>Red</Default>
                 </BorderColor>
                 <BorderStyle>
                   <Default>Solid</Default>
                 </BorderStyle>
               </Style>
             </DataPoint>
           </DataPoints>
           <PlotType>Line</PlotType>
         </ChartSeries>
       </ChartData>
       <CategoryAxis>
         <Axis>
           <Title>
             <Style />
           </Title>
           <Style>
             <Format>MM/yyyy</Format>
           </Style>
           <MajorGridLines>
             <ShowGridLines>true</ShowGridLines>
             <Style>
               <BorderStyle>
                 <Default>Solid</Default>
               </BorderStyle>
             </Style>
           </MajorGridLines>
           <MinorGridLines>
             <Style>
               <BorderStyle>
                 <Default>Solid</Default>
               </BorderStyle>
             </Style>
           </MinorGridLines>
           <MajorTickMarks>Outside</MajorTickMarks>
           <Margin>true</Margin>
           <Visible>true</Visible>
         </Axis>
       </CategoryAxis>
       <DataSetName>Northwind</DataSetName>
       <PointWidth>100</PointWidth>
       <Type>Column</Type>
       <Title>
         <Caption>Sales / Cost / Target</Caption>
         <Style>
           <FontSize>14pt</FontSize>
           <FontWeight>700</FontWeight>
         </Style>
       </Title>
       <CategoryGroupings>
         <CategoryGrouping>
           <DynamicCategories>
             <Grouping Name="newChart1_CategoryGroup1">
               <GroupExpressions>
                 <GroupExpression>=Year(Fields!OrderDate.Value)*100+Month(Fields!OrderDate.Value)</GroupExpression>
               </GroupExpressions>
             </Grouping>
             <Sorting>
               <SortBy>
                 <SortExpression>=Fields!OrderDate.Value</SortExpression>
                 <Direction>Ascending</Direction>
               </SortBy>
             </Sorting>
             <Label>=Fields!OrderDate.Value</Label>
           </DynamicCategories>
         </CategoryGrouping>
       </CategoryGroupings>
       <Height>6.125in</Height>
       <SeriesGroupings>
         <SeriesGrouping>
           <StaticSeries>
             <StaticMember>
               <Label>Cost</Label>
             </StaticMember>
             <StaticMember>
               <Label>Sales</Label>
             </StaticMember>
             <StaticMember>
               <Label>Target</Label>
             </StaticMember>
           </StaticSeries>
         </SeriesGrouping>
       </SeriesGroupings>
       <Subtype>Plain</Subtype>
       <PlotArea>
         <Style>
           <BackgroundGradientEndColor>White</BackgroundGradientEndColor>
           <BackgroundGradientType>TopBottom</BackgroundGradientType>
           <BackgroundColor>LightGrey</BackgroundColor>
           <BorderStyle>
             <Default>Solid</Default>
           </BorderStyle>
         </Style>
       </PlotArea>
       <ValueAxis>
         <Axis>
           <Title>
             <Style />
           </Title>
           <Style />
           <MajorGridLines>
             <ShowGridLines>true</ShowGridLines>
             <Style>
               <BorderStyle>
                 <Default>Solid</Default>
               </BorderStyle>
             </Style>
           </MajorGridLines>
           <MinorGridLines>
             <Style>
               <BorderStyle>
                 <Default>Solid</Default>
               </BorderStyle>
             </Style>
           </MinorGridLines>
           <MajorTickMarks>Outside</MajorTickMarks>
           <MinorTickMarks>Outside</MinorTickMarks>
           <Min>0</Min>
           <Visible>true</Visible>
           <Scalar>true</Scalar>
         </Axis>
       </ValueAxis>
     </Chart>
   </ReportItems>
   <Style />
   <Height>6.5in</Height>
 </Body>
 <TopMargin>1in</TopMargin>
 <DataSources>
   <DataSource Name="Northwind">
     <rd:DataSourceID>da5964d0-11a7-4e51-9b22-cc4fa55fdd7a</rd:DataSourceID>
     <ConnectionProperties>
       <DataProvider>SQL</DataProvider>
       <ConnectString>data source=(local);initial
catalog=Northwind</ConnectString>
       <IntegratedSecurity>true</IntegratedSecurity>
     </ConnectionProperties>
   </DataSource>
 </DataSources>
 <Width>6.5in</Width>
 <DataSets>
   <DataSet Name="Northwind">
     <Fields>
       <Field Name="UnitPrice">
         <DataField>UnitPrice</DataField>
         <rd:TypeName>System.Decimal</rd:TypeName>
       </Field>
       <Field Name="Quantity">
         <DataField>Quantity</DataField>
         <rd:TypeName>System.Int16</rd:TypeName>
       </Field>
       <Field Name="OrderDate">
         <DataField>OrderDate</DataField>
         <rd:TypeName>System.DateTime</rd:TypeName>
       </Field>
     </Fields>
     <Query>
       <DataSourceName>Northwind</DataSourceName>
       <CommandText>SELECT     [Order Details].UnitPrice, [Order
Details].Quantity, Orders.OrderDate
FROM         Orders INNER JOIN
                     [Order Details] ON Orders.OrderID = [Order
Details].OrderID</CommandText>
       <Timeout>30</Timeout>
     </Query>
   </DataSet>
 </DataSets>
 <LeftMargin>1in</LeftMargin>
 <rd:SnapToGrid>true</rd:SnapToGrid>
 <rd:DrawGrid>true</rd:DrawGrid>
 <rd:ReportID>bc811835-2302-4f9e-9c89-a99d4d3f5fd2</rd:ReportID>
 <BottomMargin>1in</BottomMargin>
</Report>
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.