Drive Item Preview - WebBrowser Control C# - This content cannot be displayed in a frame - iframe

We have third party app that has WebBrowser control that allows us to update the HTML content, and wanting to embed iframe of embed.aspx page from MS Graph api, but getting error "This content cannot be displayed in a frame". The HTML displays fine in Chrome and Edge, but IE and webbrowser control block it.
:!This content cannot be displayed in a frame(https://i.stack.imgur.com/JA8Jd.png)
I am using Microsoft Graph to get the preview embed.aspx of an item stored in SharePoint, using driveItem: preview API and I am getting a URL return like this, which is designed to be embedded in iframe.
https://{domain}.sharepoint.com/_layouts/15/embed.aspx?uniqueId={guid}&access_token=eyJ0eXAiOiJKV...
Is there some setting on ie that I can change to allow this content to be displayed in webbrowser control?
I have tried: - setting in ie to allow "Launching programs and files in an IFRAME".

Related

CefSharp browser jumps (scrolls up) when "PrintToPdfAsync" method is called

I am using the "PrintToPdfAsync" method https://cefsharp.github.io/api/63.0.0/html/M_CefSharp_WebBrowserExtensions_PrintToPdfAsync.htm to export HTML view to pdf. However I am experiencing following issues:
With this API (PrintToPdfAsync), I am unable to pass complete "viewport" that I want to be exported. I can pass width and height (possibly page dimension in micron). Question: How cefSharp determines the "view port"? Which element window or body?
The major issue I am experiencing is that just after the call to the method, "view is scrolled up", thereby the exported pdf does not contain the expected view port area.
Details here: https://github.com/cefsharp/CefSharp/discussions/4115

GWT Formpanel POST issue

I am using GWT FormPanel to submit a POST request to a servlet which renders a pdf. The screen I am using to post have got a pop up with yes, no and preview button. yes and preview would open a pdf in new tab in browser.
The problem is when I use IE11 and clicks on preview it opens up a pdf well, I dont close the tab go back to previous screen and clicks yes, again request reaches to servlet but this time all the request parameters are null.
If the pdf tab is closed and then I click on yes it again works fine. This is an issue with IE11, works fine with Chrome. Any Ideas ?
If I change it to GET it works fine but I have a huge data that needs to be passed to servlet.
here is a code snippet :
formPanel.setBodyBorder(false);
formPanel.setBorders(false);
formPanel.setHeaderVisible(true);
formPanel.setAction(someURL+ "/someServlet");
formPanel.setMethod(Method.POST);
formPanel.setTarget("somePDF");
formPanel.setId("report");
HiddenField<String> hddnF = new HiddenField<String>();
hddnF.setName("Yogi");
hddnF.setValue("Value is set...");
formPanel.add(hddnF);
formPanel.submit();
Have overridden setTarget to show result(pdf) into new popup/tab
public native void setTarget(String target)/*-{
this.#com.extjs.gxt.ui.client.widget.form.FormPanel::setTarget(Ljava/lang/String;)(target);
}-*/;

Dynamics CRM 2011 Modal Web Resource from Ribbon button size incorrect (IE only)

I am working on Dynamics CRM 2011 (UR13) and trying to display an HTML Web resource (which contains a Silverlight XAP file) as a Modal Dialog from a Ribbon Button.
The Ribbon action XML is as below. More or like the MSDN examples.
<Actions>
<Url Address="$webresource:new_Wizard.htm" PassParams="true" WinMode="1" WinParams="dialogHeight=100; dialogWidth=100" />
</Actions>
In both Chrome and Firefox, the dialogHeight and dialogWidth values are honoured.
However, in IE9 (the RTM supported version) these are ignored and the pop-up window is huge (almost full screen).
Has anyone else seen this behaviour or know a workaround?
Best Regards,
Shaun Harvey
I am opening up the HTML Web Resource from a Javascript Function instead (triggered by the click of the Ribbon Button).
This function uses the Xrm.Utility.openWebResource() method introduced in Roll-Up 8 of CRM 2011.
http://msdn.microsoft.com/en-gb/library/jj602956(v=crm.5).aspx
The Function call allows you to specify the web resource URL, and the size of the pop-up window.
Xrm.Utility.openWebResource("new_webResource.htm?typename=account&userlcid=1033", null, 300, 300);
This seems to be rendered properly by all three of the browsers.
As a possible workaround you can choose one of 2 options:
1. Add OnLoad javascript to your html webresourse that will set correct size to your dialog window.
2. Replace action with JavaScript function that will open your dialog window with proper sizing.

How to access current Sitecore item in layout .aspx, while in preview pane in the Sitecore content editor?

I have put together an .aspx page which is the layout for a certain template. I cannot get the current item by path (i.e. by calling Database.GetItem(string)) while in the Sitecore preview pane, though it works fine on the web, even using the .NET Request.RawUrl property.
How do I most easily get access to the current item in this context?
Sitecore.Context.Item
to get the item for the current page on Preview mode and on Normal mode.
To check if you are on preview you can use :
if (Sitecore.Context.PageMode.IsPreview) and
if is normal page you can use :
if (Sitecore.Context.PageMode.IsNormal )

printing rdlc using report viewer 10.0.0.0, print button not showing

I have an rdlc report in an asp.net project.I’m using report viewer 10.0.0.0 to view and print the report. Except for Internet Explorer the print button of the report viewer does not show.
Though in my case, print button does show in IE, it gives the error” Unable to load client print control” when it is pressed. I found similar problems reported for report viewer 2008,but the solutions like, installing the SP 1 did not solved my problem.
Is there a way to enable printing independent of the browser?
Please Help.
You can add your own button and adjust it to the report header and, using jquery and javascript you can print from chrome or firefox
For direct printing on page load:
$(window).load(function() {
var a = document.getElementById("ReportFrame" + reporviwername).contentWindow;
a[1].print();
});
For printing on PrintButton click:
$('.PrintButton').live('click', function() {
var a = document.getElementById("ReportFrame" + reporviwername).contentWindow;
a[1].print();
});
The printer controls in report viewer are implemented as an ActiveX Control. Those are IE specific controls. So, you will not get that option if you use anything other than IE.
If you want a browser independent version, you could embed the report in pdf form.
Pdfs viewers have a print button.
In my experience it works well with most modern browsers. The pdf format too is standard, so your reports will be printed the same, regardless of the browser.
As everyone suggested that Report viewer control only renders with ActiveX control, and many other browsers don't support this so not possible but IE.
So Microsoft updates their supporting features in a recent release after SQL Server Reporting Service 2016 and later version they have updated their dependencies on ActiveX Control.
So you can update your Reporting Services to Latest.
Refer :Updated Report Viewer Control

Resources