Telerik Forums
Reporting Forum
3 answers
117 views
Hi, I've got a sqldataadapter that retrieves a field from a stored procedure for a given report parameter and populates a textbox with this value that works fine, but if I enter a value in the report parameter that hasn't got a row in the database and returns 0 rows in the stored procedure I get the error "An error has occured while processing textbox "Textbox1", index was out of range, must be non negative and less than the size of the collection."

Is there a way of checking for returned rows in the expression, and if empty put in a default value.

Thanks a lot.
Steve
Telerik team
 answered on 12 Jun 2009
3 answers
121 views
Hi
When there is only 1 small attribute (say name or date) in detail section it's not very efficent to repeat the whole row for each item (most of the row would be blank).
It would rather by nice to repeat the items "inline" or in principle have the items concated to a larger textbox. Right now I have been able to do it (the concatenation) upfront customising the data preparation. Maybe that is possible out of the box in reporting? Thank you.
Svetoslav
Telerik team
 answered on 11 Jun 2009
7 answers
248 views
I've been using Active Reports in my applications for many years but recently instead of upgrading to the new versions I decided to look at other options. I found Telerik and was quite impressed with many of the features. I like the way the reports can render in Winforms and the Web along wiht a number of other things. I downloaded a trial and set about building several reports to make sure I can reproduce all the features I used to get from Active Reports before jumping ship. I found the reports side of things quite good although I did have some issues trying to get a simple date field to display by setting a format on the properties of the field.

Anyway, when I got to the report that needed to have a chart I became frustrated. I just wanted to bind a simple chart to the same data source as my report and I foudn this was not easy to do. I searched through all the documentation and tutorials and found there is very little explanation on how to data bind a chart. The examples show binding to a data adaptor or a data table but it doesn't say how the data should be structured to bind it to the report. I tried copying from some of the samples but I can't get a simple chart to show any data. 

I gave up trying to bind to my report data source adn tried to create an independant data sourtce to bind to. I am trying to bind to an Access database using OLDB.

I got down to the most simple code but every time I try to run the report it just sits there displaying "Generating report" forever. There is no error message and no clue as to why it doesn't work. I'm just guessing at the SQL I thougth i'd put two simple fields in and it might bind to them.

Here's the code:
Private Sub ChartDailyTotals_NeedDataSource(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChartDailyTotals.NeedDataSource
        Try
            Dim Mychart As Telerik.Reporting.Processing.Chart = TryCast(sender, Telerik.Reporting.Processing.Chart)
            Dim commandText As String = "SELECT top 5 TriggerDate, TriggerCount from triggers"
            Dim MyAdapter As New OleDb.OleDbDataAdapter(commandText, My.Settings.WinCounterReportsDataConnection)
            Dim MyDataSet As New DataSet()

            MyAdapter.Fill(MyDataSet)
            Mychart.DataSource = MyDataSet
        

Catch ex As System.Exception
            System.Diagnostics.Debug.WriteLine(ex.Message) 
        End Try
    End Sub


I don't give up easily but I've been trying to do this for two days. If I don't get an answer soon I will have to go back to Active Reports. It's a shame because I really liked what Telerik had to offer.

Perhaps someone can point me to some documentation or show me what I should do.


Ves
Telerik team
 answered on 10 Jun 2009
11 answers
325 views
Hello,

I'm currently evaluating telerik reporting and made some simple reports. When I preview the report using the designer then reports looks okay and properly aligned, but when I view it with HTML in the designer of using a web reportviewer, it gets mis-aligned, is this because I'm using a trial version?

also just a followup question, is it possible to change the unit of measure in design time, from inches to millimeter?

Thanks
Chavdar
Telerik team
 answered on 10 Jun 2009
1 answer
193 views
Hi,

I have Telerik Reporting  Q3 2008 SP2(2.9.9.202).  
I am trying to create a report book for a group of reports. And i don't whether this version supports report book or not. I was going through some documentation i find that there is one control that places Report Book in the tools column of report viewer.  Right now i am not finding this control in my toolbox. I think this comes with the version Q1 2009.

Please tell me how to get this Report book control and how to create report book. I just extracted some code from the document to create report book but i cannot able to access the properties.

Imports System.ComponentModel 
 
<Description("A collection of Product-related reports")> _ 
Public Class ReportBook 
    Inherits Telerik.Reporting.ReportBook 
    Public Sub New() 
        Me.Reports.Add(New DashBoard()) 
        Me.Reports.Add(New ProductSales()) 
        Me.Reports.Add(New ProductCatalog()) 
        Me.Reports.Add(New ProductLineSales()) 
    End Sub 
End Class 

Thanks.

Regards
Syed Arshad
Svetoslav
Telerik team
 answered on 08 Jun 2009
1 answer
262 views
Hi,
I have a trouble displaying a value in a TextBox.
I found simmilar post but unfortunately the link for it is broken (http://www.telerik.com/community/forums/reporting/telerik-reporting/assigning-datatable-column-to-textbox.aspx)

 Here is my setup:

On a web form I do the following:
BusinessObjects.ProjectStatementReportCollection collection = new BusinessObjects.ProjectStatementReportCollection(); 
collection.Query.Where(collection.Query.ProjectStatementReportId == projectStatementReportId); 
DataTable dt = collection.Query.LoadDataTable(); 
ProjectStatementReport report1 = new ProjectStatementReport(); 
report1.DataSource = dt
ReportViewer1.Report = report1
BusinessObjects is a EntitySpaces's object.

In the report designer in the detail section (on panel, list control) I have a TextBox with its value set to "=Construction_Mgmt_In".
This text box's value is not being displayed.
However in ItemDataBound for the detail item I can assign textbox's value in the following way.
private void detail_ItemDataBound(object sender, EventArgs e) 
      Telerik.Reporting.Processing.DetailSection section = (Telerik.Reporting.Processing.DetailSection)sender; 
      System.Data.DataRow row = (System.Data.DataRow)section.DataObject.RawData; 
      Telerik.Reporting.Processing.TextBox procTextbox = (Telerik.Reporting.Processing.TextBox)section.ChildElements.Find("textBox2", true)[0]; 
      procTextbox.Value = row["Construction_Mgmt_In"].ToString(); 
 

I would like to be able to specify TextBox value in the designer rather than through item's ItemDataBound event.
Also do you know how to set up EntitySpaces' esDataSource as a DataSource for the report?

Thank you,
Pawel Mozdzen
Svetoslav
Telerik team
 answered on 08 Jun 2009
1 answer
153 views

Hi

     I am new in telerik reporting I create simple report for our compnay employee details

1)  how to use telerik reporting in web application

     i got one code from telerik site but  i cant create sqldatasource in that class ( i think its only support in web)

using System;
using Telerik.Reporting.Chart;

  
public partial class Report1 : Report
   {
       
public Report1()
       {
           
/// <summary>
           
/// Required for telerik Reporting designer support
           
/// </summary>
           
InitializeComponent();

           
// create a datasource
           
SqlDataSource sqlDataSource = new SqlDataSource();
           sqlDataSource.ID =
"myDataSource";
           sqlDataSource.ConnectionString =
           ConfigurationManager.ConnectionStrings[
"NorthwindConnectionString"].ConnectionString;
           sqlDataSource.SelectCommand =
           
"SELECT CategoryName, SUM(ProductSales) AS TotalSales FROM [Product Sales for 1997] GROUP BY CategoryName";
           
//setup chart
           
BuildChart();
       }
       
private void BuildChart()
       {
           
// assign it to Chart  
           
Chart1.DataSourceID = "myDataSource";
           
// Set the column for data and data labels:
           
// Each bar will show "TotalSales", each label along
           
// X-axis will show "CategoryName.
           
Chart1.Series[0].DataYColumn = "TotalSales";
           Chart1.PlotArea.XAxis.DataLabelsColumn =
"CategoryName";
           
// assign appearance related properties
           
Chart1.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 300;
           Chart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Color =
           System.Drawing.Color.BlueViolet;
           Chart1.PlotArea.Appearance.Dimensions.Margins.Bottom =
           Telerik.Reporting.Charting.Styles.Unit.Percentage(30);

       }
   }




2)  I have write code in  following event.But i cant give data source for that chart1

private

 

void chart1_NeedDataSource(object sender, EventArgs e)

 

{

 

}

3) I trying following code this code also throwing error like

An error has occured while processing Chart 'chart1':
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

 

private void chart1_NeedDataSource(object sender, EventArgs e)

 

{

Telerik.Reporting.Processing.

 

Chart chart = sender as Telerik.Reporting.Processing.Chart;

 

 

 

string command = "Select EmpId,Salary from tblemp";

 

 

 

SqlDataAdapter sqldataAdapter = new SqlDataAdapter(command, "Data Source=SVNSERVER;Initial Catalog=HR;User ID=sa;Password=Ava_123@");

 

 

 

DataSet ds = new DataSet();

 

sqldataAdapter.Fill(ds);

 

 

DataView dv = ds.Tables[0].DefaultView;

 

chart.DataSource = dv;

 

 

//this.DataSource = dv;

 

 

chart1.Series[0].PlotArea.XAxis.DataLabelsColumn =

"EmpName";

 

chart1.Series[0].PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = 330;

 

 

 

 

}

 


3) Finally i want  how to bind values from database to chart



Regards,

Friend
Ivan
Telerik team
 answered on 08 Jun 2009
3 answers
245 views
Hi, if I had two report names TotalReport1 and TotalReport2 in a combo box on a windows app, how can I show whichever one I want in a reportviewer at run time ? I had something like

ReportViewer testViewer = new ReportViewer();
testViewer.Report = ????

Do I have to populate the IReportDocument with the report name I choose in the combo box, if so does anyone know the syntax ?

Thanks a lot,

Pete.
Pete
Top achievements
Rank 1
 answered on 05 Jun 2009
2 answers
205 views
Hi, I have an empty winform that I add the controls dynamically at runtime, depending on the value in a dropdown.

If one of the options in the combobox is a telerik report I've already set up called Report1 how can I programmatically assign this to a new ReportViewer and add the ReportViewer control at runtime, is this possible ? Thanks
Pete
Top achievements
Rank 1
 answered on 05 Jun 2009
6 answers
330 views
Hi,

I've just installed Telerik Report Q1 2009, and now I'm having this problem.

In visual studio, I added a new item of Telerik Report Q1 2009 in my project. I could see the auto-generated code in Code mode, but when I switched to the design mode, it threw an exception on the opened design mode page, which said: Object reference not set to an instance of and object. In addition, when I run the Telerik Reporting Q1 2009 Demo Application, click one of the nodes in the left tree,say, Sales Dashboard, an error window pop up showing:

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.
Exception has been thrown by the target of an invocation.


When I clicked the "Details" button, it shows following details:
/*---------------------------------------------------------------------------------------------------------------------------------------------*/

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.ReportViewer.WinForms.WinViewer.UpdateScrollSize()
   at Telerik.ReportViewer.WinForms.WinViewer.OnSizeChanged(EventArgs eventArgs)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height)
   at System.Windows.Forms.Control.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.ScaleControl(SizeF factor, BoundsSpecified specified)
   at System.Windows.Forms.ScrollableControl.ScaleControl(SizeF factor, BoundsSpecified specified)
   at System.Windows.Forms.Control.ScaleControl(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.ContainerControl.Scale(SizeF includedFactor, SizeF excludedFactor, Control requestingControl)
   at System.Windows.Forms.ContainerControl.PerformAutoScale(Boolean includedBounds, Boolean excludedBounds)
   at System.Windows.Forms.ContainerControl.PerformNeededAutoScaleOnLayout()
   at System.Windows.Forms.ContainerControl.OnLayoutResuming(Boolean performLayout)
   at System.Windows.Forms.Control.ResumeLayout(Boolean performLayout)
   at Telerik.ReportViewer.WinForms.ReportViewerAreaBase.InitializeComponent()
   at Telerik.ReportViewer.WinForms.ReportViewerAreaBase..ctor()
   at Telerik.ReportViewer.WinForms.WinViewer..ctor()
   at Telerik.ReportViewer.WinForms.ReportViewer..ctor()
   at Telerik.Reporting.QuickStart.ReportViewerContainerControl.InitializeComponent()
   at Telerik.Reporting.QuickStart.ReportViewerContainerControl..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
   at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Telerik.QuickStart.WinControls.MainForm.NavigateToExample(ExamplesTreeNode treeNode)
   at Telerik.QuickStart.WinControls.MainForm.treeView1_AfterSelect(Object sender, TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
   at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
   at System.Windows.Forms.TreeView.WmNotify(Message& m)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
qsf
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///E:/Program%20Files/Telerik/Reporting%20Q1%202009/Examples/QuickStart/bin/qsf.exe
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
QuickStart
    Assembly Version: 2.5.1.0
    Win32 Version: 2.5.1.0
    CodeBase: file:///E:/Program%20Files/Telerik/Reporting%20Q1%202009/Examples/QuickStart/bin/QuickStart.DLL
----------------------------------------
Telerik.WinControls.UI
    Assembly Version: 2.5.1.0
    Win32 Version: 2.5.1.0
    CodeBase: file:///E:/Program%20Files/Telerik/Reporting%20Q1%202009/Examples/QuickStart/bin/Telerik.WinControls.UI.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
CSharp.ReportLibrary
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///E:/Program%20Files/Telerik/Reporting%20Q1%202009/Examples/QuickStart/bin/CSharp.ReportLibrary.DLL
----------------------------------------
Telerik.WinControls
    Assembly Version: 2.5.1.0
    Win32 Version: 2.5.1.0
    CodeBase: file:///E:/Program%20Files/Telerik/Reporting%20Q1%202009/Examples/QuickStart/bin/Telerik.WinControls.DLL
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.Design
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Design/2.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
System.Data
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Telerik.Reporting
    Assembly Version: 3.0.9.430
    Win32 Version: 3.0.9.430
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/Telerik.Reporting/3.0.9.430__a9d7983dfcc261be/Telerik.Reporting.dll
----------------------------------------
System.Drawing.Design
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Drawing.Design/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.Design.dll
----------------------------------------
TelerikCommon
    Assembly Version: 2.5.1.0
    Win32 Version: 2.5.1.0
    CodeBase: file:///E:/Program%20Files/Telerik/Reporting%20Q1%202009/Examples/QuickStart/bin/TelerikCommon.DLL
----------------------------------------
Microsoft.mshtml
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.0.3300.0
    CodeBase: file:///E:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
Telerik.ReportViewer.WinForms
    Assembly Version: 3.0.9.430
    Win32 Version: 3.0.9.430
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/Telerik.ReportViewer.WinForms/3.0.9.430__a9d7983dfcc261be/Telerik.ReportViewer.WinForms.dll
----------------------------------------
Telerik.Reporting.Processing
    Assembly Version: 3.0.9.430
    Win32 Version: 3.0.9.430
    CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/Telerik.Reporting.Processing/3.0.9.430__a9d7983dfcc261be/Telerik.Reporting.Processing.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

/*---------------------------------------------------------------------------------------------------------------------------------------------*/
My OS is windows XP professional SP3. But in my colleage's computer, which is Windows server 2003, there is no such problem.





Jason
Top achievements
Rank 1
 answered on 05 Jun 2009
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?