DataSource Configuration / ConnectionString

16 posts, 0 answers
  1. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 28 Aug 2012 Link to this post

    Hello!

    I'm playing around with the standalone designer and find the DataSource handling not really practical:

    First, when you create a DataSource, the Wizard offers to save it in the application configuration file, which is of course read-only if the desinger is installed somewhere under Program Files. Instead the standalone Designer should store this information in a per-user configuration.

    My scenario is to call the reports from my application, where the connection string changes depending on user input in a database connection dialog.
    In this case the handling of the different DataSource objects in the report items and subreports etc. is rather tedious.
    So far, I have to recursively find all Data Items in the report/subreports and change the connection string. This works as long as all items really use the same connection.

    The proposed workaround with defining a report parameter and using binding requires a lot of discipline from the designer, OK for a programmer but not really practical for "Powerusers".

    I would like to be able to define connections separately from sql statements (multiple DataSource objects using the same logical connection object)  and have these connections easily accessible in the designer UI and the API.

    Am I missing something?

    Regards
    Erwin

    BTW: really looking forward to being able to drop crystal report support from my application, as soon as the designer gets a bit more friendly for end users. Keep on with the great work!
  2. IvanY
    Admin
    IvanY avatar
    417 posts

    Posted 03 Sep 2012 Link to this post

    Hi Erwin,

    The proper way for adding predefined connection strings in an application is to use named connection strings which are added to the application configuration file. When you install Telerik Reporting the standalone designer is a single .exe with a config file. Each user can have his own exe file with the respective config file and use his own connection strings, which can also be predefined by the admin.

    Kind regards,
    IvanY
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  3. DevCraft banner
  4. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 05 Sep 2012 Link to this post

    Hi Ivan,

    connection strings in app.config is only usable for web apps or maybe when you use integrated security.
    Most desktop apps have to create the connection string dynamically based on user input.

    The problem with the designer .exe is that if you install it properly, the app.config file is read-only for ordinary users. I would like to distribute the designer with my Windows Forms Application.

    Regards
    Erwin
  5. tdemeza
    tdemeza avatar
    8 posts
    Member since:
    Apr 2007

    Posted 22 Sep 2012 Link to this post

    Erwin, I completely agree.  I just tried the very latest internal build of Q2 and I am unable to save a connection string.  I get a permission error.  Which is correct based on where it was attempting to be saved, in the Program Files (X86)\Telerik\Reporting Q2 2012\etc.This is not where user any data should go.

    I have also gone all the way through the new report wizard attempting to using a stored procedure.  Everything works great until I get to where I need to select my report fields in the wizard.  There is nothing there, Just the data source, no fields, even though on the previous screen I retrieved the fields and the data from the stored procedure just fine. 

    So... I am really confused. 

    I want to be able to create a report on my desktop, and then move the report to a server for on demand use by a windows service.  So far, this does not look feasible.  Everything relating to the report needs to be stored in the report configuarion file .trdx.  Then I can just drop that file where I need it. 

    I also want to be able to work with many data sources, such as retrieve the primary data from a stored proc and then link to a table in a sql data base for additional detail information.  This is readily available in other tools. 

    I have been waiting years for telerik to get this type of reporting nailed as they have with other products, but the reporting keeps floundering and will remain immature and unusablefor many users if these items are not addressed. 

    Thanks for letting me vent.
  6. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 22 Sep 2012 Link to this post

    Hi, thanks for your support.

    Don't know if the connection string should be stored in the trdx file as you suggest since the designer of the report often does not know the connection string required for production reports.

    What would be needed is:
    A way to define logical connections in the report which can then be referenced by the data sources. Typically a report will have multiple data sources (SQL Statements) but only one connection.
    A way to store needed connection info such as credentials and database name etc. per logical connection in the user context of the designer configuration (not the app.config file).
    A clean API to enumerate and possibly change just the connection info per report so that applications can easily change connection information at runtime.
    Inheritance for connection objects to sub reports.

    Another point:
    the wizard interface for changing the sql statement is a bit cumbersome, needs too many clicks when you just want to change the sql text.

    Also I had problems with Transact SQL code that used declare statements for variables. The variables were wrongly interpreted as parameters of the query.

    Regards
    Erwin
  7. Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 27 Sep 2012 Link to this post

    Hi guys,

    @erwin: First we would like to clarify that the ReportDesigner installed with Telerik Reporting is for you as a developer, and you're not supposed to install our product directly on your client machines. As you've already noted, the config file is readonly with the product installation, but when you distribute the ReportDesigner to your clients, you can make it writable. Our installation is per machine and all is shared between users, you can verify that by checking the rights to C:\Program Files\Telerik\Reporting Q2 2012\Examples folder, where we set full rights for Everyone.
    You can install it for your users as you consider best e.g. per user.

    Your description for "logical connection" is similar to what is implemented in the .NET framework. You can use ConfigurationManager to read/write configuration information in desktop applications as opposite to the WebConfigurationManager intended for use in web applications. In short, the ConnectionStringsSection is the answer to your requirements.

    In the upcoming release we will extend the ReportDesigner configuration with assembly references in order to enable UserFunctions in the report expressions and the possibility to use ObjectDataSource component. These configurations will be included in the ReportDesigner config file.

    @Tim: we're sorry to hear you're having hard time using our product. It would be best to open a support ticket with the exact problems you have hit and we would do our best to help you appropriately.

    Regards,
    Hrisi
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  8. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 28 Sep 2012 Link to this post

    Hi Hrisi,

    it's clear that I'm not allowed to install the full product on client machines. The requirement to have the designer.exe.config read-write for all users is just not practical on a client (non developer) machine. For example I would like to install the designer on a Terminal Server Machine for several concurrent Report Designers (that are currently using Crystal Reports mainly).
    IMHO during the design phase, data source connection string configuration should be user, not system based.

    The connection String section of AppConfiguration is usually not the answer for desktop connections. In most desktop scenarios you have to build the connection string dynamically based on user input. Also here, if your desktop app is installed on a multiuser system (Terminal Server for example) you usually have to provide per-user configuation of database connections.

    Even with the out-of the box installation on the developer machine, read-write to the designer app config is not practical. IMHO one should not have to fiddle with the permissions under %ProgrammFiles%. However, if I copy the exe to a user location to be able to modify the .exe.config, I have to think about the association for the report file suffix, otherwise doubleclick on a report definition file opens the designer in its read-only location.

    Regards
    Erwin


  9. Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 29 Sep 2012 Link to this post

    Hi erwin,

    The Telerik.ReportDesigner.exe is a standalone application and it cannot be embedded in another one. Thus the connection string can be entered by the user only through the SQL Data Source Configuration wizard. Entered connection string can be saved in Telerik.ReportDesigner.exe.config allowing to share it between reports or between DataSources in one report. But also can be saved as property of the ReportViewer.SqlDataSource.ConnectionString.

    With this in mind I suppose you have a problem using reports created with Telerik.ReportDesigner.exe. You can manipulate the reports in your application in run-time depending of the user input. For example the ConnectionStrings in the report can be changed in a couple of ways:
    • Changing the connection strings in your application config file if it is saved there.
    • Changing in the .trdx file in case it is saved as property of the SqlDataSource and ReportViewer.ReportSource is set to the UriReportSource.
    • Change in the report instance after deserializing the .trdx report. After that you should set ReportViewer.ReportSource to the InstanceReportSource containing the reference to the instance of the report.

    Kind regards,
    Hrisi
    the Telerik team

    BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

  10. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 29 Sep 2012 Link to this post

    Hi Hrisi,

    I'm aware of all that, and for developer use that's not much of a problem - just a nuissance - since most developers are local admins on their systems anyway ;-). But think of the scenario where the report designer is deployed with an application to the end user (power user). Enterprise Admins will not like this.
    Giving write permission to the installation directory is a no-no for well behaved apps and calls for a lot ot of support trouble. Also think of multi user / Terminal Server scenarios.
    I'm really looking forward to beeing able to distribute the report designer to end users, but currently that is not yet practical.

    Regards
    Erwin
  11. Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 04 Oct 2012 Link to this post

    Hello erwin,

    I would like to repeat what is the Telerik.ReportDesigner.exe.
    1. First of all it is a standalone desktop application.
    2. You can save the SqlDataSource connection string a)in the config file or b)in the edited report. This choices are represented in the SQL Data Source Configuration wizard.
    3. The deployment on the client is as simple as copy of one file Telerik.ReportDesigner.exe to whatever folder you want realizing per user or per machine installation.
    We did not understand what is special about "multi user / Terminal Server scenarios". Please, explain in more details what you expect in this case.

    Kind regards,
    Hrisi
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  12. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 04 Oct 2012 Link to this post

    Hi Hirsi,

    in an Enterprise Setting you simply don't want your users to copy .exe files around. You want centrally controlled, automated software Installations to be read-only in the Program Files Directory.
    You also want automated updates without having to send everybody a mail on how to copy the new .exe and change the file association for .trdx to point to their user specific location.

    Regards
    Erwin
  13. Sean Drun
    Sean Drun avatar
    6 posts
    Member since:
    Jun 2012

    Posted 20 Oct 2012 Link to this post

    Hi Hrisi,
    We are evaluating Telerik reporting tool to integrate into our web application.
    The primary criteria is -
    Developer design most major reports,
    End users can modify and save the reports, or create their own reports.
    Based on that, a standalone designer is required. It's OK if end user is required to buy standalone designer license.

    I downloaded Q3 2012, played with the standalone designer and felt it's not ideal to use -
    I save report layout to trdx file, set it to UriReportSource.Uri. Then set UriReportSource to web ReportViewer.
    Q1. In standalone designer, I cannot specify business object source.
    Q2. In web page, I cannot change database connection. The UriReportSource only expose Uri property.
        Our web application can handle different database providers. Report layout only care about report item binding
        to database fields. In most case, only table and column name are required.
        It is really nice we can switch report's db connection at run time.
        It is not pratical to save report to sql.trdx, oracle.trdx, mysql.trdx...
    Q3. Report data is not as simple as getting from database tables. In this case, we like end user use standalone
        designer design report layout based on database tables or define arbitrary dataset. At runtime, we can change binding to dataset.
        It would be nice, Telerik reporting can add dataset UI in standalone designer allow end user to define arbitrary data structure,
        load data from Excel or CSV file. At runtime, program can assemble dynamically created dataset and render the report.
        In another word, decouple report layout from back end data processing.
    Q4. I tried to use user function. But it ended up with run time error.
        How do I tell UriReportSource or ReportViewer to know my user function assembly.
        How do I hook itemdatabinding event to UriReportSource?

    Thanks,
    Sean Drun



  14. Jim Foster
    Jim Foster avatar
    6 posts
    Member since:
    Oct 2009

    Posted 23 Oct 2012 Link to this post

    Hi Sean,

    I also have just started evaluating using Telerik's Reporting module and have run across the same issue with the connection string, but I think I have a workaround for that at least. You are absolutly correct in that they don't expose the ConnectionString in the UriReportSource, so I don't use it. I deserialize the report file and then I can modify the connection string.

    This comes out of a WPF program, but I would guess it would be the same for the web.

        

    private void Window_Loaded_1(object sender, RoutedEventArgs e)
    {
        Report report;
        XmlReaderSettings settings;
        XmlReader xmlReader;
        ReportXmlSerializer xmlSerializer;
        SqlDataSource sqlDataSource;

        settings = new XmlReaderSettings();
        settings.IgnoreWhitespace = true;
        using (xmlReader = XmlReader.Create(@"..\..\TestReport1.trdx", settings))
        {
            xmlSerializer = new ReportXmlSerializer();
            report = (Report)xmlSerializer.Deserialize(xmlReader);
        }
        sqlDataSource = (SqlDataSource)report.DataSource;
        sqlDataSource.ConnectionString = "Data Source=MySQLServer;Initial Catalog=MyDatabase;Integrated Security=True";
        report.ReportParameters["ParamName"].Value = "Addr";
        SampleReportViewer.ReportSource = report;
    }


  15. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 24 Oct 2012 Link to this post

    Hello Sean,

    In Q3 2012 we have added support for ObjectDataSource components. In order to utilize you custom data layer and user functions you have to reference the assemblies as elaborated in the Extending Report Designer help article. The same reference should be added to the report viewers application configuration file so that the reporting engine may resolve the user functions and types used for the ObjectDataSource component.

    In Q3 2012 your user can use named connection strings. Thus providing the required connection string with the same name in the application configuration file should resolve your requirement. Still if this is not applicable for your scenario you can try the Jim's suggestion.

    Generally a royalty-free license for the standalone Report Designer is included with Telerik Reporting, which means you can distribute it freely to your end-users.

    Kind regards,
    Peter
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

  16. Jim Foster
    Jim Foster avatar
    6 posts
    Member since:
    Oct 2009

    Posted 24 Oct 2012 Link to this post

    Hello Peter,

    You said in your last post. "Generally a royalty-free license for the standalone Report Designer is included with Telerik Reporting, which means you can distribute it freely to your end-users."

    That's good to know, but how is this done? When I installed Telerik Reporting it was done via the Telerik Dashboard with my credentials. Can I simply copy the Telerik.ReportDesigner.exe can Telerik.ReportDesinger.exe.config some place an end user can access it?

    Thanks,
    Jim
  17. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 29 Oct 2012 Link to this post

    Hello Jim,

    Standalone report designer is a single EXE file, which simplifies its distribution, and does not require installation. The deployment on the client is as simple as copying Telerik.ReportDesigner.exe to whatever folder you want depending on per user or per machine installation.

    Greetings,
    Peter
    the Telerik team

    HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

Back to Top
DevCraft banner