or
Protected Sub btnDumpToExcel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDumpToExcel.Click Dim RunRpt As String = Me.ReportViewer1.Report.Reports(0).Name Dim tb As New DataTable(RunRpt) Dim dataConn As New SqlConnection Select Case RunRpt Case "evRptBehaviorChange" Dim report1 As Snap_EvalReports.evRptBehaviorChange = ReportViewer1.Report.Reports(0)
With report1 Dim xSQLDatasource As Telerik.Reporting.SqlDataSource = .DataSource Dim SQLConnectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings(xSQLDatasource.ConnectionString).ToString Dim xSelectCommand As String = xSQLDatasource.SelectCommand dataConn.ConnectionString = SQLConnectionString dataConn.Open() Dim sdc As SqlCommand = New SqlCommand(xSelectCommand, dataConn) sdc.CommandTimeout = LengthOfTimeOut sdc.CommandType = CommandType.StoredProcedure 'xSQLDatasource.SelectCommandType For Each p As Telerik.Reporting.SqlDataSourceParameter In xSQLDatasource.Parameters Dim xParam As SqlParameter = New SqlParameter(p.Name, p.GetType) sdc.Parameters.Add(xParam) Next ' ALTER PROCEDURE [dbo].[StoredProcedure1] '(@FiscalYearID int=3) sdc.Parameters.Item("@FiscalYearID").Value = CType(Session("spaFiscalYear"), Integer) Dim sda As SqlDataAdapter sda = New SqlDataAdapter(sdc) sda.Fill(tb) dataConn.Close() dataConn = Nothing XLSExport(tb, RunRpt) End With End SelectEnd Subprivate 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.