0

I understand that this is not what SSRS is for, but I don't have the option of picking a tool. Ideally, nothing other than SSRS would be used.

We would like to implement commenting on our test reporting. What this means is that the user will click a button on a test, opening a comment subreport. I am trying to implement a subreport within this subreport with an input field, allowing the user to post a comment themselves.

From my understanding, SSRS only supports consuming user input through parameters, which I could use to populate a query that writes to the database. This is really less than ideal, since I would like the "submit" button to be inline. I'm really just looking to add an input and a submit button, which submits the input to our database. Trivial in html/javascript, seemingly impossible in SSRS.

Is it possible to extend an SSRS report to do this? What can I do to implement this requirement? Do I need to embed code / add a layer on top of the report to achieve this?

In other words, I require that the report be initially run, and then, optionally, for the user to be able to type in some text and hit "submit", which sends that text as a parameter to a subreport.

Daniel Paczuski Bak
  • 3,720
  • 8
  • 32
  • 78
  • We've done this numerous times. How sophisticated it is depends on you. If you want inline commenting or a popup you'll need to inject all kinds of javascript into the page. If you're happy with a button that goes off to a different page for data input then returns back to the original page, that is more easily achievable. Implementing a subreport is probably going to be tricky. Particularly around making sure that you don't do multiple posts of the same data – Nick.Mc Oct 25 '18 at 01:37
  • How did you do javascript injection? – Daniel Paczuski Bak Oct 25 '18 at 14:27
  • Is it possible to get javascript to run another report without going to that page? Basically just running the SQL transaction for the report? Really hope you get back to me!! – Daniel Paczuski Bak Oct 25 '18 at 16:55
  • It's quite possible that you could get javascript to use a "data entry" SSRS report as a "Web API" to enter data. You can do this but when you consider the complexity required and the unreliability/lack of validation it very quickly becomes more practical to just build an external web app that integrates with the SSRS report. The quickest way to get javascript into an SSRS report is like this: https://docs.microsoft.com/en-us/sql/reporting-services/report-design/add-html-into-a-report-report-builder-and-ssrs?view=sql-server-2017. The HTML you put ito your report is a html ` – Nick.Mc Oct 26 '18 at 01:38
  • What are the constraints around the data entry solution? The most straightfoward SSRS data entry solution uses the same stored procedure to provide report results _and_ perform data entry. So first you run the report _without_ providing values for the data entry parameters. The SP returns the dataset for the report. Inside your report you have a HTML link to a standard static web form. The person clicks the link which takes them to the HTML form where they enter the data. The POST part of the form posts off a SSRS web API for the same report except this time is has data entry values – Nick.Mc Oct 26 '18 at 01:43
  • The report runs again, entering the data values and providing the report as a result (most likely with your entered data now on it). That's the classic server side post approach. I also did a PoC using JqueryUI but it required a slight modification to an SSRS system file to add the `div` for the UI to attach to (in retrospect this was probably not required though) – Nick.Mc Oct 26 '18 at 01:45
  • So, from what I've researched, it seems like "interpret HTML" does not support to my report and indicated "interpret text with HTML" but it just displays nothing, and the script is not visible in the DOM. – Daniel Paczuski Bak Oct 29 '18 at 16:54
  • The constraints around the data entry solution is that there be an input box and a button embedded in the report. When the button is clicked, the text in the input box is inserted into a table, and the report is refreshed. I'm aware of how a SSRS query can insert into a table using a parameter, but I really need this inline button solution and it looks like the "interpret HTML" option does not support – Daniel Paczuski Bak Oct 29 '18 at 17:22
  • What I do know is that you can edit the SSRS template page back in the SSRS bin directory and add stuff to that and it will include it in every HTML page. So if you're fine with editing installed files and being unsupported, that is one option. I'll need to find my source code (from about three years ago) to do more investigation. I'm pretty sure I did get javascript working but I can't remember how until I find my source code. – Nick.Mc Oct 30 '18 at 01:37
  • I do know that I managed to craft a standard HTML form to post the correct URL to the SSRS web API to provide a form input value and run an SSRS report with that parameter value. In my case this form was an external HTML page. So you might be able to craft a html form without javascript in the page.... maybe – Nick.Mc Oct 30 '18 at 02:57

0 Answers0