Problems in generating HTML with JasperReports - html

I am using jasper report with my application and generating the reports in pdf formats, which are coming up fine. We want the user to be able to view those reports in html also with in the application, but generating HTML from jasper contains inline CSS for its individual element which we do not want. (We want to apply our own CSS so that look and feel of application remains same.). If any body has any ideas how it can be done, please help.
Also we do not want large number of records in a single page in html, so any ideas on how we can implement pagination in such a scenario.

I don't think so you can separate the CSSs from the HTML which is generated by the iReport.
To check for some more options please open the export options which are under
Tools->> Options ->> Export Options.

Related

Saving static HTML page generated with ReactJS

Background:
I need to allow users to create web pages for various products, with each page having a standard overall appearance. So basically, I will have a template, and based on the input data I need the HTML page to be generated for each product. The input data will be submitted via a web form, following which the data should be merged with the template to produce the output.
I initially considered using a pure templating approach such as Nunjucks, but moved to ReactJS as I have prior experience with the latter.
Problem:
Once I display the output page (by adding the user input to the template file with placeholders), I am getting the desired output page displayed in the browser. But how can I now obtain the HTML code for this specific page?
When I tried to view the source code of the page, I see the contents of 'public/index.html' stating:
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expectedly, the same happens when I try to save (Save As...) the html page via the browser. I understand why the above happens.
But I cannot find a solution to my requirement. Can anyone tell me how I can download/save the static source code for the output page displayed on the browser.
I have read possible solutions such as installing 'React/Redux Development Extension' etc... but these would not work as a solution for external users (who cannot be expected to install these extensions to use my tool). I need a way to do this on production environment.
p.s. Having read the "background" info of my task, do let me know if you can think of any better ways of approaching this.
Edit note:
My app is currently actually just a single page, that accepts user data via a form and displays the output (in a full screen dialog). I don't wish to have these output pages 'published' on the website, and these are simply to be saved/downloaded for internal use. So simply being able to get the "source code" for the dislayed view/page on the browser and saving this to a file would solve my problem. But I am not sure if there is a way to do this?
Its recommended that you use a well-known site generator such as Gatsby or Next for your static sites since "npx create-react-app my-app" is for single page apps.
(ref: https://reactjs.org/docs/create-a-new-react-app.html#recommended-toolchains)
If I'm understanding correctly, you need to generate a new page link for each user. Each of your users will have their own link (http/https) to share with their users.
For example, a scheduling tool will need each user to create their own "booking page", which is a generated link (could be on your domain --> www.yourdomain.com/bookinguser1).
You'll need user profiles to store each user's custom page, a database, and such. If you're not comfortable, I'll use something like an e-commerce tool that will do it for you.
You can turn on the debugger (f12) and go to "Elements"
Then right-click on the HTML tag and press edit as HTML
And then copy everything (ctrl + a)

jQuery image import to Crystal Report

I am trying to find a way how to import image from html to Crystal Reports. What I found is I need to set a code to download and save the image to a database and then add it to Crystal Report.
In other words, I need to find a way to add image dynamically to the Crystal Reports from HTML using id, rather than save it to a database.
Do you mean save the HTML page as an image and display the result in Crystal? There is a User Function Library (UFL) that provides that functionality. See list of UFLs here.
If you mean an image file referenced by an HTML page, then it's just a file (the fact that it is also used in an HTML page is irrelevant. You can simply use the path to that file.
Consider providing more details...

How can I embed HTML file in excel?

I am working on a project which requires me to add a chart store in HTML file into excel. The MS web browser Active X control does not allow me to add a web browser. If I do that using VBA, it gives me some error related to not displaying Active Content. Please provide me some assistance on this. I have used IE object in VBA, but it opens the HTML file in IE.
The best way to do this would be to take the Microsoft web browser app and insert it into excel cells. This will allow you to insert the HTML.
Please note excel is not made to handle HTML and as such you won't be able to go in-depth with you HTML. Rather use different programs like MT Blocks to get the desired result.
https://www.mrexcel.com/board/threads/html-into-excel.387722/

JasperReports - Embedding chart as SVG into HTML report

I'm using JasperReports integrated into Spring application (JasperReports 6.3.0, SpringBoot 1.4.1).
I have a report (created with Jaspersoft Studio 6.3.1) with a stacked bar chart within. It does print properly in pdf, xls. The problem is html format, which has the chart displayed as an empty box - when you look at the source code, the src attribute of img element is empty.
I've seen people advicing setting up some kind of Jasper-defined servlet to serve images as static files to html report, though this might be extra complicated with environment I'm working on.
The most convenient way I can think of is to insert the chart in svg format, so that it would be present inside the html content - this is my preferred solution to this.
The chart element (in report desing) actually has an option to be displayed as svg, though changing this doesn't seem to affect html output at all, just like Jasper would want to export the created svg to a file, and then include it as image anyways.
I've tried several config options, but I'm kind of stuck now, so my question is:
Do I need some extra environment setup, or some other fancy stuff, to reach my goal? Is what I ask for even possible with JasperReports?
Thanks in advance!
What you need is the following two properties in your jasperreports.properties (if you don't already have that file, create it and put it to a jar or folder that's on the application classpath):
net.sf.jasperreports.chart.render.type=svg
net.sf.jasperreports.export.html.embed.image=true

Sitecore - Export as HTML

I know about the Sitecore function to export Items to XML. But what I need is the complete HTML markup including permissions of the displayed pages in Sitecore.
Is there a way to export these out of Sitecore into XML?
I am not sure that I entirely understand the question. If you simply want to export the pages of a website the easiest solution is to use a web scraping tool (http://www.codeproject.com/Articles/1041115/Webscraping-with-Csharp).
However I am uncertain about what you mean by "including permissions". Do you mean the security permissions set on the context item (the item/page being displayed)? If so then please note that a page can be composed by a context item and a lot of embedded data source items used in the various renderings which makes it a bit more tricky.
Cheers, Bo