or
private
void
chart1_NeedDataSource(
object
sender, EventArgs e)
{
var dataset =
new
DataSet();
var adapter =
new
SqlDataAdapter();
var conn =
new
SqlConnection(
"Initial Catalog=****;Data Source=****;User Id=****;Password=****;"
);
var cmd =
new
SqlCommand
{
Connection = conn,
CommandType = CommandType.Text,
CommandText =
@"SELECT raisedBy,
COUNT(id)
as
counter,
createdon FROM
(
SELECT
da.name
as
raisedBy,
defects.id,
convert(VARCHAR, defects.created_on, 102)
AS
createdon
FROM
defects
LEFT JOIN
[user] da
ON
(defects.raised_by = da.id)
WHERE
defects.id IN(488,490,491,492,493,494,495,496,497,498,499,500,501,502,504,505,506,508,509,511,512,513,514,515,516,517,518,519,520,521,523,524,526,528,529,530,535,536,537,538,539,540,541,542,543,544,545,546,547)
)
table1
GROUP BY
raisedBy,
createdon
ORDER BY createdon ASC"
};
adapter.SelectCommand = cmd;
adapter.Fill(dataset);
DataView view = dataset.Tables[0].DefaultView;
//var chart = sender as Chart;
chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = -320;
chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color = Color.BlueViolet;
chart1.PlotArea.XAxis.DataLabelsColumn =
"createdon"
;
chart1.DataGroupColumn =
"raisedBy"
;
chart1.PlotArea.XAxis.IsZeroBased =
false
;
chart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Reporting.Charting.Styles.ChartValueFormat.ShortDate;
chart1.PlotArea.XAxis.Appearance.CustomFormat =
"MM/dd/yyyy"
;
chart1.PlotArea.XAxis.LayoutMode = Telerik.Reporting.Charting.Styles.ChartAxisLayoutMode.Between;
chart1.PlotArea.XAxis.LabelStep = 1;
chart1.PlotArea.XAxis.MaxItemsCount = view.Count;
foreach
(DataRowView rowView
in
view)
{
var datedate = DateTime.Parse(rowView.Row.ItemArray[2].ToString());
rowView.Row.ItemArray[2] = datedate;
}
if
(chart1 !=
null
) chart1.DataSource = view;
}
Typically when you create this report and expand a particulat row during the drilldown( toggle) it will expand horizontally.
Is to possible to expand it vertically, so that actual page size remains fixed and report can grow in height.
See the layout of report in the attached file.
Any suggstion how this can be accomplished.