Element type "conditionalStyle" must be declared - error after adding new style - styles

I added new style to my jrtx file:
<style name="BackgroundStyle" mode="Opaque" backcolor="gray">
<conditionalStyle>
<conditionExpression>Boolean.valueOf($V{REPORT_COUNT}.intValue() % 2 == 0)</conditionExpression>
<style backcolor="lightGray"/>
</conditionalStyle>
</style>
And in the report errors I see - Caused by: org.xml.sax.SAXParseException: Element type "conditionalStyle" must be declared.
Help me to fix it, please

The problem was constraint in Jasper not to use conditional style with Template option
Solution to use it in style direct not in template

Related

Remove unnecessary namespace from xml in DOCX4j

When i extracted excel generated using docx4j implementation I can see below extra namespaces:
<xdr:wsDr xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:cdr="http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" xmlns:c14="http://schemas.microsoft.com/office/drawing/2007/8/2/chart" xmlns:dgm="http://schemas.openxmlformats.org/drawingml/2006/diagram" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:xdr="http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" xmlns:dsp="http://schemas.microsoft.com/office/drawing/2008/diagram" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:xvml="urn:schemas-microsoft-com:office:excel" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:pvml="urn:schemas-microsoft-com:office:powerpoint" xmlns:cppr="http://schemas.microsoft.com/office/2006/coverPageProps" xmlns:odx="http://opendope.org/xpaths" xmlns:odc="http://opendope.org/conditions" xmlns:odq="http://opendope.org/questions" xmlns:oda="http://opendope.org/answers" xmlns:odi="http://opendope.org/components" xmlns:odgm="http://opendope.org/SmartArt/DataHierarchy" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:msink="http://schemas.microsoft.com/ink/2010/main" xmlns:cdr14="http://schemas.microsoft.com/office/drawing/2010/chartDrawing" xmlns:c15="http://schemas.microsoft.com/office/drawing/2012/chart" xmlns:cs="http://schemas.microsoft.com/office/drawing/2012/chartStyle" xmlns:ns38="http://www.w3.org/1998/Math/MathML" xmlns:ns39="http://www.w3.org/2003/InkML" xmlns:a13cmd="http://schemas.microsoft.com/office/drawing/2013/main/command" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart" xmlns:dgm1611="http://schemas.microsoft.com/office/drawing/2016/11/diagram" xmlns:c173="http://schemas.microsoft.com/office/drawing/2017/03/chart" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:an18="http://schemas.microsoft.com/office/drawing/2018/animation" xmlns:anam3d="http://schemas.microsoft.com/office/drawing/2018/animation/model3d" xmlns:iact="http://schemas.microsoft.com/office/powerpoint/2014/inkAction" xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:wetp="http://schemas.microsoft.com/office/webextensions/taskpanes/2010/11" xmlns:we="http://schemas.microsoft.com/office/webextensions/webextension/2010/11" xmlns:comp="http://schemas.openxmlformats.org/drawingml/2006/compatibility" xmlns:lc="http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas" xmlns:dgm14="http://schemas.microsoft.com/office/drawing/2010/diagram" xmlns:a15="http://schemas.microsoft.com/office/drawing/2012/main" xmlns:pic14="http://schemas.microsoft.com/office/drawing/2010/picture" xmlns:c16ac="http://schemas.microsoft.com/office/drawing/2014/chart/ac" xmlns:a16="http://schemas.microsoft.com/office/drawing/2014/main" xmlns:a1611="http://schemas.microsoft.com/office/drawing/2016/11/main" xmlns:dgm1612="http://schemas.microsoft.com/office/drawing/2016/12/diagram" xmlns:a16svg="http://schemas.microsoft.com/office/drawing/2016/SVG/main" xmlns:adec="http://schemas.microsoft.com/office/drawing/2017/decorative" xmlns:a18hc="http://schemas.microsoft.com/office/drawing/2018/hyperlinkcolor" xmlns:wp15="http://schemas.microsoft.com/office/word/2012/wordprocessingDrawing">
How do i remove this?
Code implementation link :
Excel size decreases on resaving using docx4j library implementation
Try using MOXy, or set property docx4j.jaxb.marshal.canonicalize=true
From https://github.com/plutext/docx4j/blob/master/docx4j-samples-resources/src/main/resources/docx4j.properties#L160
# Whether to canonicalize during marshalling (defaults to false).
# This is mainly for aesthetic purposes: the Sun/Oracle JAXB reference implementation
# writes a lot of unnecessary namespaces (each one in the JAXB context?). MOXy is better.
# Set this to true to get rid of them via an extra step: canonicalization
# since docx4j 3.3.1
docx4j.jaxb.marshal.canonicalize=false
Run an XSLT 2.0+ transformation consisting essentially of
<xsl:copy-of select="/" copy-namespaces="no"/>

Binding to current source ("{Binding .}") in WinRT

In WPF, if I want to reference the whole object (not a specific property) in a binding, I can write any of the following:
{Binding Path=.}
{Binding .}
{Binding}
Like so:
<ItemsControl ItemsSource="{Binding Widgets}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<controls:WidgetControl Widget="{Binding}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
However in WinRT I have not been able to get this to work:
<GridView ItemsSource="{Binding Source={StaticResource Widgets}}">
<GridView.ItemTemplate>
<DataTemplate>
<controls:WidgetControl Widget="{Binding}"/>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
It fails with a very vague exception:
The text associated with this error code could not be found.
Failed to assign to property 'XX.WidgetControl.Widget'. [Line: XX Position: XX]
The ItemsSource binding works because the DataContext of each controls:WidgetControl gets set to a Widget. And I know the obvious answer to this is just to wait for the DataContext to be set and cast that to a Widget inside my widget control. But I'm asking on principle: Why doesn't self-binding work in WinRT... or is there a notation to make it work?
So it turns out {Binding} works just great. I had wrongly set the DataContext in my WidgetControl, causing the binding to fail and leading me to believe the WinRT binding mechanism was at fault.
To be clear, {Binding .} still doesn't work like it does in WPF as best as I can tell. It interprets the dot as a literal property name instead of a reference to self:
Error: BindingExpression path error: '.' property not found on 'Widget'. BindingExpression: Path='.' DataItem='Widget'
But my actual problem was trying to change the DataContext at the root level of my WidgetControl, causing any external bindings to fail. Because I defined my control as <UserControl x:Name='controlRoot' DataContext="{Binding ElementName=controlRoot}, the binding in <controls:WidgetControl Widget="{Binding}"/> was referencing the WidgetControl itself and not the Widget I was trying to pass in. And the "failed to assign to property" exception was thrown by a property changed handler that was expecting a Widget, not a WidgetControl.
So you can absolutely use {Binding} to reference the DataContext of the thing the binding is on, just don't try to set the path to ".".

Object doesn't support property or method 'igTree' error when running Infragistics Tree Control

I am trying to set up a tree view using an entity framework data object (EF 6 in MVC 5). I've run into a problem when I try to Render() my tree.... I receive the 'Object doesn't support property or method 'igTree'' error.
My code to set up the tree (in my view):
#(Html.Infragistics()
.Tree()
.Bindings(bindings =>
{
bindings.
TextKey("L1Name").
PrimaryKey("L1TODSID").
ValueKey("L1TODSID").
ChildDataProperty("L2Name").
Bindings(b1 =>
{
b1.
TextKey("L2Name").
ValueKey("L2TODSID").
PrimaryKey("L2TODSID");
});
})
.DataSource(Model)
.DataBind()
.Render()
)
I get no errors until I add in the 'Render()' call.
I read a post on the Infragistics forum asking if they will be supporting MVC 5... Are they not doing that? Is that my issue?
Also, these are my calling scripts:
<!-- Ignite UI Required Combined CSS Files -->
<link href="#Url.Content("~/igniteui/css/themes/infragistics/infragistics.theme.css")" rel="stylesheet" />
<link href="#Url.Content("~/igniteui/css/structure/infragistics.css")" rel="stylesheet" />
<script src="#Url.Content("~/Scripts/modernizr-2.7.2.js")"></script>
<script src="#Url.Content("~/Scripts/jquery-2.0.3.min.js")"></script>
<script src="#Url.Content("~/Scripts/jquery-ui-1.10.3.min.js")"></script>
<!-- Ignite UI Required Combined JavaScript Files -->
<script src=#Url.Content("~/igniteui/js/infragistics.core.js")></script>
<script src=#Url.Content("~/igniteui/js/infragistics.lob.js")></script>
#(Html.Infragistics()
.Loader()
.ScriptPath("~/igniteui/js/")
.CssPath("~/igniteui/css/")
.Render()
)
Thanks in advance!
EDIT: Final Resolve.
Just in case anyone else ever runs accross this situation...
I knew this error ('Object doesn't support property or method...') could be caused by jquery loading twice. Thought I had thoroughly checked all script calls. However, being new to .NET and MVC 5 (razor), I completely missed this line at the end of my layout page (I didn't set up the project originally):
#Scripts.Render("~/bundles/jquery")
So...
In the end, I was initiallizing JQuery in my script block at the top (with a call to the minified file), then I was calling it again, which is what caused the error.
A big thanks to #nemesv, because the fact that he explained the loading process in greater detail than I could find online gave me the confidence to know that I was doing things correctly on that side. Then I just needed to hunt down the second call to initialize JQ.
Thanks again!
By default (if you are not using the loader infrastructure)
The .Render() call will render the following HTML:
<script type="text/javascript">
$(function () {$('#Tree1').igTree({ dataSource: ... });});
</script>
So you get the exception on the igTree function call which would initialize the tree.
Your igTree function can be undefined:
If you are not loading the necessary igniteui scripts:
<script src=#Url.Content("~/igniteui/js/infragistics.core.js")></script>
<script src=#Url.Content("~/igniteui/js/infragistics.lob.js")></script>
Make sure that these scripts are included in your view or in your Layour file
If you are not using the rigth path or the scripts file are not there on the server:
Check for broken link in your browsers network console (F12 in IE/Chrome FireBug in FF):
If you 404 error next to your script you will know that they are not loaded correctly and you need to fix the paths.
If you are referencing jQuery more than once can cause this error too:
Foe example you have the <script src="#Url.Content("~/Scripts/jquery-2.0.3.min.js")"></script> in a partial which is loaded by Ajax multiple times, etc.
Make sure that you are referencing all your scripts once.
In the case of using the loader
When using the Loader infrasturure the .Render() call will render the a different HTML:
<script type="text/javascript">
$.ig.loader('igTree', function() {$('#Tree1').igTree({ dataSource: });});
</script>
So the loader will load the necessary script required by the tree so you don't need to include infragistics.core.js and infragistics.lob.js.
When using the loader in theory you could not the get the exception.
But if you call: #(Html.Infragistics().Loader()... after your Html.Infragistics().Tree() then the MVC wrapper does not that you are using the loader so it renders the HTML like when you don't use the loader so if you rightfully not referenced the infragistics.core.js and infragistics.lob.js. then you get the exception even if you are "using" the loader.
So make sure that you call #(Html.Infragistics().Loader()... before using any of the Infragistics controls.
I was also facing the same issue with MVC 4 and Ignite UI. Removing #Scripts.Render("~/bundles/jquery")
from the _Layout.cshtml resolved the issue.

Why SVG element definition in w3c always has full presentation attributes?

Recently, i have to dig into w3c specification, it's really mess :( while i reading specifications, i wonder Why SVG element definition in w3c always has full presentation attributes?
for example in 'mask' element definition
from: http://www.w3.org/TR/2011/REC-SVG11-20110816/masking.html#MaskElement
Attributes:
conditional processing attributes — ‘requiredFeatures’, ‘requiredExtensions’, ‘systemLanguage’
core attributes — ‘id’, ‘xml:base’, ‘xml:lang’, ‘xml:space’
presentation attributes — ‘alignment-baseline’, ‘baseline-shift’, ‘clip’, ‘clip-path’, ‘clip-rule’, ‘color’, ‘color-interpolation’, ‘color-interpolation-filters’, ‘color-profile’, ‘color-rendering’, ‘cursor’, ‘direction’, ‘display’, ‘dominant-baseline’, ‘enable-background’, ‘fill’, ‘fill-opacity’, ‘fill-rule’, ‘filter’, ‘flood-color’, ‘flood-opacity’, ‘font-family’, ‘font-size’, ‘font-size-adjust’, ‘font-stretch’, ‘font-style’, ‘font-variant’, ‘font-weight’, ‘glyph-orientation-horizontal’, ‘glyph-orientation-vertical’, ‘image-rendering’, ‘kerning’, ‘letter-spacing’, ‘lighting-color’, ‘marker-end’, ‘marker-mid’, ‘marker-start’, ‘mask’, ‘opacity’, ‘overflow’, ‘pointer-events’, ‘shape-rendering’, ‘stop-color’, ‘stop-opacity’, ‘stroke’, ‘stroke-dasharray’, ‘stroke-dashoffset’, ‘stroke-linecap’, ‘stroke-linejoin’, ‘stroke-miterlimit’, ‘stroke-opacity’, ‘stroke-width’, ‘text-anchor’, ‘text-decoration’, ‘text-rendering’, ‘unicode-bidi’, ‘visibility’, ‘word-spacing’, ‘writing-mode’
‘class’
‘style’
‘externalResourcesRequired’
‘x’
‘y’
‘width’
‘height’
‘maskUnits’
‘maskContentUnits’
presentation attributes always has full attributes but there are some of them is active with 'mask' element! Why does w3c just show active attribute?
======================================================================
maybe question is not clear, sorry for that, my English is really bad :(
one more example for my question is ‘flood-color’ attribute
from: http://www.w3.org/TR/2011/REC-SVG11-20110816/filters.html#FloodColorProperty
‘flood-color’
Value: currentColor |
<color> [<icccolor>] |
inherit
Initial: black
Applies to: ‘feFlood’ elements
Inherited: no
Percentages: N/A
Media: visual
Animatable: yes
you can see that: "Applies to: ‘feFlood’ elements" but when you see all attributes of 'mask' element above you also see ‘flood-color’ in there. So i wonder is ‘flood-color’ attribute active with 'mask' element or only active with 'feFlood' element? If not active with 'mask' why w3c list it in attributes of 'mask' element?
Sorry again for my English. Thank you so much!
The w3c wrote it this way because they thought it would be easier for implementers if all presentation attributes could be put on all elements regardless of whether they had any effect.

Parsing exception when using int-groovy:script tag

I am working on a Spring Integration project and writing a sample transformer using Groovy. Given below is the sample from the Spring configuration file --
<int:transformer input-channel="channel8" output-channel="channel9">
<int-groovy:script>
<![CDATA[
if (!payload.equals('hello')) {
throw new RuntimeException('invalid payload')
}
payload
]]>
</int-groovy:script>
</int:transformer>
I have imported the following namespace and also there is no error shown for the xml Spring configuration file in Eclipse editor.
xmlns:int-groovy="http://www.springframework.org/schema/integration/groovy"
However on running my program, I am seeing the following error --
Caused by: org.xml.sax.SAXParseException; lineNumber: 60; columnNumber: 24; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'int-groovy:script'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorRep‌​orter.java:437)
I am not sure on what I am missing here. Any help on this appreciated.
I think your missing the 'spring-integration-groovy-x.x.x.RELEASE.jar' file from your runtime path

Resources