Telerik Forums
Reporting Forum
9 answers
829 views
I've created a "Dynamic" Table at run time based on a DataTable populated via code.  The DataTable is binding to the Table in the report in the ItemDataBinding Sub.

Private Sub tblSolution1_ItemDataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles tblSolution1.ItemDataBinding
        Try
            Dim ds As New DataSet
            Dim dc As DataColumn
            Dim newDT As New DataTable
            'Changes datatable layout
            newDT = RestructureDataTable(MyDatatable)
            ds.Tables.Add(newDT)
            Dim processingTable As Telerik.Reporting.Processing.Table = sender
 
            Dim textboxGroup As Telerik.Reporting.TextBox
            Dim textBoxTable As Telerik.Reporting.TextBox
            Dim I As Integer
            I = 0
 
            tblSolution1.ColumnGroups.Clear()
            tblSolution1.Body.Columns.Clear()
            tblSolution1.Body.Rows.Clear()
 
            Dim tableGroupColumn As Telerik.Reporting.TableGroup
            Dim tableGroupRow As Telerik.Reporting.TableGroup
 
            For Each dc In ds.Tables(0).Columns
                tableGroupColumn = New Telerik.Reporting.TableGroup
                tblSolution1.Body.Columns.Add(New Telerik.Reporting.TableBodyColumn(Unit.Inch(0.5)))
 
                textboxGroup = New Telerik.Reporting.TextBox
                textboxGroup.Value = dc.ColumnName.ToString
                textboxGroup.Size = New SizeU(Unit.Inch(1.2), Unit.Inch(0.3))
                tableGroupColumn.ReportItem = textboxGroup
                tblSolution1.ColumnGroups.Add(tableGroupColumn)
 
                textBoxTable = New Telerik.Reporting.TextBox
                textBoxTable.Value = "=Fields." + dc.ColumnName
                textBoxTable.Style.BorderStyle.Default = Telerik.Reporting.Drawing.BorderType.Solid
                textBoxTable.Style.BorderWidth.Default = Unit.Pixel(1)
 
                tblSolution1.Body.SetCellContent(0, I, textBoxTable)
                I = I + 1
            Next
            tableGroupRow = New Telerik.Reporting.TableGroup
            tblSolution1.RowGroups.Add(tableGroupRow)
            tableGroupRow.Grouping.Add(New Telerik.Reporting.Data.Grouping)
            processingTable.DataSource = ds.Tables(0)
 
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub


I want to change the font and color of the text in the Table based on the value of the cell.  Such as if the value is less than 50 the text will be green above 50 text will be red. 

Please advise on how I might accomplish this?

Scott
Top achievements
Rank 2
 answered on 22 Sep 2010
3 answers
208 views
When running a report, my line chart displays fine, but when exporting the chart to any format (PDF, Excel, ect...) the lines on the graph no longer show up.  The graph itself appears along with the key, x-axis information, y-axis information, but the actual lines are missing.

The chart is being built programmatic.

This code passes in a telerik chart, and the corresponding text file.

Private Sub LoadChart(ByVal sFileName As String, ByRef sChart As Telerik.Reporting.Chart)
       Dim inFile As StreamReader = File.OpenText(sFileName)
       Try
           Dim j As Integer
           Dim sLine As String
           Dim sValues() As String
           Dim chartSeries() As Telerik.Reporting.Charting.ChartSeries
           Dim bFirstLoad As Boolean = False
           Dim yMax, yMin As Double
 
           Do While inFile.Peek <> -1
               sLine = inFile.ReadLine
               sValues = Split(sLine, vbTab)
 
               If UCase(Trim(sValues(0))) = "TEMPERATURE" Then
                   'Create an array of Series for length of value
                   'Create Chart Series Names
                   For j = 0 To sValues.Length - 1
                       ReDim Preserve chartSeries(j)
                       chartSeries(j) = New Telerik.Reporting.Charting.ChartSeries
                       If j > 0 Then
                           If sValues(j) <> "" Then
                               chartSeries(j).Name = sValues(j)
                               chartSeries(j).Type = Charting.ChartSeriesType.Line
                               chartSeries(j).Appearance.PointMark.Dimensions.Width = 1
                               chartSeries(j).Appearance.PointMark.Dimensions.Height = 1
                               chartSeries(j).Appearance.PointMark.FillStyle.MainColor = chartSeries(j).Appearance.LineSeriesAppearance.Color
                               chartSeries(j).Appearance.PointMark.Visible = True
                               chartSeries(j).DefaultLabelValue = ""
                               chartSeries(j).YAxisType = Charting.ChartYAxisType.Primary
                           End If
                       End If
                   Next
               ElseIf IsNumeric(sValues(0)) Then
                   For j = 0 To sValues.Length - 1
                       If sValues(j) <> "" Then
                           If j > 0 Then
                               If bFirstLoad = False Then
                                   If yMax = 0 Then
                                       yMax = CDbl(sValues(j))
                                   End If
                                   If yMin = 0 Then
                                       yMin = CDbl(sValues(j))
                                   End If
                                   bFirstLoad = True
                               End If
 
                               'Add the values to the chart series
                               chartSeries(j).AddItem(CDbl(sValues(j)))
 
                               chartSeries(j).Item(chartSeries(j).Items.Count - 1).XValue = CDbl(sValues(0))
                               chartSeries(j).Item(chartSeries(j).Items.Count - 1).YValue = CDbl(sValues(j))
 
                               chartSeries(j).Item(chartSeries(j).Items.Count - 1).ActiveRegion.Tooltip = CDbl(sValues(j))
 
                               'Update Min and Max Values
                               If yMin > CDbl(sValues(j)) Then
                                   yMin = CDbl(sValues(j))
                               End If
 
                               If yMax < CDbl(sValues(j)) Then
                                   yMax = CDbl(sValues(j))
                               End If
                           End If
                       End If
                   Next
               End If
           Loop
 
           For j = 0 To chartSeries.Length - 1
               If j > 0 Then
                   sChart.Series.Add(chartSeries(j))
               End If
           Next
 
           sChart.PlotArea.XAxis.AxisLabel.TextBlock.Text = "Temperature"
           sChart.PlotArea.XAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = Color.Black
           sChart.PlotArea.XAxis.Appearance.Visible = Charting.Styles.ChartAxisVisibility.True
           sChart.PlotArea.XAxis.VisibleValues = Charting.Styles.ChartAxisVisibleValues.All
           sChart.PlotArea.XAxis.Appearance.Width = 3
           sChart.PlotArea.XAxis.MinValue = 10
           sChart.PlotArea.XAxis.MaxValue = 100
           sChart.PlotArea.XAxis.LabelStep = 10
           sChart.PlotArea.XAxis.MaxItemsCount = 100 + 1
           sChart.PlotArea.XAxis.AutoScale = False
 
 
           sChart.PlotArea.YAxis.AxisLabel.TextBlock.Text = "Concentration"
           sChart.PlotArea.YAxis.AxisLabel.TextBlock.Appearance.TextProperties.Color = Color.Black
           sChart.PlotArea.YAxis.Appearance.Visible = Charting.Styles.ChartAxisVisibility.True
           sChart.PlotArea.YAxis.Appearance.Width = 3
           sChart.PlotArea.YAxis.IsZeroBased = False
           sChart.PlotArea.YAxis.VisibleValues = Charting.Styles.ChartAxisVisibleValues.All
           sChart.PlotArea.YAxis.MaxValue = yMax
           sChart.PlotArea.YAxis.MinValue = yMin
           sChart.PlotArea.YAxis.AutoScale = False
 
           sChart.ChartTitle.TextBlock.Text = "Concentration vs Temperature"
 
       Catch ex As Exception
           VOMsgBox(ex.ToString)
 
       Finally
           inFile.Close()
           inFile = Nothing
       End Try
   End Sub

Any Idea on why it doesn't display when exported?

Thanks,
-Scott Cline
Scott
Top achievements
Rank 2
 answered on 22 Sep 2010
1 answer
410 views
hello

i want to set the documentname as default name for download depending on the data i pass to the report.

i tried the following methods but without success:
1. to use a parameter in the constructor (not possible because in the constructor the parameters are not initalized),
2. use the datasource and a property of datasource(also not possible)
3. use a constructor with string parameter but the emtpy constructor is called afterwards and the documentname is still ""
4. set the documentname in prerender or pageload with a public method

how can i set the document name to a variable so the default download name appears correctly?

Steve
Telerik team
 answered on 22 Sep 2010
1 answer
141 views
I am using parameter report but when I am trying to access the report it throwing me following error
I am also passing parameter

   public FinancialAccountHistoryReport()
        {
            InitializeComponent();
            this.FinancialAccountHistoryReportViewer.RenderBegin += new RenderBeginEventHandler(FinancialAccountHistoryReportViewer_RenderBegin);
        }

        private void FinancialAccountHistoryReportViewer_RenderBegin(object sender, Telerik.ReportViewer.Silverlight.RenderBeginEventArgs args)
        {
            //single value parameter
            args.ParameterValues["SelectFiscalYear"] = "2010"; //single value parameter
            args.ParameterValues["SelectFiscalPeriod"] = "3";
        }

Please check attachment for error.
Steve
Telerik team
 answered on 22 Sep 2010
2 answers
161 views
I have searched through Telerik KB, Forums etc. and also Google. Yes, it is about the infamous "Operation could not be completed" error.

Most of the threads about the issue includes formatetc error too but in my case it is not true. I am just getting an "Operation could not be completed" error.

Here is the scenario:
  • Windows Vista with all updates
  • VS 2008
  • Telerik RadControls for ASP .NET AJAX Q3 2009 .Net 3.5
I have completed a web project within this environment. But I needed a reporting tool so I installed Telerik Reporting Q1 2009. I have developed a Class Library and tested my newly created reports. Everything was fine until I tried to add a ReporView into one of my web pages. I got "the" error.

To solve the problem (as suggested):
  • Re-Install Telerik Reporting
  • Reset Tool Box
  • Clean Asp .Net Cache
  • Restart VS/Computer
  • Add a couple of lines to web.config

Still the same.

Please, can anyone suggest something?
Kadir Kilicoglu
Top achievements
Rank 1
 answered on 22 Sep 2010
1 answer
305 views
I have a report with two charts on it.  The report has a particular datasource and the charts have a different datasource, but both charts use the same.  The Stored Procedure for the charts is called twice - once for each chart.  I was hoping to prevent this behavior.  Is there anyway to bind the 2nd charts datasource to the first chart?  I found this article:

http://www.telerik.com/community/forums/reporting/telerik-reporting/set-datasource-of-table-same-as-report-data-source.aspx

Which talks about sharing the Report's datasource.  I have not been able to figure out how to get two child objects (the charts) to share a datasource.  Any ideas out there?  Any tips greatly appreciated.

Thanks,

Sam
Peter
Telerik team
 answered on 22 Sep 2010
1 answer
363 views
Hi!  I've implemented a telerik report within a website.  The data for the report is being generated through a stored procedure in a MS SQL Server database which takes one parameter.  I have an aspx page with a Report Viewer control.  The dataset creation and databinding occurs in the code behind for the aspx page with the Report Viewer.  On another aspx page there is a button which loads the page with the Report Viewer.

The report loads without error and the data is present.  However the first time the report loads it takes several seconds before being displayed.  Any report displayed after that loads in less than a second.  Note - The value of the parameter for the stored procedure changes depending on what item the user decides to "view" so the data in the report varies depending on which item is selected.

Is there any way to speed up the initial loading of the report?

Thanks!
Steve
Telerik team
 answered on 22 Sep 2010
1 answer
93 views
version: Telerik_Reporting_Q2_2010_v4_1_10_714_dev.msi

I have a master report that links to a subreport similarly to what is done in the video: http://tv.telerik.com/watch/reporting/video/telerik-trainer-reporting-subreports

=======================================================
MasterReport

BlahID: {Fields.BlahId}
     ------------------------
     Subreport:

     Parameter Name   Parameter Value
     BlahId           =Fields.BlahId
=======================================================

=======================================================
Subreport

Report Parameters
   Members:
        BlahId Integer

DataSource: odsBlahDetail (object data source)
    This object returns data from a table with a WHERE clause that contains:
    
            WHERE BlahId=@BlahId
=======================================================

When I create the report without the subreport, everything works fine.  I get:

BlahID: 18
BlahID: 23
BlahID: 45
...

When I add the subreport in I get no report.  I ran some debugging and SQL profiler an determined that what is happening, is Telerik Reporting is in an infinite loop calling the subreport with the BlahID of 18 (the first one).

From what I can tell, I've set up my report the same as the above video, but since you don't post the source code for these videos, I can't definitively determine if I have...
Steve
Telerik team
 answered on 22 Sep 2010
2 answers
54 views
Hi guys this is my first post in this forum, and i have some problem ,

I'm working on project that involve a lot of reports and connecting it by sqlDatasource is not very efficient when changing the connection
because i have to change the connection  for each report.

my question is their any efficient way to connect to a stored procedure in one connection string for all reports something like a dataset in the DAL or BL and how?...

thanks in advance  
sahem
Top achievements
Rank 1
 answered on 21 Sep 2010
2 answers
113 views
Are there plans to support additional math functions like those available in System.Math class without creating custom user functions or is there an easier way to utilize these math functions in the expression builder?

Thanks
MD
Top achievements
Rank 1
 answered on 21 Sep 2010
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?