Telerik Forums
Reporting Forum
1 answer
112 views
All the examples and videos, talk about best practice and creating the reports in a separate class file.

All I want to do is create a few reports in an existing web app and run drive the reports from a stored proc. Are there any examples on how to do this.

Andy
Steve
Telerik team
 answered on 12 Jun 2009
1 answer
312 views
Hi,

I am using the latest version of Reporting (as of Jun6), I get this exception when tryign the view a report in the ReportVeiwer control. This is all windos based.
I have a report in a class library, the business object in another class library, and the executing Winforms app with the viewer in it.

Could not find any resources appropriate for the specified culture or the neutral culture.  Make sure "Telerik.Reporting.ExcelRendering.Excel97.ExcelReport.resources" was correctly embedded or linked into assembly "Telerik.Reporting.Processing" at compile time, or that all the satellite assemblies required are loadable and fully signed.

I can run sample apps from Telerik without problems, and I am using business object from one of your samples (Master-Detail sample from an earlier forum thread). That works fine when I create a new solution with the same structure, but does not work when using it in my existing solution.

Any idea why this can be?

I made sure all the references are there. But even the simplest, non-nested business object cannot be rendered into a report.

RptOrders

orders = new ObjDataSourceMasterDetail.Reports.RptOrders();

 

 

orders.DataSource = Order.CreateOrderList(); //taken from sample provided by Telerik

 

 

this.reportViewer1.Report = orders;

 

 

reportViewer1.RefreshReport(); //exception occurs after call to RefreshReport()

 


The report itself is simple. It has one textbox with "=Fields.OrderID" etc. and all that gets rendered correctly, but only after a series of exceptions come up, starting with the MissingManifestResourceException, then this is followed by a ArgumentOutOfRangeException, which is followed by a TargetInvocationException.
No stacktraces are available. In all 3 cases the stacktrace has only one less than helful line. There are no inner exceptions either.
I cannot narrow it down to a component or anything else.

I also made sure I have all the references that the sample project has, too. The sample works, renders the report perfectly, my my app doesn't.

Help!!!
Steve
Telerik team
 answered on 12 Jun 2009
3 answers
151 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
158 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
287 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
387 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
255 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
325 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
174 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
309 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
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?