I want to show reports generated using stimulsoft in a ASP.NET webpage. I have loaded the report and registered the datasource related to the report using the following code. But I am having issues with displaying it in a web page. What should I do to display this in a web page.
StiReport report = new StiReport();
report.Load("D:/Work/AllClassifieds/DevSourceBranch/WebSolution/Website/Reports/Price Sensitivity/PriceSensitivity.mrt");
report.RegData("PriceSensitivityData", ds);
You should put StiWebViewer or StiWebViewerFx on the ASPX page and pass the report to it with next code:
StiWebViewer1.Report = report;
Related
If it is even possible...
Goal: See a report of the number of views each page in my Azure web app has, and include the pages that have received zero views
Currently the page views report in Azure Application Insights that I have managed to create (based on the default report, shows all pages with >= 1 view. I would like to include in that report pages that have 0 views.
This is bare-bones version of the query I'm using in logs:
pageViews
| where timestamp between(datetime("2020-03-06T00:00:00.000Z")..datetime("2020-06-06T00:00:00.000Z"))
| summarize Ocurrences=count() by tostring(url)
The pages are in an Azure web app.
Does anyone know how to accomplish this, either using this method or another I'm not thinking of? Thank you for any help.
If the pages have zero view from client, it means that from client, there is no "page view" telemetry data being sent to application insights. Thus, application insights will not collect these zero-viewed page urls.
If you want to add these zero-viewd page to your report, you should hard-code these zero-viewed page urls in the query.
Here is an example, I use the datatable operator and union operator:
//use thie query to add the zero-viewd page url in this datatable
let query1=datatable (url:string,Ocurrences:long)
[
"https://localhost:44364/home/url1",0,
"https://localhost:44364/home/url2",0,
"https://localhost:44364/home/url3",0,
];
//use the query below for non-zero-viewd page
let query2=pageViews
| summarize Ocurrences=count() by tostring(url);
//union the 2 queries
union withsource=TableName query1,query2 | project url,Ocurrences
Here is the test result:
I finally got my html website working in an Azure App.
Now I want to add a Contact Form.
I have done a simple HTML form that calls the MailGun API but nothing happens when I click submit.
There are no errors showing in the browser.
I followed the instructions here to create the form.
It turned out that I had incorrect settings in
$api_key = 'INSERT_API_KEY_HERE';
$api_domain = 'INSERT_DOMAIN_HERE';
$send_to = 'YOUR_EMAIL';
This became apparent after displaying the error from the Ajax call.
As explained here
We have developed an internal portal with multiple subsites using sharepoint office 365. We created our own page layouts/masterpage for the sites and most of the things like menu's, page body and page logos are customized(unique for all sites/subsites).
Each page has a header logo and a url assigned to that logo(logo describes site or subsite name). We have written a javascript file to load these logo and url and calling on the masterpage. Now the problem is these logo and link should load based on Global navigation
Example:
If the site is using the same navigation items as the parent site?
Yes - pull logo and link from site above
No - pull logo and link according to site name
if i get the GlobalNavigation setting value then i can do this in javscript file. Is there a way to get this GlobalNavigation setting value in javascipt file? I googled on this but didn't get enough information.
Thanks in advance,
Amarnath
--------UPDATED-------
I am using the below code but getting error "sp.runtime.js:2 Uncaught Error: The property or field 'Source' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested"
used code
var ctx = SP.ClientContext.get_current();
var web = ctx.get_web();
//Navigation Provider Settings for Current Web.
var webNavSettings = new SP.Publishing.Navigation.WebNavigationSettings(ctx, web);
//Global Navigation (Top Navigation Bar)
var navigation = webNavSettings.get_globalNavigation();
navigation.set_source(1);
webNavSettings.update();
ctx.executeQueryAsync(onSuccess, onFailure);
I want a link that the users can click which supports logging in as a different user and then redirects them back to the same page.The issue is the page currently the user is on is also a layouts page .So the below code will work but take the user to the home page not the layouts page they are currently on which is
http://test.net/_layouts/15/EditProfile.aspx
function ChangeLogin()
{
var url = window.location.host;
alert(url);
var loginurl ="http://" + url + '/_layouts/closeConnection.aspx?loginasanotheruser=true'
location.href = loginurl;
}
Thanks
Method 1:
This can be done if you have access to the 2013 server 15 hive. Open 15 hive --> Control Templates-->welcome.ascx . Add the below xml entry:
<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"
Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
MenuGroupId="100"
Sequence="100"
UseShortId="true"
/>
Note: This is a farm level change and will affect all web application and sites on that server.
Method 2:
In the page where you want to add the link to add below tag:
Sign in as diff user
LoginAsAnother() is the method used by SharePoint internally in the method 1(ie OOTB menu under logged in user name).
Here provide the server relative web url before '/_layouts/15/closeConnection.aspx'.
I have been trying to find a solution to my problem for 2 days now and I am really stuck. Here's the problem:
I have an MVC application (with Dependency injection and the works) with just one webform. This page needs to be a webform because it has a ReportViewer in it and please correct me if I am wrong but an MVC View is incompatible with server controls like ReportViewer. This is the navigation flow of the pages:
Home page navigates to the ReportList page
ReportList page displays the reports that a user is able to view and navigates to the Report page and passes it the ID of the report that the user selected.
Report page should look up the ReportPath and the ServerUrl from the database based on the ID passed from the ReportList page at the same time authorizing the user, whose permissions are stored in the database.
I could potentially pass the ReportPath and the ServerUrl as part of the query string so that the report page (aspx, not driven by a controller) does not have to go to the database to get these values. The problem however is how to check that the user is authorized to view the report (someone could just use a link to look at the report).
I did try to hook it into the MVC model and inherited the page from the ViewPage class. The problem there is that the page kept reloading itself for some reason. I still want my page to do as little as possible and a controller to handle calls to the authorization attribute and to the business layer. So, as a last resort, I want to call the controller from the aspx page but I can't create an object of it becasue dependency injection.
Can someone please provide some guidance on this? I have all the code available but don't know what to post.
I found out the answer and posting here if it helps anyone.
I added another class called ReportManager, which the aspx code behind calls to execute the requests. The ReportManager simulates the Controller call through this code:
var routeData = new RouteData();
routeData.Values["controller"] = "Report";
routeData.Values["action"] = "SomeAction";
routeData.Values["SomeRouteValueKey"] = "someroutevalue";
var requestContext = new RequestContext(new HttpContextWrapper(HttpContext.Current), routeData);
IController controller = DependencyResolver.Current.GetService<ReportController>();
controller.Execute(requestContext);