Tuesday, March 27, 2012
changing colors in charts
I'm trying to change the color of a chart region based on a report parameter
and I'm not having any luck. Can any one tell me where I change this? I see
all of the available color palattes, but I don't want to use those. The
regions need to be a specific color based on the report parameter option that
was choosen by the user.
ThanksYou will need RS 2000 with SP1 or later. In that case, you can control the
color of data points based on an expression. Please check the "Chart Styles"
section under 4.1.3 in the SP1 Readme:
http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"dataGirl" <dataGirl@.discussions.microsoft.com> wrote in message
news:324B9D30-B779-4402-9E68-9FC8FE0941FD@.microsoft.com...
> Hello,
> I'm trying to change the color of a chart region based on a report
> parameter
> and I'm not having any luck. Can any one tell me where I change this? I
> see
> all of the available color palattes, but I don't want to use those. The
> regions need to be a specific color based on the report parameter option
> that
> was choosen by the user.
> Thankssql
Sunday, March 25, 2012
Changing chart type at run-time
I'm coding a web application using ASP.NET 2.0 and I'd like to show users some charts allowing them to chose the chart type at run-time.
I'm building a rdlc (local) report source at run-time starting from a template and working in memory.
Users can select wich rows and columns from a table to display in the chart. They can also chose che chart type (Bar, line, pie etc.)
Now the code works fine the first time it's run. Then the report viewer keeps showing the chart with the same chart type and columns data. Only rows change accordingly to the user selection.
I'm using the following code to initialize the reportviewer:
Dim str As System.IO.MemoryStream = New MemoryStream
rptDoc.Save(str) //->that's the xml doc being saved to a memory stream
str.Position = 0
repView.LocalReport.ReportPath = String.Empty 'Just in case...
repView.LocalReport.LoadReportDefinition(str)
repView.LocalReport.DataSources.Clear() 'Just in case again...
repView.LocalReport.DataSources.Add(New ReportDataSource("DataSet1_01E01000", dt2))
repView.LocalReport.Refresh()
Any suggestion?
Thank you all.Can you share with me how you change the Chart Type at Runtime? Thanks!|||
Sorry for the late reply, I haven't checked forums lately.
As I said I'm building the rdlc (local) report source file at run-time starting from some templates.
The rdlc files are nothing more that XML files and the chart type is defined inside a node. All I do is put the desired type in the right node.
You can also build a rdlc right from scratch and pass it to the ReportViewer component via its LoadReportDefinition method using the overloaded version that gets a IO.Stream as source.
Ask me if you need a sample.
Bye.
You need to reset the report by doing a
ReportViewer1.Reset();//Then setting the datasource and all the properties.|||
Hello Stojilcoviz,
Can you share with me the sample of your code which changes the chart types at run-time in the RDLC? Thanks.