This is a migrated thread and some comments may be shown as answers.

Error setting data source

24 Answers 1113 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rick0735
Top achievements
Rank 1
rick0735 asked on 25 Apr 2007, 11:51 PM
Using released, licensed version 1.0 of the report component, I follow (closely enough, I should think) the instructions in the help file's quickstart for creating a simple report. I connect to the AdventureWorks database, and enter a SQL statement to select all from the Production.Product table using the query builder. When I test, I get 500 +/- rows returned, so I "Finish" and close the datasource configuration wizard.

Step 15: Set the DataSOurce property for the Report component. I click the down-arrow on the datasource property line, and get a message: "Value does not fall within the expected range".

I've tried this with the trial version and the released version on two different machines, against SQL2005 and SQL2005Express. 

What am I missing? Thanks in advance.

24 Answers, 1 is accepted

Sort by
0
surfer
Top achievements
Rank 1
answered on 26 Apr 2007, 04:18 AM
deleted: wrong thread. sorry.
0
Rossen Hristov
Telerik team
answered on 26 Apr 2007, 12:58 PM
Hello rick0735,

We are currently researching the DataSource property issue. Until we find a solution and release a Service Pack to fix it, we would suggest the following workaround:

Since the data source cannot be set from the property grid, for now you will have to set it by hand in the report's constructor. After having created the data adapter, add the following code after the call to the InitializeComponent() method in the report's constructor:

this.DataSource = this.sqlDataAdapter1;

Assuming that your data adapter is called sqlDataAdapter1.

Also make sure that you have a reference to Telerik.Reporting.Processing in your project's Bin folder.

We will post back in the Forums once we have a clear picture of what exactly is happening. We are sorry for the inconvenience caused.
 

Sincerely yours,
Rossen
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
prismcarlson
Top achievements
Rank 1
answered on 28 Apr 2007, 03:44 AM
I am getting the exact same issue as I follow the quick start guide for a simple report. I will try the workaround as well. Just thought you might want to know.
0
andy
Top achievements
Rank 1
answered on 28 Apr 2007, 08:56 AM
sorry wrong thread
0
Ramey Chapman
Top achievements
Rank 1
answered on 01 May 2007, 03:35 PM
Have you guys seen any issues with adding the SQLDATASOURCE to the Telerik Reporting 1.0 tab.  In the report designer its grayed out when I check "show all" in the tab.
0
Svetoslav
Telerik team
answered on 02 May 2007, 11:52 AM
Hi Ramey,

We have already discussed  the SqlDataSource control in another forum thread - SQLDATASOURCE not showing up in Telerik Reporting 1.0 Tab.

Best wishes,
Svetoslav
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
FL-Developer
Top achievements
Rank 1
answered on 05 May 2007, 08:42 PM | edited on 20 Jun 2022, 02:46 PM
.
0
surfer
Top achievements
Rank 1
answered on 06 May 2007, 07:59 AM
Since the designer relies heavily on the schema of the datasource, I believe you need to setup a dummy datasource with the same schema (column types, several rows of data, etc) and use that datasource to design your report.

When deploying the reporting solution, you can use the NeedDataSource event to read your current datasource connection string / table name from web.config.

This applies for most databound controls I believe, e.g. grids, charts, etc - if you do not have at least a dummy datasource with the same schema, you cannot use a designer to format their apperance.
0
FL-Developer
Top achievements
Rank 1
answered on 06 May 2007, 08:27 AM
Thanks for the reply, valid workaround.  This workaround should have been posted more prominently.

 I think my post was more geared toward stating the fact that this is a major bug.  The report designers I work with live & breathe by using the GUI to create reports of hundreds of different fields.  Not many people are into taking that extra step in creating a dummy datasource (especially when that datasource is frequently changing).
0
Niki
Top achievements
Rank 1
answered on 07 May 2007, 01:14 PM
Sorry for the stupid question but what is a dummy datasource and how I can create and use it?
0
Svetoslav
Telerik team
answered on 07 May 2007, 04:48 PM
Hello bzburns,

Setting the data source of a report is obligatory as this is the only way to point where the report should get its data from. Of course you have the choice whether to set it while you're designing the report or at runtime just before rendering it. The advantage of having the data source defined in design time is that the report designer can obtain the schema of the data source and offer you an easier way to create bound report items. The other option is to bind all the items by hand - you don't need to set the data source in design time and you're responsible to set the proper item bindings.

You need to specify the data source the way that the report designer can use it. Otherwise it won't be able to obtain the needed information to fill the Data Explorer and you cannot use it to create bound items with drag and drop. However if you want to use the Data Explorer you should set a data source. Dummy data sources is one of the possible workarrounds if you don't want to specify a data source in design time.

 
All the best,
Svetoslav
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Robert Holguin
Top achievements
Rank 1
answered on 12 May 2007, 02:34 AM
can you give instructions on how to setup a dummy datasource and then drag and drop fields from the data explorer?
0
Harald Breidler
Top achievements
Rank 1
answered on 14 May 2007, 03:09 PM
Hi, I have the same problem and don't know how to create a dummy datasource and use it. Please can you help?

Thanks, Harry
0
Ivan
Telerik team
answered on 14 May 2007, 03:48 PM
Hello guys,

To use a dummy data source you should do some extra coding:

Derive a class from DataTable and add some columns inside its constructor. Rebuild the project to make the new class visible in Visual Studio:
// dummy data source class:
using System.Data;

public class MyDataTable : DataTable
{
public MyDataTable()
{
// add here all the columns your data source should have:
Columns.Add("Column1");
Columns.Add("Column2");
}
}

 
Add a data member of the derived (MyDataTable) DataTable type, instantiate it and associate it to the report's DataSource property. Here is the code snippet from the report class:

    partial class Report3
    {
        private void InitializeComponent()
        {
            table = new MyDataTable();
            ...
            this.DataSource = table;
            ...
        }
        ...
        private MyDataTable table;
    }

Now you can open your report in the report designer and use Data Explorer.

 
Regards,
Ivan
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Simon
Top achievements
Rank 1
answered on 17 May 2007, 09:21 AM
I hope you get this fixed really quickly!
What file and directory do I need to create the dummy datasource in for ASP.Net 2?
I've tried to create it as a class within the report, inside the report.cs. lt ok, then I added to InitializeComponent, rebuilt ok.
I get "Could not find type "ReportName+TableName". Please make sure that the assembly that contains the type is referenced" and a whole lot of error popups when I go into the designer.

0
Svetoslav
Telerik team
answered on 17 May 2007, 04:37 PM
Hi guys,

Attached you may find a sample project that demonstrates how to create and use a dummy data source from within a Web Site project. To run the project you should add references to the Telerik.Reporting.dll, Telerik.Reporting.Data.dll and Telerik.ReportView.WebForms.dll.

As you derive a class from the System.Data.DataTable you should place its code file under the App_Code folder as this the folder that ASP.NET scans for code files and compiles dynamically. Beside this it is good to rebuild your project so the Visual Studio can discover the new type and be able to load it when opening the report designer.

Here is a good place where you can learn more about the specifics of the Web Site Projects: http://msdn2.microsoft.com/en-us/library/ex526337(VS.80).aspx .

The "Dummy data source" approach as mentioned before is a possible way to make the Report designer aware of the data you're binding but without specifying a real data source. This is not much related to the Telerik Reporting Designer and you're free to implement in any way you want. The solution that we offer is just one of the possible options. 
 
In case any of you use an alternative solution, please feel free to post it here.


All the best,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Fredrick Smith
Top achievements
Rank 1
answered on 01 Jun 2007, 07:13 PM
Has this problem been solved?

I still have the problem and I need to work with the reports!

Thanks
0
MGrassman
Top achievements
Rank 2
answered on 01 Jun 2007, 07:22 PM
Or at least an ETA of a Service Pack.
0
peter rogers
Top achievements
Rank 1
answered on 01 Jun 2007, 07:54 PM
I am having the same problem, I have only just started looking at the Reporting Control to evaluate it for an important project, this is serious problem and has put me off the control, I don't have time to do code arounds when evaluating particularly when its such a vital part of the component.

Not very impressed!
0
FL-Developer
Top achievements
Rank 1
answered on 01 Jun 2007, 08:24 PM
I agree.  With this bug, the product is worthless to report designers. 

Telerik needs to release a patch to fix this particular problem rather than waiting for an entire service pack or release.
0
Robert Holguin
Top achievements
Rank 1
answered on 01 Jun 2007, 08:26 PM
I agree!
0
Svetoslav
Telerik team
answered on 02 Jun 2007, 07:47 AM
Hi guys,

The Service Pack 1 that we released yesterday fixes this problem. Please uninstall any previous version and install the SP (Telerik Reporting v1.1).

The "Value does not fall with in the expected range" problem appears only when the report resides in a Web Site. The Web Site project introduced with Visual Studio 2005 differs from all other project types quite a bit and is very specific. We advice our clients, if possible, to try separating the reports from the Web Site project and put them in a class library that the Site should use/reference.

Another possible solution is to use the old Web Application project that is available in the VS2005 with SP1.

Please, let us know if you still experience problems with these approaches in SP1. If so, please give us more details on the exact problem so that we can research it.

 
All the best,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Thomas
Top achievements
Rank 1
answered on 08 Feb 2008, 07:56 PM
Hi,

It appears I am running into the same problem and have installed the latest service pack.  Unfortuanetly I am unable to move my classes in my webproject to a class lib.  Do you have any other work arounds other than creating a dummy datasource class.

Regards,

tom
0
Svetoslav
Telerik team
answered on 11 Feb 2008, 09:00 AM
Hi tom,

Regarding the problems with the Web Site project, I am afraid that there is no other workaround except moving reports to a Class Library or an Web Application project.

Regards,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
rick0735
Top achievements
Rank 1
Answers by
surfer
Top achievements
Rank 1
Rossen Hristov
Telerik team
prismcarlson
Top achievements
Rank 1
andy
Top achievements
Rank 1
Ramey Chapman
Top achievements
Rank 1
Svetoslav
Telerik team
FL-Developer
Top achievements
Rank 1
Niki
Top achievements
Rank 1
Robert Holguin
Top achievements
Rank 1
Harald Breidler
Top achievements
Rank 1
Ivan
Telerik team
Simon
Top achievements
Rank 1
Fredrick Smith
Top achievements
Rank 1
MGrassman
Top achievements
Rank 2
peter rogers
Top achievements
Rank 1
Thomas
Top achievements
Rank 1
Share this question
or