Can not for the life of me get a Report to run

13 posts, 1 answers
  1. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 15 Feb Link to this post

    I have been trying for almost a whole week to get a Telerik report to run.  I'm pretty sure, at this point figuring out nuclear fusion would be easier.  No matter what I do I get the following error:

    Cannot access the Reporting REST service. (serviceUrl = '/OmniCareApp/api/reports/'). Make sure the service address is correct and enable CORS if needed. (https://enable-cors.org)

     

    I have CORS enabled in my web.config

    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
      </customHeaders>
    </httpProtocol>     

     

    I can get this to run in a separate web project, but not when I try and integrate it into my legacy system.  I thought maybe it was because it was a web site and not a web project.  So, I created a web project and got the report to run.  Then I brought over all the legacy piece parts, and back to the above error.  Worst case scenario I can create a separate web site just for the purposes of serving up this one report, but then that's just one more thing I have to maintain.  Not the path I'd like to take.

    This should have been as easy as placing the Telerik Report Viewer on a form, telling it where the report was and boom...done!  You guys have complicated the ever loving crap out of this process.  I'm frustrated, and disappointed in this process at the same time.  

    At my wits end.  I like your reports.  The designer interface is easy to work with, but I never had these kind of problems with Crystal Reports.  

    Where do I go next?  For the love of god don't refer me to the multitude of white papers I've already been thru with a fine tooth comb.  I've also found fiddler to be as useless as hair on nipples.

  2. David
    David avatar
    124 posts
    Member since:
    Jan 2011

    Posted 15 Feb in reply to SSirica Link to this post

    You did not identify the framework used by your website.  Is it Asp.NET/Ajax or MVC oriented?  I suspect the later.

    To add a Report to a MVC project you must add the Web API toolkit to your project via NuGet.  You must construct a web service which will provide data to your report when that web service is called by the API you referenced in your "serviceURL".  The URL below should give you some help.  i fully admit it is very cryptic.

    https://docs.telerik.com/reporting/html5-report-viewer-quick-start

     

     

    Personally I liked the reports PRE-html5.  They were very painless.

     

  3. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 15 Feb in reply to David Link to this post

    My bad: Asp.Net/Ajax, .net 4.5, VS 2015, and latest Telerik version  2019, 1, 115, 45

    Like I said I've been thru about 15 white papers, so yes I did the web api nuget thing, and I have already been thru that quick start link.  Sounds like pre-html5 would have been the way I would have gone.  This API BS is for the birds.  

     

  4. David
    David avatar
    124 posts
    Member since:
    Jan 2011

    Posted 15 Feb in reply to SSirica Link to this post

    Uh, perhaps you have not tried this?  (It worked)

    Created brand new Telerik Web App (asp.net/Ajax C#) project.  TO that project I selected "Add New Item".  From that list, I selected "Telerik HTML5 Report Viewer Page R1 2019" (your flavor may vary).  It t hen asked a few questions.  I allowed it to create a new web service and use a default report.  That resulted in it adding the web api and all related items to my new test project.

    The "catch" is that it created a report with the ending of .trdp.  That is new to me.

    I then highlighted the "Html5ReportViewer.html" webpage that was added to my code and hit "run".  It ran as needed.

    Obviously more work is needed but that should give you a working project to reference.

  5. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 18 Feb in reply to David Link to this post

    i'm not trying to be a difficult a..hole, but I did say in my original post "I can get this to run in a separate web project, but not when I try and integrate it into my legacy system." 

    Just so I'm not spinning my wheels for too long that is the route I'm with going for now.  I'm not happy about it, but I need to move forward. 

  6. Todor
    Admin
    Todor avatar
    321 posts

    Posted 20 Feb Link to this post

    Hi SSirica,

    Based on the information in the thread I assume that the legacy project is a Web Site, not a Web Application. This is important, as Web Site projects cannot host the Telerik Reporting REST Service. The Web site may host the Html5 Viewer though. However, it will need a separate REST Service to host the Reporting engine - check HTML5 Report Viewer and Reporting REST services. CORS should be enabled in the REST Service. I have attached a short (muted) video demonstrating how to create one from scratch. The video can be played in a browser with installed flash plug-in.
    here is also a sample solution with WebSite with embedded Html5 Web Forms Report Viewer, and a separate REST Service project. The service is running on http://localhost:12345/api/reports. Check whether http://localhost:12345/api/reports/formats returns a JSON with the available rendering formats - this will indicate a working service.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 20 Feb in reply to Todor Link to this post

    Your assumption is 1/2 right.  The original project was a web site, but I took the time to convert it over to a web application and the result was exactly the same.  Thanks for including some samples to look at. 

    Truth be told, these reports are painful to work with.  They're fine for people who have something simple to do, but god forbid you want to do anything dynamically.  It was be easier to get out of one of Jigsaw's contraptions.  We have multiple clients that each have their own connection string based on what we call a market.  Each time one of these reports is run the connection string could be different.  Looks like if I create a shared connection string it gets saved in a user.config file at C:\Users\NameHere\AppData\Local\Progress_Software_Corpora\Telerik.ReportDesigner.ex_StrongName_xvg2ahozm2u22wxtsw2egsvlddrzt5hj\13.0.19.116...how does that translate to a deployed application?  There has to be a better way to tell the report where to get it's connection strings?  I tried going the route of passing in the connection string info as a parameter then setting the datasets connection string to the report parameter...the report laughed at me and spit in my face. 

    Every time I think I've turned a corner with this product another Trump sized Mexican wall goes up in my path. 

  8. Answer
    Todor
    Admin
    Todor avatar
    321 posts

    Posted 25 Feb Link to this post

    Hi SSirica,

    Thank you for the feedback. Indeed, there is a learning curve when starting with our product, and it will be necessary to get used to some specifics. I hope the resources provided with the previous post will help. The REST Service is the application where our Reporting engine is running, and it is a must for the Html5 Web viewers.

    Generally, the named connection string should be declared in the application configuration file, i.e. in an ASP.NET application, this would be the Web.config file. In the case of the Standalone designer, this would be the Telerik.ReportDesigner.exe.config file - by default in the (Telerik Reporting installation folder)\Report Designer (e.g. C:\Program Files (x86)\Progress\Telerik Reporting R1 2019\Report Designer).
    The data saved in the User's local folder is the cache of the designer that holds the last opened reports, the configured data connections, etc. It may be deleted and will be regenerated upon re-opening the designer. The only consequence will be that the designer will have no history of what has been recently opened/created.

    The approach we suggest for the multitenancy scenario is described in the Change Connection String dynamically through a report parameter KB article. The only scenario it cannot be used is when the Report Parameters get their Available Values from a SqlDataSource, which connection string should also be provided dynamically.

    You may consider opening a support ticket where to attach the project so that we may take a look at it and make more suggestions.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 25 Feb in reply to Todor Link to this post

    Between posts, I figured out that the design time and run time the connection strings are stored in different places.  And if I just a "Static" value it finds the connection strings perfectly fine, but when I use the method described in the above supplied link I get an error.  It doesn't matter what I send in the parameter whether it be the shared connection name or the full connection string I get an error everytime.  It's like the report can't figure out that Parameters.ConnStr.Value has the value "SAMP1" in it.  Like I said same results if I send an actual connection string.

    Either way, I've moved on.  I figured out that I can control the data that is feed to the report by using the Web Service Data Source.  The report has no connection worries it just processes what I give it. 


  10. Todor
    Admin
    Todor avatar
    321 posts

    Posted 28 Feb Link to this post

    Hi SSirica,

    Could you specify the error when providing the connection string through a report parameter?
    You may open a support ticket and send us the report with some sample database so that we can try to configure it for you.

    When using the designer the report is rendered in the context of the designer application, whereas when using a viewer the report is running in the context of the viewer or the Telerik Reporting REST Service that it uses. The connection string is read from the corresponding configuration file.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  11. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 28 Feb in reply to Todor Link to this post

    It doesn't matter, I went a different route.  I now feed the report via a Web Service Data Source.  I can control the data and the connection better. 

    What these reports need is better programatic access to their objects.  They are easy to design...they are not easy to work with if you operate in a dynamic environment.  We don't do anything static.  Our web apps are either hosted here or get deployed to our customers.  Almost every part of of our system is customizable by our customers, so no 2 setups are the same.  We have to program everything to be dynamic.  I finally got my report(Invoice) working the way I want it, but it was quite the struggle.  I took a few hours to design the report but like 2 weeks to tweak the right environment to get it to render properly.  

  12. Todor
    Admin
    Todor avatar
    321 posts

    Posted 05 Mar Link to this post

    Hello SSirica,

    Thank you for the feedback.
    Generally, we recommend designing a report with our dedicated Report Designers. We do not recommend modifications in reports with code run-time. We have provided other means for controlling the report layout dynamically. You may use Report ParametersExpressions, Bindings, Conditional Formatting.
    For the scenarios where the above approaches are not suitable, we have exposed the Telerik Reporting API. We agree that it may be necessary to expose more properties/methods of our objects. We would appreciate any particular scenario that cannot be achieved with the currently exposed API to help us decide what else to disclose.

    Regards,
    Todor
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  13. SSirica
    SSirica avatar
    83 posts
    Member since:
    Jan 2007

    Posted 05 Mar in reply to Todor Link to this post

    I'm not sure what post lead you to believe I was modifying reports via run-time code, but that couldn't be further from the truth.  It make me wonder if you actaully read the responses.  The only thing I was trying to set dynamically was the connection string.  I tried the methods you described above and not a single one of them worked as advertised...for my situation.  I'm sure they work like a charm for eveyone else.

    In football I think you would call my final solution an end around.  I stayed on the field and came up with my own creative solution and got the touchdown.

    I will mark one of your repsonses as the answer just to put this thread to rest.  

Back to Top