Jasper Reports - How to get JRXML components with mixed styles or dynamic widths on text boxes? - jasper-reports

When buliding jasper reports JRXML files I want to be able to have a row of dynamically width'd text boxes of mixing styles. It does not seem like Jasper supports that so I'm stuck with this:
Notice how I used two static text boxes for this display with fixed widths. This is because I cannot mix the bold + normal font styles inside a component.
I would rather something like this:
Where the NOW() and $P{name} will automatically stretch out and look real nice.
Note: I cannot use the HTML component due to this issue http://community.jaspersoft.com/questions/540569/html-component-font and https://community.jaspersoft.com/jasperreports-library/issues/4411-0
Is there a way to code JRXML files with dynamically width'd Textboxes?

Actually, you can mix styles using markup in a single text box. Jasper supports (simple) HTML, RTF and a custom jasper-styling.
Check the "markup" property.
But I am not aware that you could insert artificial borders around the values when using a single textbox.

Related

How to change the text of a text object in Crystal Reports? with Crystal Syntax

I would like to change the text of a text object using crystal reports syntax, this is what I have:
If ( {?#CodCta} like "2*" ) Then
(
)
If ( {?#CodCta} like "4*" ) Then
But I don't know how to capture the text object and change the text it has. This is my text object:
I am newb to Crystal Reports.
Text objects are static (no way to use a Crystal expression to change the text).
You can use a formula instead of a text objects to make the content dynamic.
Or, if you truly need to change the text in text objects, you can use 3rd-party tools that can do a mass update to Crystal Reports text objects. Ken Hamady maintains a list of 3rd-party Report Management Utilities here.

Is posible to display html & css formatted static content in JasperReports?

I want to combine dynamically generated tables with a human created content formatted in html in the same document. The ultimate target will probably be PDF. The human generated content will generally consist of formatted text, tables and images. The formatting and layout requirements are generally fairly simple. This content will be specified in html, styled with css. The content itself will static in nature in that it will not be generated from data, but it could be sourced from files or a database. Is there a way to do this?
Static text and Text field element support html syntax (you just have to chose it in properties), but you have to use in line style formatting. Something like:
<span style="color: #999">Some gray text</span><span style="color: #000"> black text</span>

ActiveReports <LI> tag spacing

I've a rich textbox in activereports detail section. Its assigned with html dyanmicaly. That HTML includes LIST tags too(UL and LI). But the problem I cant change the spacing between each LI tags. I tried all CSS methods on the LI's style property. Like Margin, Padding , Line height. But nothing helped me to solve that issue. But I need some noticeable spacing between each LI tags on the Richtextbox..
This is an emergency requirement from my boss.
Requesting your valuable support..
Thanks in Advance..
There are list of supported HTML elements and CSS style attributes in the ActiveReports documentation. You could look through that reference and try the mentioned style attributes. I'd try the line-height, margin, and padding properties of the LI elements. Or maybe try putting a P element on one of the LI elements? If that doesn't work you should probably contact ActiveReports Support at ComponentOne.
If nothing else, you could try to get some RTF document to look the way you want (i.e. increased spacing between list items) and try importing that RTF document into ActiveReports instead.
Here's what works for me:
The paragraph tag supports the inline style attribute in an ActiveReports RichTextBox. So you can enclose each list item within open/close paragraph tags, and then use margin-top, margin-bottom in the inline paragraph style to get the line spacing how you want it.
I used style='margin-top:0;margin-bottom:5'

How to change the SSRS input parameters position in report

My SSRS report contains 7 input parameters and while running my report the size of the parameter(i.e. length) is increasing.
One of my input parameter(drop down list) may contain 100 characters so the size is not constant but i want to place all parameters in 2 lines or 3 lines(in a row).
Now it is coming 2 parameters per a row
Please advice
As gbn indicates, it's not easy to change the built in report server method of presenting the parameters. SSRS likes to always use two parameters per line, presented in the order that they exist in the report (which must match the dependency order.)
So the alternatives that gbn mentions: Both involve building a "Wrapper" application: some custom code or a web page that you can code however you like to get the parameters. Then you call Reporting Services, either in code or by passing a formatted URL with your parameters. The report can be displayed in a frame, new window, or passed as a stream to where ever you'd like.
The URL access is pretty straightforward and reliable: I often use it either by hand (to create "favorites") or in code.
http://msdn.microsoft.com/en-us/library/ms153586.aspx
For what you are looking for, these might be more work than you expected, but they will be extremely flexible for your interface.
Jamie
You can certainly do that, just right click on the RDL file in the solution explorer and select view code. then move the XML tags named <ReportParameter Name="Nameofparameter"> under <ReportParameters> according to where ever you want to position. And then save it. thats it!!!
The report parameters are kind of floating in values of 2, so if u have 4 report parameters then it will be shown as 1,2 next line 3,4. Best of luck!!
Use ASP.NET for the paramaters and a ReportViewer control or URL access to render. Seriously.
I don't know of any option to present parameters any way other then the default
I believe you could try using jQuery. The report parameters are rendered in a table under a div tag with class sqlrv-ParameterContainer. Write a jQuery or JavaScript function that will extract the full innerHTML from this div ie. the table content and then extract the table row information like the <label> or <input> tags.
Create your desired table structure with <table><tr><td>{extracted sections}</td><td></td></tr></table> or leave it to your requirement...
Then just append this new HTML structure in place of the original default structure.
In jQuery it will be like
$(".sqlrv-ParameterContainer").html();
which will give you the entire table structure that comes inside the parameter. Use XML parsing and get the input controls and all. Extract these controls as-is, don't change anything.
$(".sqlrv-ParameterContainer table").remove(); // it will remove the SSRS rendered default table from DOM
$(".sqlrv-ParameterContainer table").appendChild('<table><tr>......</tr></table>'); // Append your custom html structure here....
This was something that came to my mind quickly... I would suggest you test it... :)
This doesn't help the OP with SSRS-2008 but in case it helps others - Microsoft have improved this in SSRS 2016 - parameters can now be easily managed via the GUI in Report Builder / Visual studio:
https://www.intertech.com/ssrs-parameters-2016-update/

Dynamically change the background color of an object

I am using iReports for generating the PDF form. The requirement is to dynamically set jrxml object backgroundcolor.
I tried to pass the color from java to jrxml. IT didn't work. Any other ideas?
You can try to use styles of iReport and apply some predefied style
according to value of dynamically passed parameter.
Before generating the report you can parse jrxml using some lighter
language (Groovy, Ruby), find needed tag and correct value of appropriate
property.