SSRS Report viewer in sharepoint with document.domain set - sharepoint

I'm presently working on a large intranet mashup that uses sharepoint to aggregate content from several other internal servers such as:
moss.myapp.internalserver.local - The MOSS portal
ssrs.myapp.internalserver.local - SQL Server reporting services reports
app.myapp.internalserver.local - Custom ASP.NET MVC forms
The moss portal invokes the MVC forms using iframes in jQuery dialogs (boxy to be precise), which in turn call back into the moss page with javascript for various things, including closing the jQuery dialog.
This would obviously fail the same origin policy on the browsers (and therefore not allow javascript to call into the frames/windows from different sources), so I've worked around this by setting document.domain = "myapp.internalserver.local" in the MOSS master pages and the app forms pages, which allows cross domain scripts to run fine between moss and app content.
So, that's working great, until I add an SSRS report into the mix using a report viewer web part (sharepoint's default one, plus a couple of third party ones including my own which just use the ASP.NET report viewer component).
The report viewer seems to require a handler that returns html into the page. However, The resultant report viewer content seems to render and script into some iframes, but it doesn't give us any way to set document.domain on those iframes, and so the scripts fail.
At best this means we get the little yellow javascript error icon in the status bar, and at worse, where dynamic rendering is used, the "rendering report" progress wheel just animates and never delivers a report.
Has anyone seen this before and if so, how did you get around it?
Thanks,
Tony

Typically to get the SSRS web parts to behave in SharePoint you will want to enable Kerberos, if you want to pass the same reports (using the same security context) you will need to grant your SharePoint app pool account rights to retrieve/run the reports. You could also consider installing SSRS in "integrated" mode but this is quite a difficult process as the sql server will need to host SharePoint as another farm member, with SharePoint fully installed.

I ended up solving this by using sub-frames as per this blog post:
http://www.deepcode.co.uk/2009/11/overcoming-cross-domain-issues-between.html

Related

I’m facing a performance issue in SharePoint online app parts

The custom app parts in SharePoint add-ins (SharePoint hosted) gives bad performance when adding them into a custom page in the hosted site.
Is there a solution for this problem?
The slow performance is most likely caused by the way the app parts are placed on the SharePoint page - each app part is contained within it's own iFrame which points to the app web. When the page loads, another full HTTP call has to be performed for the content from each app part placed on the page. Unfortunately - this behaviour is a part of the Add-in model and cannot be changed. Source: How to add SharePoint-hosted add-in as an app part
It has it's positives, as it allows to display content from provider-hosted apps in a web-part like manner. The biggest downside is - it treats SharePoint-hosted apps the same way.
To boost the performance I would suggest (if possible) switching to the SharePoint Framework, which is client-side only, doesn't use internal app webs and renders directly inside the page's DOM without being wrapped with any iFrames. Take a look here: Build your first SharePoint client-side web part

What is the suggested approach to build custom UI views by querying web services in Dynamis CRM 2013?

This could have been already discussed but in context of Dynamics CRM 2013, I am wondering what is the recommended and easiest approach (mine is a on-premise deployment) :
Problem :
May be a known pain point with 2013 - Users want to see 'All Activities' of a Company and related Contacts, Child Companies but
excluding few activities (like campaign emails).
Solution :
Thinking to create a custom form or a web resource which can use CRM web services to query for this data and make it part of the Company form.
Question is :
What is an easy way to do a custom page where I can use CRM web
services to query for all activities data and filter campaign
emails and display it like a grid ? I see two options :
Develop a separate aspx web application(using SDK binaries as references and crm web services) and host that outside of CRM (in IIS) and
use that url in an IFrame within company form.
Develop this as a html webresource (with a grid) and somehow make crm web services call from java script and display as a web resource (If so, is this
easy in CRM 2013, since web api is only present in 2016 ?)
Or something else ? (like a SSRS report may be but I think it will
be too slow)
Many thanks for your advise on this.
Thank you.
I work for an organization where most of the times requirements is like yours, so i have already done a separate aspx web application like your option 1.
Following are the few things to keep in mind:
If you go with Option 1 and develop a custom aspx web application and host it in IIS, it will be alot easier to maintain in future and easy to customize based on new requirements. If you have any new requirements like this in future, it will be easy to add a new aspx WebForm to the existing site and refer that new url. You can have common classes for Connection and authentication stuff in your web-application, which is almost re-usable.
I have used the same approach as described here: Best Practices for Working with Custom ASP.NET Pages and Microsoft Dynamics CRM 2011
In case of Option 2, i have tried this once but it is a bit more complex than the Option 1 because it involves more JavaScript code than C#. It is difficult to maintain although will be a bit-fast than the Custom Web App, but not re-usable code in case new requirements. Also Queries in C# (QueryExpression) is way more easy to write than writing Odata Queries in JavaScript.
Thanks.

Sharepoint Site using PHP code

I realise that Sharepoint in asp .net based but I have a PHP application that a user wants me to include in a Sharepoint site.
So is it possible to use PHP code inside sharepoint?
danit, when you say 'include' in the site, would it mean to be part of the site chrome (like inside the same menus etc) or just live connected with links would suffice?
I ask that because you can run php code under an IIS site but that would only keep the pages separated inside the same virtual host. if you need to actually join the functionalities you can:
Fake it with an iFrame (Page Viewer Web Part pointing to the php site for example).
you'll have to use some interop like webservices. It really comes down to what you want to do and not to if it is possible.
This is also possible by creating a web part page and adding a page viewer web part. You can link to the page, making it visible within the Sharepoint site, but it won't offer any interaction with Sharepoint itself.
Sharepoint treats the page as a shared document, however, so you can restrict access to it. I have done this in order to offer access to 'view only' content such as reports, but you can also use it for custom php apps that rely on a database other than the one(s) Sharepoint is using.

MOSS 2007: Displaying data from SQL Server Database

I have a requirement to select some data from a table in a database (SQL Server) and display it on a page in a SharePoint site (MOSS 2007).
I have a little bit of experience of MOSS, so I know I have a couple of options:
BDC
SSRS
or possibily even a custom ASPX page.
I've never really worked with any of these. Can anyone advise on the +/-'s of each?
It all depends on what functionality is required once the table is displayed in SharePoint. Do you need extra bells and whistles or is a dump of the data adequate? (Think about the future as well.) Here's some thoughts...
Business Data Catalog (BDC)
If you want to nicely integrate the SharePoint look and feel with your data as well as get some cool functionality, BDC is a good solution. There is no need to program anything and these are the features you get. However if this data will only be used once in one way then it is probably overkill.
You would need to roll your own XML description of the data so SharePoint knows how to pull it from the database (or use something third party like Lightning Tools). As Colin mentioned it requires the Enterprise license of MOSS.
SQL Server Reporting Services (SSRS)
If Reporting Services is already available for use then this is the quickest and simplest solution. It works well but can get painful as more advanced features are required in your reports.
You should be able to use the Report Designer wizard to point to your table and set everything up for you. There are SSRS web parts that can be used within SharePoint, or indeed you can run SSRS inside SharePoint using SharePoint integration mode.
Application Page
This method Steven mentioned lets you integrate an ASP.NET application into SharePoint (such that it can be accessible by a URL within your SharePoint site). This allows anything that ASP.NET does, and the code-behind will be aware of SharePoint so you can tap into that if needed as well. The cons here are code access security and deployment.
See this webcast for how to do it.
Web Part
Similar to developing an application page but much more integrated with SharePoint. A custom web part is very powerful and allows you to integrate ASP.NET code on a SharePoint page. As you would know web parts can be dragged to whatever location and give a consistent properties pane. Again, code access security and deployment needs to be considered.
If you like designer view in Visual Studio then be aware this isn't the approach that Microsoft push. You can however use something like SmartPart where you would develop your custom app as a user control and the SmartPart wraps it into a web part. I'm used to doing it the MS way now and actually prefer the additional control this gives, however it can take more time.
Page Viewer Web Part
If you don't want to touch your SharePoint installation at all then have a look at this web part. It takes a URL as parameter and displays an IFrame containing the page that would be your report, either in SSRS or standard ASP.NET.
The downside from this lack of integration is problems with sizing the IFrame, and possible security warnings from the browser if accessing the URL in a different domain.
Don't forget the DataView Webpart. It has a pretty small developement footprint and works really well as a first "cut" if you are unsure as to how hardcore you need the final result to be.
It renders using XSLT, giving you full control of the final HTML, so it can do some pretty things with Javascript and co.
For a very simple example of charting.
Have you ever used the .NET Framework do develop webpages?
MOSS 2007 uses this framework for master / template files.
So your best choice would be to create an ASPX template file to display the results on the webpage.
BDC is the way to go if you want to keep it "strictly Sharepoint". The problem is, it is only included in the Enterprise edition of SharePoint. If you have the Standard edition, you could go for SSRS and the SSRS webpart, or, create your own webpart. That way you can use your data display anywhere in your site and it's also ASP.NET compatible.
As Nat said - if all that is needed is to display some data from a database on a page - the DVWP is a great solution. Just open your page in SharePoint Designer, add the database connection, and drop the web part on your page. You can use any of the several pre-formatted layouts, or design/tweak your own so the data is displayed as you need.
Relatively straightforward, lots of HowTos online, and far faster/easier to setup than something like BDC.

DIsplaying SSRS reports in SharePoint?

I have a series of reports served by SSRS. They are great and the users like them.
That being the case, upper management wants to throw a wrench in the works and serve the reports from the Sharepoint server.
Is there a realtively painless way to let users access the reports from sharepoint? How would somebody go about doing such a thing? Or do I just need to bite the bullet and try to stop the madness?
I'm not sure which version of SSRS or Sharepoint you're using, but there have traditionally been both a Report Viewer and a Report Explorer web part shipped with Sharepoint in the RSWebParts.CAB file (at least since SQL Server 2005 SP2 I think). You can start there, but if you wanted quick and low-tech you could put in an IFRAME web part and point it to the Reports folder on your SSRS Server. Since you're using Sharepoint, that's also making the assumption that you're using Windows Authentication, so that wouldn't be an issue there.
Here's a link that might be of some use:
Viewing Reports with SharePoint 2.0 Web Parts
The most painless is going to be to run SSRS in Native mode, which it sounds like you're doing already, then install the SSRS web parts on your WSS/MOSS server.
You will have to manage security and report source control using some other methods besides sharepoint, however you don't have to deal with installing WSS/MOSS on your SSRS box and adding it to your SharePoint farm.
The more painful option is to run SSRS in Integrated mode. This allows you to use all the SharePoint document management stuff for your reports and share the same security setup however, the server configuration can be lengthy and difficult to setup.
http://msdn.microsoft.com/en-us/library/bb677365.aspx
Hope this helps!
Ben

Resources