Hi,Can someone please assist me with creating charts in reporting service 2005?I have this sp:ALTER PROCEDURE[dbo].[IM_ChartReport] -- Add the parameters for the stored procedure here@app_id int, @subject_id int,@issue_id int,@date_from datetime,@date_to datetime ,@agent intASBEGINif @subject_id=0set @subject_id=nullif @app_id=0set @app_id=nullif @issue_id=0set @issue_id=nullif @agent=0set @agent=null -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON;select count(r.subject) as 'total',s.subject as 'Value' ,convert(nvarchar(10),[Date_Reported],103) as date_reported,users.FirstName +' '+ LastName as DisplayNamefromdbo.IM_Msg_Issue_Reported rleft join dbo.IM_Bugs b on b.bug_id=r.issueleft join dbo.IM_Application a on a.App_id=r.applicationleft join dbo.IM_Subject s on s.Subject_id=r.subjectleft outer join users on users.id=r.agent_idwhere (r.date_reported BETWEEN CONVERT(varchar(10), @date_from, 103) AND CONVERT(varchar(10), @date_to, 103)) AND (R.SUBJECT=@subject_id or @subject_id is null)and (r.application=@app_id or @app_id is null)and (r.issue=@issue_id or @issue_id is null)and (r.agent_id=@agent or @agent is null)group by s.subject ,r.date_reported,users.FirstName,LastName union allselect count (r.application) as 'total',a.application as 'Value' ,convert(nvarchar(10),[Date_Reported],103) as date_reported,users.FirstName +' '+ LastName as DisplayNamefromdbo.IM_Msg_Issue_Reported rleft join dbo.IM_Bugs b on b.bug_id=r.issueleft join dbo.IM_Application a on a.App_id=r.applicationleft join dbo.IM_Subject s on s.Subject_id=r.subjectleft outer join users on users.id=r.agent_idwhere (r.date_reported BETWEEN CONVERT(varchar(10), @date_from, 103) AND CONVERT(varchar(10), @date_to, 103)) AND (R.SUBJECT=@subject_id or @subject_id is null)and (r.application=@app_id or @app_id is null)and (r.issue=@issue_id or @issue_id is null)and (r.agent_id=@agent or @agent is null)group by a.application,r.date_reported,users.FirstName,LastName union allselect count(r.issue) as 'total',b.bug as 'Value',convert(nvarchar(10),r.[Date_Reported],103) as date_reported,users.FirstName +' '+ LastName as DisplayNamefromdbo.IM_Msg_Issue_Reported rleft join dbo.IM_Bugs b on b.bug_id=r.issueleft join dbo.IM_Application a on a.App_id=r.applicationleft join dbo.IM_Subject s on s.Subject_id=r.subjectleft outer join users on users.id=r.agent_idwhere (r.date_reported BETWEEN CONVERT(varchar(10), @date_from, 103) AND CONVERT(varchar(10), @date_to, 103)) AND (R.SUBJECT=@subject_id or @subject_id is null)and (r.application=@app_id or @app_id is null)and (r.issue=@issue_id or @issue_id is null)and (r.agent_id=@agent or @agent is null)group by b.bug,r.date_reported,users.FirstName,LastNameorder by Date_Reportedend
The result of this if the values are null and date_from=’02/02/2009’ and date_to=’03/03/2009’ Total Value Date_reported Agent 1 subject1 02/02/2009 kb user1 Subject5A 02/02/2009 Tom Agent1 Subject5A 02/02/2009 kb user1 product1 02/02/2009 kb user1 Product3 02/02/2009 Tom Agent1 Product5 02/02/2009 kb user1 issue 5 02/02/2009 kb user1 issue2 02/02/2009 kb user1 issue3aaa 02/02/2009 Tom Agent1 issue2 13/02/2009 Tom Agent1 product2 13/02/2009 Tom Agent1 subject2 13/02/2009 Tom Agent1 subject1 18/02/2009 Support Agent1 subject3 18/02/2009 Support Agent1 product1 18/02/2009 Support Agent1 Product3 18/02/2009 Support Agent1 issue3aaa 18/02/2009 Support Agent1 issue1 18/02/2009 Support Agent1 issue1 19/02/2009 Sarah Black1 issue1 19/02/2009 kb user1 issue3aaa 19/02/2009 Sarah Black1 ISSUE4 19/02/2009 kb user1 Product4 19/02/2009 Sarah Black1 Product4 19/02/2009 kb user1 product2 19/02/2009 Tom Agent1 product2 19/02/2009 Sarah Black1 product2 19/02/2009 kb user2 product2 19/02/2009 Support Agent1 issue2 19/02/2009 Tom Agent1 issue2 19/02/2009 Sarah Black1 issue2 19/02/2009 kb user2 issue2 19/02/2009 Support Agent1 issue 5 19/02/2009 Sarah Black1 Product5 19/02/2009 Sarah Black1 product1 19/02/2009 Sarah Black1 product1 19/02/2009 kb user1 Subject5A 19/02/2009 Tom Agent1 Subject5A 19/02/2009 Sarah Black1 subject3 19/02/2009 Sarah Black1 Subject4 19/02/2009 kb user1 Subject4a 19/02/2009 Sarah Black2 Subject4a 19/02/2009 kb user1 subject2 19/02/2009 Sarah Black2 subject2 19/02/2009 Support AgentI need to display the results in a pie and line charts. I have looked at many examples and have wrecked my brains out trying to get a decent pie/line chart. I am doing something wrong. Maybe my sp is not written correctly or I am not dragging the correct values to the graph.1. I have to show how many times the values were reported between dates selected by the user eg issue1was reported 2 times on the 19/02/2009 by Sarah Black and kb user and once on the 18/02/2009 by Support Agent.2. In the line chart the user may want to compare how many times each DisplayName (i.e. agent) reported values between certain dates. 3. There are more options that the user might want to see such as how many times a certain value was reported between certain dates and the fluctuations.Code for pie chart<?xml version="1.0" encoding="utf-8"?><Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner"> <DataSources> <DataSource Name="dsReportIssue"> <rd:DataSourceID>e19d53d5-6606-4244-982e-13ea0b0b7f1f</rd:DataSourceID> <DataSourceReference>dsReportIssue</DataSourceReference> </DataSource> </DataSources> <InteractiveHeight>11in</InteractiveHeight> <ReportParameters> <ReportParameter Name="date_from"> <DataType>DateTime</DataType> <DefaultValue> <Values> <Value>02/02/2009</Value> </Values> </DefaultValue> <Prompt>date_from</Prompt> <Hidden>true</Hidden> </ReportParameter> <ReportParameter Name="date_to"> <DataType>DateTime</DataType> <DefaultValue> <Values> <Value>03/03/2009</Value> </Values> </DefaultValue> <Prompt>date_to</Prompt> <Hidden>true</Hidden> </ReportParameter> <ReportParameter Name="app_id"> <DataType>Integer</DataType> <DefaultValue> <Values> <Value>0</Value> </Values> </DefaultValue> <AllowBlank>true</AllowBlank> <Prompt>app_id</Prompt> <ValidValues> <DataSetReference> <DataSetName>dsApplication</DataSetName> <ValueField>App_id</ValueField> <LabelField>Application</LabelField> </DataSetReference> </ValidValues> <Hidden>true</Hidden> </ReportParameter> <ReportParameter Name="subject_id"> <DataType>Integer</DataType> <DefaultValue> <Values> <Value>0</Value> </Values> </DefaultValue> <AllowBlank>true</AllowBlank> <Prompt>subject_id</Prompt> <ValidValues> <DataSetReference> <DataSetName>dsSubject</DataSetName> <ValueField>Subject_id</ValueField> <LabelField>Subject</LabelField> </DataSetReference> </ValidValues> <Hidden>true</Hidden> </ReportParameter> <ReportParameter Name="issue_id"> <DataType>Integer</DataType> <DefaultValue> <Values> <Value>0</Value> </Values> </DefaultValue> <AllowBlank>true</AllowBlank> <Prompt>issue_id</Prompt> <ValidValues> <DataSetReference> <DataSetName>dsIssue</DataSetName> <ValueField>bug_id</ValueField> <LabelField>bug</LabelField> </DataSetReference> </ValidValues> <Hidden>true</Hidden> </ReportParameter> <ReportParameter Name="agent"> <DataType>Integer</DataType> <DefaultValue> <Values> <Value>0</Value> </Values> </DefaultValue> <AllowBlank>true</AllowBlank> <Prompt>agent</Prompt> <ValidValues> <DataSetReference> <DataSetName>dsAgent</DataSetName> <ValueField>ID</ValueField> <LabelField>DisplayName</LabelField> </DataSetReference> </ValidValues> <Hidden>true</Hidden> </ReportParameter> </ReportParameters> <rd:DrawGrid>true</rd:DrawGrid> <InteractiveWidth>8.5in</InteractiveWidth> <rd:GridSpacing>0.25cm</rd:GridSpacing> <rd:SnapToGrid>true</rd:SnapToGrid> <RightMargin>2.5cm</RightMargin> <LeftMargin>2.5cm</LeftMargin> <BottomMargin>2.5cm</BottomMargin> <rd:ReportID>ad740dce-f4ab-4595-a0a0-d32cf3a3bcb0</rd:ReportID> <PageWidth>21cm</PageWidth> <DataSets> <DataSet Name="dsReportIssue"> <Fields> <Field Name="total"> <DataField>total</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="Value"> <DataField>Value</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="date_reported"> <DataField>date_reported</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> <Field Name="DisplayName"> <DataField>DisplayName</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> </Fields> <Query> <DataSourceName>dsReportIssue</DataSourceName> <CommandType>StoredProcedure</CommandType> <CommandText>IM_ChartReport</CommandText> <QueryParameters> <QueryParameter Name="@date_from"> <Value>=Parameters!date_from.Value</Value> </QueryParameter> <QueryParameter Name="@date_to"> <Value>=Parameters!date_to.Value</Value> </QueryParameter> <QueryParameter Name="@subject_id"> <Value>=Parameters!subject_id.Value</Value> </QueryParameter> <QueryParameter Name="@app_id"> <Value>=Parameters!app_id.Value</Value> </QueryParameter> <QueryParameter Name="@issue_id"> <Value>=Parameters!issue_id.Value</Value> </QueryParameter> <QueryParameter Name="@agent"> <Value>=Parameters!agent.Value</Value> </QueryParameter> </QueryParameters> <rd:UseGenericDesigner>true</rd:UseGenericDesigner> </Query> </DataSet> <DataSet Name="dsApplication"> <Fields> <Field Name="App_id"> <DataField>App_id</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="Application"> <DataField>Application</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> </Fields> <Query> <DataSourceName>dsReportIssue</DataSourceName> <CommandText>select App_id,Application from dbo.IM_Application where status=1 union select 0 as App_id,' All' as application order by application</CommandText> <rd:UseGenericDesigner>true</rd:UseGenericDesigner> </Query> </DataSet> <DataSet Name="dsSubject"> <Fields> <Field Name="Subject_id"> <DataField>Subject_id</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="Subject"> <DataField>Subject</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> </Fields> <Query> <DataSourceName>dsReportIssue</DataSourceName> <CommandText>SELECT IM_Subject.[Subject_id], [Subject] FROM [IM_Subject] inner join IM_Subj_App on IM_Subj_App.Subject_id=IM_Subject.Subject_id where (App_id=@app_id or @app_id = 0) UNION SELECT 0 as subject_id, ' All ' AS Subject</CommandText> <QueryParameters> <QueryParameter Name="@app_id"> <Value>=Parameters!app_id.Value</Value> </QueryParameter> </QueryParameters> <rd:UseGenericDesigner>true</rd:UseGenericDesigner> </Query> </DataSet> <DataSet Name="dsIssue"> <Fields> <Field Name="bug_id"> <DataField>bug_id</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="bug"> <DataField>bug</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> </Fields> <Query> <DataSourceName>dsReportIssue</DataSourceName> <CommandText>SELECT im_bugs.bug_id,bug from dbo.IM_Bugsinner join dbo.IM_Subj_App_Bugon IM_Subj_App_Bug.bug_id=im_bugs.bug_idwhere (IM_Subj_App_Bug.app_id=@app_id or @app_id=0)and (dbo.IM_Subj_App_Bug.subj_id=@subject_id or @subject_id=0) UNION SELECT 0 as bug_id, ' All ' AS bug</CommandText> <QueryParameters> <QueryParameter Name="@app_id"> <Value>=Parameters!app_id.Value</Value> </QueryParameter> <QueryParameter Name="@subject_id"> <Value>=Parameters!subject_id.Value</Value> </QueryParameter> </QueryParameters> <rd:UseGenericDesigner>true</rd:UseGenericDesigner> </Query> </DataSet> <DataSet Name="dsAgent"> <Fields> <Field Name="ID"> <DataField>ID</DataField> <rd:TypeName>System.Int32</rd:TypeName> </Field> <Field Name="DisplayName"> <DataField>DisplayName</DataField> <rd:TypeName>System.String</rd:TypeName> </Field> </Fields> <Query> <DataSourceName>dsReportIssue</DataSourceName> <CommandType>StoredProcedure</CommandType> <CommandText>IM_Agents</CommandText> </Query> </DataSet> </DataSets> <Width>37.24868cm</Width> <Body> <ColumnSpacing>1cm</ColumnSpacing> <ReportItems> <Chart Name="chart3"> <Legend> <Visible>true</Visible> <Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> <Position>RightCenter</Position> </Legend> <CategoryAxis> <Axis> <Title /> <MajorGridLines> <ShowGridLines>true</ShowGridLines> <Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </MajorGridLines> <MinorGridLines> <Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </MinorGridLines> <MajorTickMarks>Outside</MajorTickMarks> <Min>0</Min> <Visible>true</Visible> </Axis> </CategoryAxis> <ZIndex>1</ZIndex> <DataSetName>dsReportIssue</DataSetName> <PlotArea> <Style> <BackgroundColor>LightGrey</BackgroundColor> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </PlotArea> <ThreeDProperties> <Enabled>true</Enabled> <Rotation>30</Rotation> <Inclination>30</Inclination> <Shading>Simple</Shading> <WallThickness>50</WallThickness> </ThreeDProperties> <PointWidth>0</PointWidth> <Top>0.39375in</Top> <Subtype>Exploded</Subtype> <ValueAxis> <Axis> <Title /> <MajorGridLines> <ShowGridLines>true</ShowGridLines> <Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </MajorGridLines> <MinorGridLines> <Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </MinorGridLines> <MajorTickMarks>Outside</MajorTickMarks> <Min>0</Min> <Margin>true</Margin> <Visible>true</Visible> <Scalar>true</Scalar> </Axis> </ValueAxis> <Type>Pie</Type> <Width>6.98906in</Width> <CategoryGroupings> <CategoryGrouping> <DynamicCategories> <Grouping Name="chart3_CategoryGroup2"> <GroupExpressions> <GroupExpression>=Fields!Value.Value</GroupExpression> </GroupExpressions> </Grouping> <Label>=Fields!Value.Value</Label> </DynamicCategories> </CategoryGrouping> <CategoryGrouping> <DynamicCategories> <Grouping Name="chart3_CategoryGroup1"> <GroupExpressions> <GroupExpression>=Fields!DisplayName.Value</GroupExpression> </GroupExpressions> </Grouping> <Label>=Fields!DisplayName.Value</Label> </DynamicCategories> </CategoryGrouping> </CategoryGroupings> <Palette>SemiTransparent</Palette> <ChartData> <ChartSeries> <DataPoints> <DataPoint> <DataValues> <DataValue> <Value>=Sum(Fields!total.Value)</Value> </DataValue> </DataValues> <DataLabel> <Value>=Fields!total.Value & "times " & vbcrlf & Fields!date_reported.Value</Value> <Position>Top</Position> <Visible>true</Visible> </DataLabel> <Marker> <Size>6pt</Size> </Marker> </DataPoint> </DataPoints> </ChartSeries> </ChartData> <Style> <BackgroundColor>White</BackgroundColor> </Style> <Title /> <Height>3in</Height> </Chart> <Textbox Name="textbox1"> <rd:DefaultName>textbox1</rd:DefaultName> <Width>11in</Width> <Style> <Color>Navy</Color> <FontFamily>Tahoma</FontFamily> <FontSize>18pt</FontSize> <FontWeight>700</FontWeight> <PaddingLeft>2pt</PaddingLeft> <PaddingRight>2pt</PaddingRight> <PaddingTop>2pt</PaddingTop> <PaddingBottom>2pt</PaddingBottom> </Style> <CanGrow>true</CanGrow> <Height>0.8381cm</Height> <Value>Total times issues reported</Value> </Textbox> </ReportItems> <Height>34.11905cm</Height> </Body> <Language>en-GB</Language> <TopMargin>2.5cm</TopMargin> <PageHeight>29.7cm</PageHeight></Report>
Can someone please guide me on how to create a pie/line chart?I am at a complete loss.ThanksWhisky-my beloved dog who died suddenly on the 29/06/06-I miss u so much.