How to apply custom styles to a jasper html report - java

How does one apply custom CSS to a HTML report generated using Jasper. I need to include this report as an iFrame into a GWT window.

You can simply include a link tag in your GWT html file like so:
<link type="text/css" rel="stylesheet" href="myJasperStyles.css">
The CSS file should explicitly refer to Jasper-related HTML tags to ensure the CSS won't affect your GWT elements.

Related

How to add CSS to an eclipse HTML file

My assignment is to create a class in java and add tags through comments to make it look just like this http://docs.oracle.com/javase/7/docs/api/. My problem is though that the CSS doesn't stay with the html file. It comes out without the CSS. I've tried doing
<style>href="http://docs.oracle.com/javase/7/docs/api/stylesheet.css"</style>
but I can't get the CSS to stick. What am I doing wrong?
This is the way you link css files in html
<link href="http://docs.oracle.com/javase/7/docs/api/stylesheet.css" rel="stylesheet" type="text/css">
Did you add the lines as ususer2812693 mentioned. Just check whether, the css is file loaded into the browser using firebug. And also the css classes and ID s are correct with html elements' classes and ID s. Or else, first try to download the css file which you refer and, try to call it locally from your html page.

where and how to link html file,css file,javascript file and jsp

i have CSS file in one folder,html file in one folder,javascript in one folder. where shoul i link these files and how?whether in html or jsp page.please let me know.. even after giving a link like
where CSS is my folder.
how a proper aggregation is needed in in eclipse considering the industry standards ?
You link the files on your html page in the head of the document.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="../css/main.css">
<script src="../js/main.js"></script>
</head>
...
Some people recommend linking javascript at the end of the document (just before the closing body tag) so that the visible elements can be rendered first before the javascript is parsed.
Just to clarify, css must be in the head; javascript can be anywhere and possibly/probably optimal at the end.
use link element to link various resources to your page like: CSS files, a favorite icon ...
check out this video demo
and script tag (as shown above by Crazysheep) to link scripts

Display XML in html with CSS style sheet

I have seen numerous ways to display an XML file in a web page (HTML) but haven't come across one that uses a CSS style sheet.
I have an XML file that already has a CSS style sheet. When the .xml is viewed in a web browser, it displays fine with CSS.
I want to display the same XML file in a webpage (HTML), whats the best way to do that?
Thanks.
If you have a separate styled XML document and you want to display it in an HTML page, you could probably use the <object> tag:
<object height="100%" width="100%" border="0" type="text/xml" data="yourfile.xml">
<!-- alternative content used when the inclusion fails -->
</object>
(Tested in FireFox only). Alternatively, an <iframe> could do a similar job.

No styles applied using Play! 2.0 PDF module

I recently installed the PDF module for Play! 2.0 and was able to wire it up to render a PDF without much difficulty. However, it looks like it's not loading my stylesheet, since no styles get applied to the PDF.
I've tried referencing my stylesheet using the classpath:
<link rel="stylesheet" type="text/css" href="/public/css/pdf.css" media="screen" />
I've also tried referencing it using #routes:
<link rel="stylesheet" type="text/css" href="#routes.Assets.at("css/pdf.css")" media="screen" />
In an attempt to keep it simple, I've included only one style in my stylesheet:
td {
color: blue;
}
If I render as HTML, the text in my table is blue, but if I render as PDF, it's all black.
If this is a known issue, I don't see it anywhere. I'm under the impression this should work, so it seems like I must be missing something or doing something wrong. Can anyone help?
I've also reported the issue here.
I am not sure if this is the only issue, but I wrote about one issue in my book when I wrote about the PDF module for play 1.x.
The CSS you are using (and the default for Play when first generated) is to use media="screen". A PDF is classified as print. You therefore need to set media="print".
media="print"
So it would be
<link rel="stylesheet" type="text/css" href="/public/css/pdf.css" media="print" />

wicket 1.5 + error-page + cannot find the related path to css resources

I have the next problem with wicket and standard error handling:
all the css files are stored as java resources, near the html pages.
It's working fine. But, when I added the 404 error handling in the web.xml so that any not-found-url is treating as redirect to my PageNotFound.class - the paths to css in this page are broken. it's writes it as
<wicket:link>
<link rel="stylesheet" type="text/css" href="../../wicket/resource/com.web.common.PageNotFound/css/common.css"/>
</wicket:link>
instead of
<wicket:link>
<link rel="stylesheet" type="text/css" href="wicket/resource/com.web.common.PageNotFound/css/common.css"/>
</wicket:link>
(which is working fine, and appeared if I point directly to this PageNotFound page)
So the questions is - why only when error is handled it adds additional useless "../../" to css path?
I did all as it is described here (HTTP Error pages part): adding custom error pages using wicket
Have a look at https://issues.apache.org/jira/browse/WICKET-3602. This might be the cause of your problem.

Categories