Error setting data source

25 posts, 0 answers
  1. rick0735
    rick0735 avatar
    10 posts
    Member since:
    Jan 2007

    Posted 25 Apr 2007 Link to this post

    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.
  2. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 25 Apr 2007 Link to this post

    deleted: wrong thread. sorry.
  3. DevCraft banner
  4. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 26 Apr 2007 Link to this post

    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
  5. chabian
    chabian avatar
    62 posts
    Member since:
    Sep 2005

    Posted 27 Apr 2007 Link to this post

    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.
  6. andy
    andy avatar
    2 posts
    Member since:
    Apr 2007

    Posted 28 Apr 2007 Link to this post

    sorry wrong thread
  7. Ramey Chapman
    Ramey Chapman avatar
    3 posts
    Member since:
    Mar 2006

    Posted 01 May 2007 Link to this post

    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.
  8. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 02 May 2007 Link to this post

    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
  9. bzburns
    bzburns avatar
    23 posts
    Member since:
    Apr 2007

    Posted 05 May 2007 Link to this post

    If we are to set the datasource programmatically, how can we design the report in the GUI by dragging table attributes to the report surface?
  10. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 06 May 2007 Link to this post

    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.
  11. bzburns
    bzburns avatar
    23 posts
    Member since:
    Apr 2007

    Posted 06 May 2007 Link to this post

    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).
  12. Niki
    Niki avatar
    5 posts
    Member since:
    May 2007

    Posted 07 May 2007 Link to this post

    Sorry for the stupid question but what is a dummy datasource and how I can create and use it?
  13. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 07 May 2007 Link to this post

    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
  14. Robert Holguin
    Robert Holguin avatar
    2 posts
    Member since:
    Jan 2007

    Posted 11 May 2007 Link to this post

    can you give instructions on how to setup a dummy datasource and then drag and drop fields from the data explorer?
  15. Harald Breidler
    Harald Breidler avatar
    7 posts
    Member since:
    Aug 2004

    Posted 14 May 2007 Link to this post

    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
  16. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 14 May 2007 Link to this post

    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
  17. Simon
    Simon avatar
    165 posts
    Member since:
    Oct 2004

    Posted 17 May 2007 Link to this post

    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.

  18. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 17 May 2007 Link to this post

    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
  19. Fredrick Smith
    Fredrick Smith avatar
    33 posts
    Member since:
    Feb 2007

    Posted 01 Jun 2007 Link to this post

    Has this problem been solved?

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

    Thanks
  20. MGrassman
    MGrassman avatar
    92 posts
    Member since:
    Apr 2007

    Posted 01 Jun 2007 Link to this post

    Or at least an ETA of a Service Pack.
  21. peter rogers
    peter rogers avatar
    1 posts
    Member since:
    Jul 2004

    Posted 01 Jun 2007 Link to this post

    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!
  22. bzburns
    bzburns avatar
    23 posts
    Member since:
    Apr 2007

    Posted 01 Jun 2007 Link to this post

    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.
  23. Robert Holguin
    Robert Holguin avatar
    2 posts
    Member since:
    Jan 2007

    Posted 01 Jun 2007 Link to this post

    I agree!
  24. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 02 Jun 2007 Link to this post

    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
  25. Thomas
    Thomas avatar
    1 posts
    Member since:
    Feb 2008

    Posted 08 Feb 2008 Link to this post

    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
  26. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 11 Feb 2008 Link to this post

    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
Back to Top
DevCraft banner