v14.0 Web Report Viewer Control not displaying body of report - reporting-services

I am hoping someone has an idea about what I am experiencing.
I've worked with various versions of the Report Viewer control (both WinForms and Web) over the years and have just started trying to use the latest HTML5 based version in an ASP .NET Wed Forms project.
My environment is as follows:
Dev laptop with Windows 7 and SQL Server 2014 Including SSRS.
Various remote servers with 2008R2, 2014 and 2016 Reporting Services on them.
I've followed this tutorial page from the Microsoft Docs:
https://learn.microsoft.com/en-us/sql/reporting-services/application-integration/using-the-webforms-reportviewer-control, and have set up a page that points at remote server reports.
Code Behind:
protected void Page_Init(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
rv14.ProcessingMode = ProcessingMode.Remote;
ServerReport serverReport = rv14.ServerReport;
// A 2016 Report
serverReport.ReportServerUrl = new Uri("http://2016server/reportserver");
serverReport.ReportPath = "/Sports";
// A 2014 Report
// serverReport.ReportServerUrl = new Uri("http://2014server/reportserver");
// serverReport.ReportPath = "/SQL2014DemoReports/VertBar";
// A 2008R2 Report
// serverReport.ReportServerUrl = new Uri("http://2008R2server/Reportserver");
// serverReport.ReportPath = "/DemoReports/VertBar";
}
}
ASPX
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Reports.aspx.cs" Inherits="WebNew.Reports" %>
<%# Register assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Reports</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<rsweb:ReportViewer ID="rv14" runat="server" Width="100%" Height="100%"></rsweb:ReportViewer>
</form>
</body>
</html>
When I run the page, the new HTML based toolbar renders and I get and I get the "loading" mini dialog showing, but then nothing. No report body rendered. The report currently uncommented in the code is a simple list of sports a couple of pages long, nothing complex.
I can tell that the server was contacted and replied as I am seeing the pagination control indicating that there is more than one page, and if I then use any of the export controls, such as PDF, the PDF DOES have the correct rendered output in it.
It is simply not showing in my web page.
I've tried IE (11), Chrome (58) and Firefox (49) and all display the same behaviour. It does not matter which of the servers I target or if I connect to my local instance.
Has anyone seen this behaviour, have any pointers to what might be happening, or a good way of trying to debug?
Many thanks

OK, so I stumbled across a solution to what I was seeing. It would seem that the problem is to do with what the viewer is contained within.
If I wrap the viewer in a DIV and set it's height to 100 vertical height then the viewer does correctly show its content. Previously it must have effectively been in a container of height zero.
Working ASPX code looks like this:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>2016 Report Viewer Test</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div style="height:100vh">
<rsweb:ReportViewer
ID="rv14"
runat="server"
Width="100%"
Height="100%">
</rsweb:ReportViewer>
</div>
</form>
</body>
</html>
Hope this helps someone one day. :-)

Add this, worked for me.
rv14.SizeToReportContent = true;

Related

How to link css file in vb asp.net project

How to link css file in vb asp.net project
Right now my css file is not beeing run from Home.aspx files. What is my All_Body.css file path that I should type in Home.aspx file.
I need to put this code on server so I can not use full path with my computer username
project Files:
>MyWebsite
>Styles
>All_Body.css
>UI
>Home.aspx
>Master.master
All_Body.css full path
C:\Users\Dave\source\WebSites\MyWebsite\Styles\All_Body.css
Home.aspx
<asp:Content id="Home_Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" type="text/css" href="~\Styles\All_Body.css" />
...
</asp:Content>
Master.master
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
...
</body>
</html>
I cleared my browser cache and it worked.
The browser doesn't reload the css or js files, so as a developer you have to do hard refresh /reload every time you update the css or js files and you must add query string like ?v=0.01 after the href or src when you publish the website to the server and change the number every time.
ex:
href="styles.css?v=0.01"
src="main.js?v=0.01"
Now the browser will think this is a new file and will reload it in the client browsers.
Home.aspx
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
....
</asp:Content>
Master.master
The link to your CSS file should be in the <head> element of the master page:
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<link rel="stylesheet" type="text/css" href="Styles/All_Body.css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
Note that I updated the path to your CSS file which was incorrect; this link is relative to the root. Also, the "~/" only works when you include runat="server" - either way it is not needed when using a relative link for CSS. You also had a malformed head content placeholder. The content placeholder for the main content was missing from your master page. There was no form tag so nothing could work. In fact the code you presented would not even compile. If you simply used the standard Web Forms template out of the box with the master page option, it would have worked.
Tip: The easiest way to get the CSS link correct in a master page is to drag the CSS file from Solution Explorer into the <head> section of the master page in Visual Studio.

HTML / ASPX pages not validating and not rendering or validating

As a disclaimer, I have read all of the posts regarding this topic and have tried all of the suggestions and still don't seem to be able to get this to work. So, for purposes of this question, I have created a very simple Master page file and an index file. The code for the master page is:
<%# Master Language="C#" AutoEventWireup="true" CodeBehind="master.master.cs" Inherits="EckankarInOklahoma.master" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>ECKANKAR in Oklahoma</title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
The index page's code is as follows:
<%# Page Title="" Language="C#" MasterPageFile="~/master.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="EckankarInOklahoma.index" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
I DON'T GET THIS AT ALL :)
</asp:Content>
When I debug through Visual Studio, I get the expected white screen that just says:
I DON'T GET THIS AT ALL :)
But after publishing, uploading to the website via ftp and going to the website, I get nothing but my code. I have saved the files with encoding but without BOM. I used Sublime Text editor to ensure I was saving without BOM. I have published and then uploaded, and I have uploaded without publishing. All to no avail. I still get unrendered code.
Additionally, I have tried to validate through W3C Schools and the code will not validate. I have 3 errors and 3 warnings.
Can someone please advise what I might be doing wrong? Thanks in advance. Have a great weekend!
***update 1 = I tried what MarcusVinicius suggested and that did get me closer, but now instead of giving me my code as text, it says :
This is a marker file generated by the precompilation tool, and should not be deleted!
I am unsure of where to go from here. I published the website as not updatable and the config files are in the root directory. Any more ideas for me to try? Again, I appreciate all of the help and suggestions. :)

jpg is not displaying in liferay jsp page

I am using Liferay and struts 2 framework. I want to display a jpg file.
My struts.xml is like:
<action name="searchAllCategoryWiseGraphical" class="com.stp.portal.view.SearchEFormReportPortlet" method="searchAllEFormsCategoryWiseGraphical" >
<result name="success">/WEB-INF/view/GraphicalViewPage.html</result>
</action>
Now the bar chart is generated and is saved in a specified location in jpg format. I am writing simple html code to display the same:
<%#page import="com.liferay.portal.kernel.search.Document"%>
<%#page import="org.codehaus.groovy.transform.powerassert.Value"%>
<%# taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/WEB-INF/view/MessagePage.jsp"/>
<html>
<head>
<title>Title</title>
</head>
<s:form name="searchAllCategoryWiseGraphical" action="searchAllCategoryWiseGraphical" method="POST" theme="simple">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<img border="0" src="D:/eFormReport_Vertical.jpg" alt="report" width="600" height="400">
</body>
</html>
</s:form>
</body>
</html>
But the image is not displaying. If i am saving the html code in a separate html file(not in the liferay portal page), the graph is displaying. Is it some liferay issue or am i am missing something??
Thanks and Regards
------------EDITED-----------
Thanks for the reply. Yes, its a path issue. Its solved now. Now I am getting another problem. The graph will change depending upon the input values. But its showing only the first graph. I have replaced the old jpg with the new one keeping the same file name. But its not showing the latest jpg.
i had the same problem with js and css so what i have done is using relative path
you can do same to get the images as it seems that its just path problem you facing.
put your images in docroot directory
<img border="0" src="<%=request.getContextPath()%>/eFormReport_Vertical.jpg" alt="report" width="600" height="400">
hope it helps..
just delete temp folder from the liferay server directory its using cache version of portal or you can restart the server and ctrl+f5 the browser window.. it will solved the problem.

Sending mail using classic asp

I am new for classic asp.
I have written simple code to send mail using classic asp as follows :
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<form method="post" action="ASPformEmailResults.asp">
<p><input type="submit" name="submit" value="Submit"/></p>
</form>
</body>
</html>
ASP page:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="a#gmail.com"
myMail.To="b#gmail.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black">
</body>
</html>
but whenever open html page & click on submit button then mail should sent to given id but it displays asp page content.
Please help me to solve this problem.
Thank You.
Based on the information given, it appears that although IIS is installed, the ASP parser itself is either disabled or unmapped.
The following instructions will enable it for Windows 8; other versions of Windows will be similar:
From the Start screen, search for "Turn Windows features on or off"; it will be under 'Settings'.
Expand 'Internet Information Services'
Expand 'World Wide Web Services'
Expand 'Application Development Features'.
Tick 'ASP'.
Click 'OK', and ASP will be enabled within IIS.
If it is installed, it may well be disabled. Load up the IIS Manager (either through the start screen, or by running inetmgr directly from Start, Run, then:
Expand your computer name
Expand 'Sites'
Click on 'Default Web Site'.
Click on 'Handler Mappings'.
Ensure that the mapping ASPClassic is enabled for *.asp; if it isn't, you will need to create it and ensure that its executable is set to %windir%\system32\inetsrv\asp.dll.

Where's my URL parameter?

I have a legacy web page made with frames (yah, I know). One frame (letFrame) is trying to update another frame (rightFrame) with the following anchor:
<a href="foo.asp?myVar=BAR" target=rightFrame>
foo.asp is already loaded in rightFrame and looks something like this
<%# Language=VBScript %>
<HTML>
<HEAD>
<META NAME="MYNAME" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<form target="_self">
<SCRIPT LANGUAGE=vbscript>
Option Explicit
dim myURL
myURL = parent.location.href
<...blahblablah...>
When I print out the value of myURL or parent.location.href I find that the parameter portion ?myVar=BAR has already been stripped off. It just reads foo.asp.
Is there some setting in IIS that would be doing this; or is there another way to get the parameter portion?
Looks like you're grabbing the url of the parent. Try window.location.href.
Also.. In ASP, you should be using.. Request.Querystring("param").