on 12-20-2013 11:06 AM
How to change axis labels in crystal reports for asp.net at runtime?
please help
Thanks
Hello,
There are limited API's for charts.
You can only change the Title text.
This is how to:
CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ISCDReportClientDocument rcd = rpt.ReportClientDocument;
CrystalDecisions.ReportAppServer.ReportDefModel.ReportObjects chartObjects = rcd.ReportDefController.QueryChartObjects();
if (chartObjects.Count > 0)
{
CrystalDecisions.ReportAppServer.ReportDefModel.ChartObject oldChart = chartObjects[0] as CrystalDecisions.ReportAppServer.ReportDefModel.ChartObject;
CrystalDecisions.ReportAppServer.ReportDefModel.ChartObject newChart = (CrystalDecisions.ReportAppServer.ReportDefModel.ChartObject)oldChart.Clone(true);
newChart.ChartStyle.TextOptions.Title = "New Title";
try
{
rcd.ReportDefController.ModifyChartObject(oldChart, newChart);
MessageBox.Show("Success");
}
catch (Exception ex)
{
MessageBox.Show("Exception: " + ex.ToString());
//return;
}
//rcd.SaveAs(rcd.DisplayName, @"D:\Atest\749776\", 0);
//rcd.Close();
}
As for Axis Labels there are no API's.
There may be some ways to do this in the report itself. Post your question with details to the Report Design forum:
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.