MVC Web API Report - json

Im trying to solve an issue in MVC4.
Background:
We have an existing asp.net web application where we have reports section. These are rdlc files with datasource and dataset configured to use an SP to populate the rows which is tied to an aspx view. All these are regular stuff. We have migrated the existing application to MVC rest based web app and apis. Here, the web app send/receive data in json format and used in view accordingly.
Problem to solve:
the data required for the report to show is coming from one of the rest apis which returns json object. The report (.rdlc) traditionally connects to a DB, but in my case, the data is in json. How will I go about mapping the json data to the report view?
Searched lot of forums for couple of days, no real success. Inputs greatly appreciated.

We have the same situation for our ASP.Net MVC application where the RESTful web services pass back JSON data to the front end applications. The MVC application doesn't just provide data, it applies business rules to the data before passing it back and these business rules can't be applied at the database level. So reporting is not straightforward.
We wanted to call these same web services to get the same data as the front end applications get. Fortunately SSRS is amazingly extensible. I created a custom data processing extension that calls our ASP.Net MVC controllers and returns the data, which is deserialised into datasets for use in the reports.
While not trivial, it isn't as hard as you might think and implementing a custom data processing extension is a good way to solve your problem. There are plenty of examples online to get you started. I based mine on the file share example provided with SSRS that queries a network folder and returns the file information as a dataset.

Related

What are my options for serving a dynamically generated PDF report as a download from an ASP.NET webserver?

I'm working on an application that stores a large amount of user-entered data in a MySQL DB regarding their performance in a competitive activity. We have a web interface that provides data visualization in the form of charts and graphs.
We're looking for a way to generate a PDF from a user's data using a provided UserID in our ASP.NET backend that users will be able to download.
The team's current thinking involves using a reporting tool like SSRS, generating the .rdl file from a template using the UserID, rendering the report as a PDF in the backend, and sending it to the user to download.
I'm very unfamiliar with report generation, but the more research I do, the more I wonder if a dynamic SSRS report is the right strategy for what we're trying to accomplish. If I were just doing this myself, I'd probably build a new view of the data using a print css stylesheet, but I'm not sure what the downsides to that strategy would be relative to building a report.

API for Reporting

Does the API enable the exporting of activity and task hours estimates (or other custom report data)?
I'm interested in building some custom reporting using exported data, and want to determine if it's worth the trouble to learn how to use the API.
If so, can anyone point me to the best source for how to use an API like this? I've used Microsoft APIs in the past where you just go to a website and it returns a CSV.
Thanks!

Sharepoint and Database interaction, what should I do?

I've developped a MySQL database containing informations about different documents and products. Now I have to create a user interface which has to be integrated in a sharepoint. As I'm new to sharepoint, I am a bit lost and I don't know what I should choose (developping a Web Application on visual studio which will be hosted on Sharepoint, developping a WebPart...etc I have no idea of what to do).
So my question is : What's the best option to develop this user interface on Sharepoint ?
Thanks
You can go different ways:
Push data from your MySQL database to SharePoint list periodically or event-based.
In this case you already have UI interface of SharePoint list view. If out-of-box UI not enough then you can create your own using javascript or by creating your own web part or by creating SharePoint add-in.
You can do it many ways:
1.1. C# console app (create with Visual Studio). Console app will connect to your SQL database and create list items in SharePoint list. You can schedule this console in Windows Task Scheduler.
1.2. Another periodically running code that external to your database. May be PowerShell script, SharePoint timerjob, Windows service, SharePoint workflow or something else. This code will connect to database and push data to SharePoint list.
1.3. I don't know how you fill your database but in your logic you can add logic to also create SharePoint list item in list when you add record to database.
It is event-based logic.
Get all data from your database in SharePoint on page load each time.
Add some web part to SharePoint that get data from your database on page load (you can mix some parts below to get intented behavior):
2.1. Create your own Visual Web Part in Visual Studio. Deploy solution with web part to SharePoint. Add web part to any page in SharePoint.
This web part will get data from your database on page load.
2.2. You can create web service hosted anywhere (SharePoint, another place) that return data from your database.
Create javascript logic that call this web service to get data and render data.
Add this javascript logic in Content Editor or Script Editor web part in SharePoint. CE and SE web parts is out-of-box web parts, you don't need to develop this.
2.3. Create SharePoint add-in that will get data from web service.
2.4. etc ....
May be I can suggest other options if you specify more precise requirements to implementation.
Just say how you see it in your imagination and I can suggest ways how to implement it.
Describe how it must be from user experience. Like 'I see page where I have three green buttons, color highlighted rows, auto-calculated field and so on and so on. I click button and get following result... ". Describe your expected user experience.
About trends - javascript rules now. In SharePoint Online you cannot create server code solutions hosted in SharePoint.
Best solution to use javascript to not change many things on migration to different version of SharePoint.

Dynamic Report creation

I hope someone here can help.
I have a requirement from my client who is an ISV. They want to develop a solution whereby they want to offer their customer an ability to create any reports from the customer specific database.
What I mean is, we publish the dataset on a portal the customer can then drag and drop the tables they needed, create the joins to create the required report.
Is it possible to do this in PowerBi or SQL Server Reporting service?
Many Thanks
Service Content Pack
It is possible in Power BI by developing an online service content pack. This allows online services to give their customers insight into their own data via the PowerBI.com cloud service. The ISV pre-builds the data model (and some initial charts); the end user doesn't have to worry about joins at all. They can drag & drop the fields that the ISV makes available.
There are some base requirements (it has to be a SaaS application that has an API accessible via the public internet).
More information: https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-content-pack-overview/
Embedding
If the ISV is building their own portal, they can embed SSRS reports on their own website (and use parameters that pass the customer ID from the website directly to each report). This looks like a good place to start: https://learn.microsoft.com/en-us/sql/reporting-services/application-integration/integrating-reporting-services-into-applications. One downside to this solution is that SSRS doesn't allow the end-user to change the reports themselves (no dragging or dropping fields).
You can also embed Power BI reports onto an externally facing website. More information here: https://powerbi.microsoft.com/en-us/power-bi-embedded/
There may be other solutions, such as tools that allow external access directly into SSAS, but I've limited the scope of my response to the two tools you've asked about (SSRS and Power BI).

Servicestack and Sql Server Reporting Services and Snapshot

i'm investigating integrating ssrs with servicestack, but as i'm using the new razor release, there are no references to any asp.net or mvc assemblies in my projects, so hosting in an aspx file for example, is not possible, and i'd like to keep it that way. i'm also looking to avoid deploying to a dedicated ssrs reporting server if at all possible.
it occurs to me that the snapshot view rendered out by servicestack under certain circumstances (missing view etc) could possibly fulfill the required role and was wondering if there is any way of customising the html that is rendered out? would it make sense to go down this route? would it be better if I simply spent the time creating a custom view for each entity (along with all their attendant child entities) I want to report on?