I've read a fair amount on this issue but nothing seems to be working.
So far I have made sure that the StoreGeneratedPattern Identity is on two tables. I checked the model AND store. Both have the property set. However, when I insert into these tables, both ids are '0'.
I hope that someone familiar with these issues can take a look and tell me where I've got it wrong
Thanks
Here is the generated xml (irrelevant tables removed):
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="rule_testModel.Store" Provider="MySql.Data.MySqlClient" ProviderManifestToken="5.7" Alias="Self" xmlns:store="http://schemas.microsoft.com/ado/2007/12/edm/EntityStoreSchemaGenerator" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">
<Key>
<PropertyRef Name="RateId" />
<PropertyRef Name="RateTypeId" />
<PropertyRef Name="PaymentPlanId" />
<PropertyRef Name="TariffDescriptionId" />
<PropertyRef Name="FeatureId" />
<PropertyRef Name="FuelId" />
<PropertyRef Name="Live" />
</Key>
<Property Name="RateId" Type="uint" Nullable="false" />
<Property Name="Profile" Type="uint" />
<Property Name="REC" Type="varchar" MaxLength="10" />
<Property Name="PlanName" Type="varchar" MaxLength="300" />
<Property Name="RateTypeId" Type="uint" Nullable="false" />
<Property Name="PaymentPlanId" Type="uint" Nullable="false" />
<Property Name="Product" Type="varchar" MaxLength="45" />
<Property Name="ContractDuration" Type="varchar" MaxLength="45" />
<Property Name="TariffDescriptionId" Type="uint" Nullable="false" />
<Property Name="TariffUnrestricted" Type="decimal" Precision="6" Scale="3" />
<Property Name="TariffDay" Type="decimal" Precision="6" Scale="3" />
<Property Name="TariffNight" Type="decimal" Precision="6" Scale="3" />
<Property Name="TariffEveningWeekend" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargePenceDay" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargeGBPQuarter" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargeGBPMonth" Type="decimal" Precision="6" Scale="3" />
<Property Name="StandingChargeGBPYear" Type="decimal" Precision="6" Scale="3" />
<Property Name="CapacityCharge" Type="decimal" Precision="7" Scale="3" />
<Property Name="FeatureId" Type="uint" Nullable="false" />
<Property Name="FromCon" Type="uint" />
<Property Name="ToCon" Type="uint" />
<Property Name="Version" Type="varchar" MaxLength="45" />
<Property Name="PriceType" Type="varchar" MaxLength="45" />
<Property Name="Duration" Type="uint" />
<Property Name="SupplierId" Type="uint" />
<Property Name="FuelId" Type="uint" Nullable="false" />
<Property Name="ProposedStartDate" Type="date" />
<Property Name="SignWindow" Type="uint" />
<Property Name="DateAdded" Type="datetime" Precision="0" StoreGeneratedPattern="Identity" />
<Property Name="Live" Type="uint" Nullable="false" />
<Property Name="MaxRate" Type="decimal" Precision="6" Scale="3" />
<Property Name="MaxSc" Type="decimal" Precision="6" Scale="3" />
<Property Name="UpStep" Type="decimal" Precision="6" Scale="3" />
</EntityType>
<EntityType Name="conditions">
<Key>
<PropertyRef Name="ConditionId" />
</Key>
<Property Name="ConditionId" Type="uint" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="ProductId" Type="uint" Nullable="false" />
<Property Name="Profile" Type="usmallint" />
<Property Name="REC" Type="varchar" MaxLength="10" />
<Property Name="RateTypeId" Type="uint" />
<Property Name="PaymentPlanId" Type="uint" />
<Property Name="FeatureId" Type="uint" />
<Property Name="FromCon" Type="uint" />
<Property Name="ToCon" Type="uint" />
<Property Name="Duration" Type="uint" />
<Property Name="SupplierId" Type="uint" />
<Property Name="FuelId" Type="uint" />
<Property Name="live" Type="bool" />
<Property Name="TempRateId" Type="uint" />
</EntityType>
<EntityType Name="products">
<Key>
<PropertyRef Name="ProductId" />
</Key>
<Property Name="ProductId" Type="uint" Nullable="false" StoreGeneratedPattern="Identity" />
<Property Name="RateId" Type="uint" />
<Property Name="FromProductId" Type="uint" />
<Property Name="ServiceRef" Type="uint" />
<Property Name="UpCom" Type="decimal" Precision="6" Scale="3" />
<Property Name="UpSC" Type="decimal" Precision="6" Scale="3" />
<Property Name="FixedCom" Type="decimal" Precision="8" Scale="3" />
<Property Name="Live" Type="bool" Nullable="false" />
<Property Name="BrokerId" Type="uint" />
<Property Name="MaxRate" Type="decimal" Precision="6" Scale="3" />
<Property Name="MaxSC" Type="decimal" Precision="6" Scale="3" />
<Property Name="Step" Type="decimal" Precision="6" Scale="3" />
<Property Name="Fits" Type="decimal" Precision="6" Scale="3" />
<Property Name="Disc" Type="decimal" Precision="6" Scale="3" />
<Property Name="UpliftTypeId" Type="uint" Nullable="false" />
<Property Name="SupplierId" Type="uint" Nullable="false" />
<Property Name="FromCon" Type="uint" />
<Property Name="ToCon" Type="uint" />
</EntityType>
<Key>
<PropertyRef Name="word_id" />
</Key>
<Property Name="word_id" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="word_context" Type="varchar" MaxLength="45" Nullable="false" />
<Property Name="word_word" Type="varchar" MaxLength="255" Nullable="false" />
</EntityType>
<EntityContainer Name="rule_testModelStoreContainer">
<EntitySet Name="conditions" EntityType="Self.conditions" Schema="rule_test" store:Type="Tables" />
<EntitySet Name="products" EntityType="Self.products" Schema="rule_test" store:Type="Tables" />
</EntityContainer>
</Schema></edmx:StorageModels>
<!-- CSDL content -->
<edmx:ConceptualModels>
<Schema Namespace="rule_testModel" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
<EntityContainer Name="eBroker2Entities" annotation:LazyLoadingEnabled="true">
<EntitySet Name="products" EntityType="rule_testModel.product" />
<EntitySet Name="conditions" EntityType="rule_testModel.condition" />
</EntityContainer>
<EntityType Name="product">
<Key>
<PropertyRef Name="ProductId" />
</Key>
<Property Name="ProductId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="RateId" Type="Int32" />
<Property Name="FromProductId" Type="Int32" />
<Property Name="ServiceRef" Type="Int32" />
<Property Name="UpCom" Type="Decimal" />
<Property Name="UpSC" Type="Decimal" />
<Property Name="FixedCom" Type="Decimal" />
<Property Name="Live" Type="Boolean" Nullable="false" />
<Property Name="BrokerId" Type="Int32" />
<Property Name="MaxRate" Type="Decimal" />
<Property Name="MaxSC" Type="Decimal" />
<Property Name="Step" Type="Decimal" />
<Property Name="Fits" Type="Decimal" />
<Property Name="Disc" Type="Decimal" />
<Property Name="UpliftTypeId" Type="Int32" Nullable="false" />
<Property Name="SupplierId" Type="Int32" Nullable="false" />
<Property Name="FromCon" Type="Int32" />
<Property Name="ToCon" Type="Int32" />
</EntityType>
<EntityType Name="condition">
<Key>
<PropertyRef Name="ConditionId" />
</Key>
<Property Name="ConditionId" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="ProductId" Type="Int32" Nullable="false" />
<Property Name="Profile" Type="Int32" />
<Property Name="REC" Type="String" MaxLength="10" FixedLength="false" Unicode="false" />
<Property Name="RateTypeId" Type="Int32" />
<Property Name="PaymentPlanId" Type="Int32" />
<Property Name="FeatureId" Type="Int32" />
<Property Name="FromCon" Type="Int32" />
<Property Name="ToCon" Type="Int32" />
<Property Name="Duration" Type="Int32" />
<Property Name="SupplierId" Type="Int32" />
<Property Name="FuelId" Type="Int32" />
<Property Name="live" Type="Boolean" />
<Property Name="TempRateId" Type="Int32" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
<edmx:Mappings>
<Mapping Space="C-S" xmlns="http://schemas.microsoft.com/ado/2009/11/mapping/cs">
<EntityContainerMapping StorageEntityContainer="rule_testModelStoreContainer" CdmEntityContainer="eBroker2Entities">
<EntitySetMapping Name="products">
<EntityTypeMapping TypeName="rule_testModel.product">
<MappingFragment StoreEntitySet="products">
<ScalarProperty Name="ToCon" ColumnName="ToCon" />
<ScalarProperty Name="FromCon" ColumnName="FromCon" />
<ScalarProperty Name="SupplierId" ColumnName="SupplierId" />
<ScalarProperty Name="UpliftTypeId" ColumnName="UpliftTypeId" />
<ScalarProperty Name="Disc" ColumnName="Disc" />
<ScalarProperty Name="Fits" ColumnName="Fits" />
<ScalarProperty Name="Step" ColumnName="Step" />
<ScalarProperty Name="MaxSC" ColumnName="MaxSC" />
<ScalarProperty Name="MaxRate" ColumnName="MaxRate" />
<ScalarProperty Name="BrokerId" ColumnName="BrokerId" />
<ScalarProperty Name="Live" ColumnName="Live" />
<ScalarProperty Name="FixedCom" ColumnName="FixedCom" />
<ScalarProperty Name="UpSC" ColumnName="UpSC" />
<ScalarProperty Name="UpCom" ColumnName="UpCom" />
<ScalarProperty Name="ServiceRef" ColumnName="ServiceRef" />
<ScalarProperty Name="FromProductId" ColumnName="FromProductId" />
<ScalarProperty Name="RateId" ColumnName="RateId" />
<ScalarProperty Name="ProductId" ColumnName="ProductId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="conditions">
<EntityTypeMapping TypeName="rule_testModel.condition">
<MappingFragment StoreEntitySet="conditions">
<ScalarProperty Name="TempRateId" ColumnName="TempRateId" />
<ScalarProperty Name="live" ColumnName="live" />
<ScalarProperty Name="FuelId" ColumnName="FuelId" />
<ScalarProperty Name="SupplierId" ColumnName="SupplierId" />
<ScalarProperty Name="Duration" ColumnName="Duration" />
<ScalarProperty Name="ToCon" ColumnName="ToCon" />
<ScalarProperty Name="FromCon" ColumnName="FromCon" />
<ScalarProperty Name="FeatureId" ColumnName="FeatureId" />
<ScalarProperty Name="PaymentPlanId" ColumnName="PaymentPlanId" />
<ScalarProperty Name="RateTypeId" ColumnName="RateTypeId" />
<ScalarProperty Name="REC" ColumnName="REC" />
<ScalarProperty Name="Profile" ColumnName="Profile" />
<ScalarProperty Name="ProductId" ColumnName="ProductId" />
<ScalarProperty Name="ConditionId" ColumnName="ConditionId" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild" Value="true" />
<DesignerProperty Name="EnablePluralization" Value="true" />
<DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
<DesignerProperty Name="UseLegacyProvider" Value="true" />
<DesignerProperty Name="CodeGenerationStrategy" Value="None" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx></Mapping>
</edmx:Mappings>
</edmx:Runtime>
<!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
<Designer xmlns="http://schemas.microsoft.com/ado/2009/11/edmx">
<Connection>
<DesignerInfoPropertySet>
<DesignerProperty Name="MetadataArtifactProcessing" Value="EmbedInOutputAssembly" />
</DesignerInfoPropertySet>
</Connection>
<Options>
<DesignerInfoPropertySet>
<DesignerProperty Name="ValidateOnBuild" Value="true" />
<DesignerProperty Name="EnablePluralization" Value="true" />
<DesignerProperty Name="IncludeForeignKeysInModel" Value="true" />
<DesignerProperty Name="UseLegacyProvider" Value="true" />
<DesignerProperty Name="CodeGenerationStrategy" Value="None" />
</DesignerInfoPropertySet>
</Options>
<!-- Diagram content (shape and connector positions) -->
<Diagrams></Diagrams>
</Designer>
</edmx:Edmx>
Doh!
So it turns out it didn't like the db types I was using such as unsigned
Related
Trying to load an FXML file in Eclipse and continue to get exceptions. Here is my main:
package application;
import java.io.IOException;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
static Tracker money = new Tracker(0,0,0);
static Tracker steel = new Tracker(0,0,0);
static Tracker titanium = new Tracker(0,0,0);
static Tracker plant = new Tracker(0,0,0);
static Tracker power = new Tracker(0,0,0);
static Tracker heat = new Tracker(0,0,0);
public static void main(String[] args) {
Application.launch(args);
}
#Override
public void start(Stage primaryStage){
try {
FXMLLoader loader = new FXMLLoader(Main.class.getResource("board.fxml"));
Parent root = (Parent) loader.load();
primaryStage.setScene(new Scene(root));
primaryStage.show();
} catch(NullPointerException e)
{
System.out.print("NullPointerException Caught");
e.printStackTrace();
}catch(IOException e) {
System.out.print("IOException Caught");
e.printStackTrace();
}
}
public static void nextGen() {
money.produce();
steel.produce();
titanium.produce();
plant.produce();
power.produce();
heat.produce();
}
public static void change() {
money.change();
steel.change();
titanium.change();
plant.change();
power.change();
heat.change();
}
}
I did the separate catches to see what is actually happening for Exceptions as I thought it was NullPointer at first (may still be that if a null val into the loader would give that) but the catch is happening with the IOException. I don't really know where to go from here, just would like some guidance.
EDIT
Added e.printStackTrace() per suggestion:
IOException Caughtjavafx.fxml.LoadException:
/C:/Users/pcher/eclipse-workspace/board/bin/application/board.fxml:8
at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2707)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:933)
at javafx.fxml/javafx.fxml.FXMLLoader$InstanceDeclarationElement.processAttribute(FXMLLoader.java:981)
at javafx.fxml/javafx.fxml.FXMLLoader$Element.processStartElement(FXMLLoader.java:230)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processStartElement(FXMLLoader.java:755)
at javafx.fxml/javafx.fxml.FXMLLoader.processStartElement(FXMLLoader.java:2808)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2634)
at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2548)
at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:2516)
at board/application.Main.start(Main.java:27)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: application.BoardCo
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at javafx.fxml/javafx.fxml.FXMLLoader$ValueElement.processAttribute(FXMLLoader.java:931)
... 17 more
Here is the FXML:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<TitledPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" text="Terraforming Mars Tracker" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.BoardCo">
<content>
<GridPane prefHeight="388.0" prefWidth="598.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints maxHeight="154.0" minHeight="154.0" prefHeight="154.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="154.0" minHeight="154.0" prefHeight="154.0" vgrow="SOMETIMES" />
<RowConstraints maxHeight="113.0" minHeight="0.0" prefHeight="41.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TitledPane animated="false" text="Money">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutX="-1.0" layoutY="-2.0" prefHeight="130.0" prefWidth="194.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Steel" GridPane.columnIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField editable="false" GridPane.columnIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Titanium" GridPane.columnIndex="2">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Plant" GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Power" GridPane.columnIndex="1" GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<TitledPane animated="false" text="Heat" GridPane.columnIndex="2" GridPane.rowIndex="1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<GridPane layoutY="-1.0" prefHeight="130.0" prefWidth="194.0">
<children>
<TextField editable="false" text="Production:" GridPane.rowIndex="1" />
<TextField editable="false" text="Change:" GridPane.rowIndex="2" />
<TextField editable="false" text="Total:" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="1" />
<TextField GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField editable="false" GridPane.columnIndex="1" />
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
</children>
</AnchorPane>
</content>
</TitledPane>
<Button mnemonicParsing="false" onAction="#btnNextGenClicked" text="Next Generation" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Button mnemonicParsing="false" onAction="#btnChangeClicked" text="Change" GridPane.columnIndex="1" GridPane.rowIndex="2" />
</children>
</GridPane>
</content>
</TitledPane>
And here is my controller (bare bones at the moment):
package application;
import javafx.fxml.FXML;
import javafx.event.ActionEvent;
public class BoardController {
// Event Listener on Button.onAction
#FXML
public void btnNextGenClicked(ActionEvent event) {
Main.nextGen();
}
// Event Listener on Button.onAction
#FXML
public void btnChangeClicked(ActionEvent event) {
Main.change();
}
}
I have a master report that is composed of tree sub-reports. My datasource is a JSON. Two of them use a nested object in the JSON. While the third one is a sub-report that uses the first level object and inside the sub-report there's other sub-report that uses one of the nested objects.
Everything works, except that the last sub-report (the one with other sub-report) does not render in the pdf. But the .jasper file shows everything perfectly.
I suspect the issue might be here in the Master, but I tried using .subDataSource("data") and did not work.
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE})]]></dataSourceExpression>
<subreportExpression><![CDATA["PaymentDetails.jasper"]]></subreportExpression>
Here if my master source:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.12.2.final using JasperReports Library version 6.12.2-75c5e90a222ab406e416cbf590a5397028a52de3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Master" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4f5fe1d5-cd4c-40e9-84cb-283072ae1080">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DataAdapterDummyJSON.xml"/>
<queryString language="json">
<![CDATA[data]]>
</queryString>
<field name="idcNumber" class="java.lang.Long">
<property name="net.sf.jasperreports.json.field.expression" value="idcNumber"/>
<fieldDescription><![CDATA[idcNumber]]></fieldDescription>
</field>
<field name="cesco" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="cesco"/>
<fieldDescription><![CDATA[cesco]]></fieldDescription>
</field>
<field name="digitalExpirationDate" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="digitalExpirationDate"/>
<fieldDescription><![CDATA[digitalExpirationDate]]></fieldDescription>
</field>
<field name="licenseRenewalDate" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="licenseRenewalDate"/>
<fieldDescription><![CDATA[licenseRenewalDate]]></fieldDescription>
</field>
<field name="reportCreationDate" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="reportCreationDate"/>
<fieldDescription><![CDATA[reportCreationDate]]></fieldDescription>
</field>
<field name="firstName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="firstName"/>
<fieldDescription><![CDATA[firstName]]></fieldDescription>
</field>
<field name="lastName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="lastName"/>
<fieldDescription><![CDATA[lastName]]></fieldDescription>
</field>
<field name="realId" class="java.lang.Boolean">
<property name="net.sf.jasperreports.json.field.expression" value="realId"/>
<fieldDescription><![CDATA[realId]]></fieldDescription>
</field>
<field name="requiredDocuments" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="requiredDocuments"/>
<fieldDescription><![CDATA[requiredDocuments]]></fieldDescription>
</field>
<field name="finesCount" class="java.lang.Long">
<property name="net.sf.jasperreports.json.field.expression" value="finesCount"/>
<fieldDescription><![CDATA[finesCount]]></fieldDescription>
</field>
<field name="finesTotal" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="finesTotal"/>
<fieldDescription><![CDATA[finesTotal]]></fieldDescription>
</field>
<field name="lateFees" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="lateFees"/>
<fieldDescription><![CDATA[lateFees]]></fieldDescription>
</field>
<field name="finesDiscount" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="finesDiscount"/>
<fieldDescription><![CDATA[finesDiscount]]></fieldDescription>
</field>
<field name="totalPayment" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="totalPayment"/>
<fieldDescription><![CDATA[totalPayment]]></fieldDescription>
</field>
<field name="transactionReceipt" class="java.lang.Long">
<property name="net.sf.jasperreports.json.field.expression" value="transactionReceipt"/>
<fieldDescription><![CDATA[transactionReceipt]]></fieldDescription>
</field>
<field name="charges" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="charges"/>
<fieldDescription><![CDATA[charges]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="77" splitType="Stretch">
<image>
<reportElement x="1" y="8" width="125" height="55" uuid="5a5eb6db-21f4-4b5f-9300-0548557abcf5">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["/ImageAssets/Logo_CESCO_Black_300-01.png"]]></imageExpression>
</image>
<image>
<reportElement x="481" y="0" width="72" height="72" uuid="98c2d26d-807e-4b19-883a-c6bff6fdf73c">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/QR_Code_Example.svg/1200px-QR_Code_Example.svg.png"]]></imageExpression>
</image>
<image>
<reportElement x="1" y="8" width="125" height="55" uuid="e10d2e29-5aad-43a9-8d2f-5c83ae03f97c">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["/ImageAssets/Logo_CESCO_Black_300-01.png"]]></imageExpression>
</image>
<image>
<reportElement x="481" y="0" width="72" height="72" uuid="ee058ffd-c593-4b2c-b881-090fc5609564">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<imageExpression><![CDATA["https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/QR_Code_Example.svg/1200px-QR_Code_Example.svg.png"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band height="47" splitType="Stretch">
<staticText>
<reportElement x="-20" y="15" width="595" height="30" uuid="0bb6a402-68b5-4219-9b02-6ebe161a9541"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="18" isBold="true"/>
</textElement>
<text><![CDATA[RENOVACIÓN LICENCIA DE CONDUCIR]]></text>
</staticText>
</band>
</pageHeader>
#Removed some code
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="14" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[CATEGORÍA:]]></text>
</staticText>
<staticText>
<reportElement x="319" y="148" width="12" height="19" uuid="9f3ecc36-81ae-47b3-9ea3-b4dcc512c0ed">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.y" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="SansSerif" size="16" isBold="true"/>
</textElement>
<text><![CDATA[3]]></text>
</staticText>
<staticText>
<reportElement x="226" y="167" width="80" height="19" uuid="d354a581-b0c4-4bf4-8c7d-69d074a68a55">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="14" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[REAL ID:]]></text>
</staticText>
<textField>
<reportElement x="291" y="166" width="27" height="19" uuid="23265294-9d3e-4477-95b0-e909a00c94cb">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="16" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{realId}==true? "Sí":"No"]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="390" y="149" width="165" height="19" uuid="1e9fa600-6ec5-4c51-aa75-dbf1baf0141f">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="14" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[EXPIRACIÓN LICENCIA²: ]]></text>
</staticText>
<staticText>
<reportElement x="390" y="165" width="100" height="19" uuid="2e0ebfac-95d6-42fa-a2cf-d66239ce7cb1">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[03.28.2020]]></text>
</staticText>
<staticText>
<reportElement x="1" y="227" width="552" height="22" uuid="d9bad373-99d0-4c17-93d0-fd3b344ea75e">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="12" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[Este comunicado también ha sido enviado a su correo electrónico. ]]></text>
</staticText>
<staticText>
<reportElement x="1" y="262" width="552" height="22" uuid="65d43d45-15cc-4583-b692-fa3134371d23">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="12" isBold="false" isItalic="false"/>
</textElement>
<text><![CDATA[Documentos necesarios para el recogido de la licencia:]]></text>
</staticText>
<subreport>
<reportElement x="-1" y="304" width="200" height="200" uuid="c02143c5-340d-4ea3-9273-6943e1c584d4"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("requiredDocuments")]]></dataSourceExpression>
<subreportExpression><![CDATA["RequiredDocuments.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement x="-1" y="527" width="489" height="30" uuid="3f6f6d12-3927-44cc-b9f3-14209f477ad7">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement>
<font size="12"/>
</textElement>
<text><![CDATA[De no tener algunos de estos documentos favor de seguir las instrucciones adjuntas. ]]></text>
</staticText>
</band>
<band height="267">
<subreport>
<reportElement x="0" y="0" width="200" height="200" uuid="609a4eec-e75a-4a28-8581-68143de0ca0f"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("requiredDocuments")]]></dataSourceExpression>
<subreportExpression><![CDATA["Instructions.jasper"]]></subreportExpression>
</subreport>
</band>
<band height="327">
<subreport>
<reportElement x="0" y="0" width="200" height="200" uuid="1b33f2fc-6d44-4325-a789-0fc342a008ff"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE})]]></dataSourceExpression>
<subreportExpression><![CDATA["PaymentDetails.jasper"]]></subreportExpression>
</subreport>
</band>
<band height="273"/>
</detail>
</jasperReport>
Here is the sub-report:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.12.2.final using JasperReports Library version 6.12.2-75c5e90a222ab406e416cbf590a5397028a52de3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="PaymentDetails" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0dc66f1e-e4eb-4e3d-8d6c-ae4885e87beb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="DataAdapterDummyJSON.xml"/>
<queryString language="json">
<![CDATA[data]]>
</queryString>
<field name="idcNumber" class="java.lang.Long">
<property name="net.sf.jasperreports.json.field.expression" value="idcNumber"/>
<fieldDescription><![CDATA[idcNumber]]></fieldDescription>
</field>
<field name="cesco" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="cesco"/>
<fieldDescription><![CDATA[cesco]]></fieldDescription>
</field>
<field name="digitalExpirationDate" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="digitalExpirationDate"/>
<fieldDescription><![CDATA[digitalExpirationDate]]></fieldDescription>
</field>
<field name="licenseRenewalDate" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="licenseRenewalDate"/>
<fieldDescription><![CDATA[licenseRenewalDate]]></fieldDescription>
</field>
<field name="reportCreationDate" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="reportCreationDate"/>
<fieldDescription><![CDATA[reportCreationDate]]></fieldDescription>
</field>
<field name="firstName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="firstName"/>
<fieldDescription><![CDATA[firstName]]></fieldDescription>
</field>
<field name="lastName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="lastName"/>
<fieldDescription><![CDATA[lastName]]></fieldDescription>
</field>
<field name="realId" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="realId"/>
<fieldDescription><![CDATA[realId]]></fieldDescription>
</field>
<field name="requiredDocuments" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="requiredDocuments"/>
<fieldDescription><![CDATA[requiredDocuments]]></fieldDescription>
</field>
<field name="finesCount" class="java.lang.Long">
<property name="net.sf.jasperreports.json.field.expression" value="finesCount"/>
<fieldDescription><![CDATA[finesCount]]></fieldDescription>
</field>
<field name="finesTotal" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="finesTotal"/>
<fieldDescription><![CDATA[finesTotal]]></fieldDescription>
</field>
<field name="lateFees" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="lateFees"/>
<fieldDescription><![CDATA[lateFees]]></fieldDescription>
</field>
<field name="finesDiscount" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="finesDiscount"/>
<fieldDescription><![CDATA[finesDiscount]]></fieldDescription>
</field>
<field name="totalPayment" class="java.math.BigDecimal">
<property name="net.sf.jasperreports.json.field.expression" value="totalPayment"/>
<fieldDescription><![CDATA[totalPayment]]></fieldDescription>
</field>
<field name="transactionReceipt" class="java.lang.Long">
<property name="net.sf.jasperreports.json.field.expression" value="transactionReceipt"/>
<fieldDescription><![CDATA[transactionReceipt]]></fieldDescription>
</field>
<field name="charges" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="charges"/>
<fieldDescription><![CDATA[charges]]></fieldDescription>
</field>
<title>
<band height="78" splitType="Stretch">
<staticText>
<reportElement x="3" y="20" width="550" height="30" uuid="9ce0ef48-484d-47ab-bf80-d0bb95fd1088">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="18" isBold="true"/>
</textElement>
<text><![CDATA[RENOVACIÓN LICENCIA DE CONDUCIR]]></text>
</staticText>
</band>
</title>
<detail>
<band height="394" splitType="Stretch">
<staticText>
<reportElement x="64" y="43" width="180" height="19" uuid="f08338a2-802f-4364-acd2-27b71f9d7471">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[Total de Multas Pagadas]]></text>
</staticText>
<ellipse>
<reportElement x="417" y="35" width="35" height="35" backcolor="#000000" uuid="1c9546ef-1912-4bd7-8262-a98eb975a369">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</ellipse>
<textField>
<reportElement x="418" y="42" width="33" height="20" forecolor="#FFFFFF" uuid="0a905bc6-f610-473b-a072-82b4fedbe3df"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{finesCount}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement x="-20" y="86" width="595" height="194" forecolor="#E7EAF3" backcolor="#E7EAF3" uuid="54b7e75d-d7bf-49b6-9e3b-4f31e55b83f0"/>
</rectangle>
<staticText>
<reportElement x="100" y="105" width="144" height="20" uuid="47909c9c-799b-49aa-8729-5ca6c67253e8">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15"/>
</textElement>
<text><![CDATA[TOTAL MULTAS]]></text>
</staticText>
<textField>
<reportElement x="320" y="105" width="132" height="20" uuid="27d867e0-05ad-441c-9fc9-6c15cc880f16">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["$"+ new DecimalFormat("0,000.00").format($F{finesTotal})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="100" y="125" width="144" height="20" uuid="b827a62f-0a49-4ccd-9e16-19a774cc7160">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15"/>
</textElement>
<text><![CDATA[TOTAL RECARGOS]]></text>
</staticText>
<textField>
<reportElement x="320" y="125" width="132" height="20" uuid="d85a9481-6155-49c6-b6ce-702fcdaa1d28">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15" isBold="true" isStrikeThrough="true"/>
</textElement>
<textFieldExpression><![CDATA["$"+ new DecimalFormat("0.00").format($F{lateFees})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="100" y="146" width="144" height="20" uuid="10fe7f0c-1150-4f81-b4ac-8a1e4af1d436">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15"/>
</textElement>
<text><![CDATA[DESCUENTO]]></text>
</staticText>
<textField>
<reportElement x="320" y="146" width="132" height="20" uuid="0afe46fe-e810-4814-b097-7516857e3d4a">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["$"+ new DecimalFormat("0,000.00").format($F{finesDiscount})]]></textFieldExpression>
</textField>
<subreport>
<reportElement x="-20" y="170" width="595" height="60" uuid="3dd7434b-6819-47b1-a8ac-f06ae115a79b"/>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("charges")]]></dataSourceExpression>
<subreportExpression><![CDATA["Charges.jasper"]]></subreportExpression>
</subreport>
<staticText>
<reportElement x="100" y="252" width="144" height="20" uuid="7f82cf48-5018-4599-b347-1dc8c2d526db">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15" isBold="true"/>
</textElement>
<text><![CDATA[TOTAL]]></text>
</staticText>
<textField>
<reportElement x="320" y="252" width="132" height="20" uuid="8ad2b87b-dd19-4805-a209-627bdfade9c2">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="15" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["$"+ new DecimalFormat("0,000.00").format($F{totalPayment})]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="19" y="300" width="53" height="19" uuid="897df478-65c7-4c00-8329-2e1aa4e6aa49">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[FECHA:]]></text>
</staticText>
<textField pattern="MM.dd.yyyy">
<reportElement x="75" y="300" width="100" height="19" uuid="0664dddc-1ac7-4c4f-b4be-f39a03f783a7">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="20" y="320" width="170" height="19" uuid="0db8a6d8-eec7-4823-aacd-21231b060fd7">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[RECIBO TRANSACCIÓN:]]></text>
</staticText>
<textField>
<reportElement x="195" y="319" width="85" height="19" uuid="f1228671-c223-4289-b5fa-7981036edcc4">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{transactionReceipt}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="300" y="303" width="70" height="19" uuid="a099e44b-9331-471a-91b1-10b5fbdc1b87">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14"/>
</textElement>
<text><![CDATA[MOTIVO:]]></text>
</staticText>
<staticText>
<reportElement x="300" y="319" width="260" height="19" uuid="dada3803-b9bc-40f2-8e00-61901fbc3d40">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[Renovación de Licencia de Conducir]]></text>
</staticText>
</band>
</detail>
</jasperReport>
And this is the JSON File I'm using:
{
"data": {
"idcNumber": 1234567890123,
"cesco": "Sagrado Corazón",
"digitalExpirationDate": "2020-04-07 09:27:45",
"licenseRenewalDate": "2020-04-07 09:27:45",
"reportCreationDate": "2020-04-07 09:27:45",
"firstName": "Hermanegildo M.",
"lastName": "Maldonado Rodríguez",
"realId": true,
"requiredDocuments": [
{
"documentNumber": 1,
"title": "Este Documento Impreso o Digital",
"instruction": ""
},
{
"documentNumber": 2,
"title": "Licencia Actual",
"instruction": ""
},{
"documentNumber": 3,
"title": "Seguro Social / Pasaporte",
"instruction": "<b"
},{
"documentNumber": 4,
"title": "Recibo Agua, Luz, etc.",
"instruction": ""
},{
"documentNumber": 5,
"title": "Foto y Firma Digitalizada",
"instruction": "En "
}
],
"finesCount": 25,
"finesTotal": 15000.00,
"lateFees": 60.00,
"finesDiscount": 3000.00,
"totalPayment": 12022.00,
"transactionReceipt": 120459593030,
"charges": [
{
"chargeName": "Renovación Digital",
"chargeAmount": 11.00
},
{
"chargeName": "Renovación",
"chargeAmount": 11.00
}
]
}
}
The quickest solution would be to reuse the same data adapter in your third subreport since it does not seem to be related to the master one. The necessary steps are described here.
Another solution would be to switch to JSONQL for the query language, instead of JSON. This would allow you to navigate up in the JSON tree when constructing new instances of the data source with the subDataSource() method.
I am trying to run the code of that is taken directly from primefaces website, but i am getting an error of UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
/This is my AddUser.xhtml 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"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
>
<h:head>
<title>Getting User Information</title>
</h:head>
<h:body>
<h:form>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuView.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuView.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuView.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px" placeholder="Search"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</h:form>
</h:body>
</html>
/This is my web.xml file/
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>UserWebApp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>afterdark</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>/WEB-INF/my.taglib.xml</param-value>
</context-param>
</web-app>
/And my jar file is also placed in webInf/lib/
I have tried everything available online but still unable o solve it
Thanks in advance
I figured out the problem. I was copying the MenuBar code directly from primefaces website (https://www.primefaces.org/showcase/ui/menu/menubar.xhtml)
And then i realized that there are invisible characters/stuff present between each line of code. (i figured this out when i copied/paste java class code),
once these invisible stuff id deleted and my code works perfectly.
/Following code is also the primefaces website code but free of invisible characters/
<h:form>
<p:growl id="messages"/>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-w" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuView.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuView.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuView.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px" placeholder="Search"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</h:form>
This error can happen also for using HTML comments inside <p:contextmenu> between <p:menuitem>, which cause the error
UIInstructions cannot be cast to org.primefaces.model.menu.MenuElement
<p:contextmenu ...>
<!-- Menu Item XYZ -->
<p:menuitem ...>
I'm able to view the app locally in the browser which I built using phonegap.The same app's zip file I uploaded in adobephonegapbuild and once the built was over I downloaded the apk file to view my app locally in my phone.But I'm unable to do perform operations like login and logout in my app.What shall be done to avoid this?Could someone provide with a solution asap?
here's the config.xml i have been using for this app i'm building:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.Netvarth.YNW1" version="1.0.0" versionCode="1" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://netvarth.com/ns/1.0">
<name>ynw</name>
<description>Appointment managagement app</description>
<author email="support#netvarth.com" href="http://netvarth.com">netvarth Team</author>
<content src="index.html" />
<preference name="permissions" value="none" />
<preference name="orientation" value="default" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="14" />
<preference name="android-installLocation" value="auto" />
<gap:plugin name="org.apache.cordova.battery-status" />
<gap:plugin name="org.apache.cordova.camera" />
<gap:plugin name="org.apache.cordova.media-capture" />
<gap:plugin name="org.apache.cordova.console" />
<gap:plugin name="org.apache.cordova.contacts" />
<gap:plugin name="org.apache.cordova.device" />
<gap:plugin name="org.apache.cordova.device-motion" />
<gap:plugin name="org.apache.cordova.device-orientation" />
<gap:plugin name="org.apache.cordova.dialogs" />
<gap:plugin name="org.apache.cordova.file" />
<gap:plugin name="org.apache.cordova.file-transfer" />
<gap:plugin name="org.apache.cordova.geolocation" />
<gap:plugin name="org.apache.cordova.globalization" />
<gap:plugin name="org.apache.cordova.inappbrowser" />
<gap:plugin name="org.apache.cordova.media" />
<gap:plugin name="org.apache.cordova.network-information" />
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:plugin name="org.apache.cordova.vibration" />
<icon src="icon.png" />
<icon gap:platform="android" gap:qualifier="ldpi" src="www/res/icon/android/icon-36-ldpi.png" />
<icon gap:platform="android" gap:qualifier="mdpi" src="www/res/icon/android/icon-48-mdpi.png" />
<icon gap:platform="android" gap:qualifier="hdpi" src="www/res/icon/android/icon-72-hdpi.png" />
<icon gap:platform="android" gap:qualifier="xhdpi" src="www/res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="blackberry" src="www/res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="www/res/icon/blackberry/icon-80.png" />
<icon gap:platform="ios" height="57" src="www/res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="www/res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="www/res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="www/res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="webos" src="www/res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="www/res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="www/res/icon/windows-phone/icon-173-tile.png" />
<gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="www/res/screen/android/screen-ldpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="www/res/screen/android/screen-mdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="www/res/screen/android/screen-hdpi-portrait.png" />
<gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="www/res/screen/android/screen-xhdpi-portrait.png" />
<gap:splash gap:platform="blackberry" src="www/res/screen/blackberry/screen-225.png" />
<gap:splash gap:platform="ios" height="480" src="www/res/screen/ios/screen-iphone-portrait.png" width="320" />
<gap:splash gap:platform="ios" height="960" src="www/res/screen/ios/screen-iphone-portrait-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1136" src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png" width="640" />
<gap:splash gap:platform="ios" height="1024" src="www/res/screen/ios/screen-ipad-portrait.png" width="768" />
<gap:splash gap:platform="ios" height="768" src="www/res/screen/ios/screen-ipad-landscape.png" width="1024" />
<gap:splash gap:platform="winphone" src="www/res/screen/windows-phone/screen-portrait.jpg" />
<access origin="http://54.215.5.201/" />
<plugin name="cordova-plugin-whitelist" version="1" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<engine name="android" spec="~5.1.1" />
</widget>
The solution to your predicament does not lie in the config.xml
During development and testing relative urls definitely work, e.g (./services/login.php), since the files are sitting physically in the same location. But once you package the app these relative links are broken since php doesn't run on the phone, neither is the mysql database exported with the app's HTML5 and php files.
It is important to have the database and files you are calling to be resident on the internet. Then edit the files you will zip and upload to Phonegap Build to make the API calls to http://your-domain.tld/services/login.php
I need to return all XML nodes whose ID attributes match between <Settings></Settings> and <Profile></Profile> and whose <Setting/> node has a Value attribute of true.
An example of my XML structure is found below:
<HBDI>
<Settings>
<Setting ID="PreferenceCode" Visible="true"/>
<Setting ID="SequenceCode" Visible="true"/>
<Setting ID="QuadrantScores" Visible="false"/>
<Setting ID="AdjectivePairs" Visible="false"/>
<Setting ID="ModeScores" Visible="true"/>
<Setting ID="Graph" Visible="true"/>
</Settings>
<Profile>
<PreferenceCode ID="PreferenceCode">3332</PreferenceCode>
<SequenceCode ID="SequenceCode">DCAB</SequenceCode>
<Graph ID="Graph">Graph.jpg</Graph>
<QuadrantScores ID="QuadrantScores">
<QuadrantScore Name="A" Value="3" />
<QuadrantScore Name="B" Value="3" />
<QuadrantScore Name="C" Value="23" />
<QuadrantScore Name="D" Value="46" />
</QuadrantScores>
<AdjectivePairs ID="AdjectivePairs">
<AdjectivePair Name="A" Value="4" />
<AdjectivePair Name="B" Value="7" />
<AdjectivePair Name="C" Value="9" />
<AdjectivePair Name="D" Value="10" />
</AdjectivePairs>
<ModeScores ID="ModeScores">
<ModeScore Name="Lt" Value="34" />
<ModeScore Name="Rt" Value="54" />
<ModeScore Name="Upr" Value="3" />
<ModeScore Name="Lwr" Value="24" />
</ModeScores>
</Profile>
</HBDI>
So what I want to achieve is to retrieve the following xml:
<HBDI>
<PreferenceCode ID="PreferenceCode">3332</PreferenceCode>
<SequenceCode ID="SequenceCode">DCAB</SequenceCode>
<Graph ID="Graph">Graph.jpg</Graph>
<ModeScores ID="ModeScores">
<ModeScore Name="Lt" Value="34" />
<ModeScore Name="Rt" Value="54" />
<ModeScore Name="Upr" Value="3" />
<ModeScore Name="Lwr" Value="24" />
</ModeScores>
</HBDI>
So, in the case of ID="PreferenceCode", it's corresponding Visible attribute in <Settings/> is true, thus it needs to be returned. I must admit that I have no idea on how to do the match-up between the IDs. Any help please?
When you are dealing with XML, use XQuery:
DECLARE #MyXML xml = '
<HBDI>
<Settings>
<Setting ID="PreferenceCode" Visible="true"/>
<Setting ID="SequenceCode" Visible="true"/>
<Setting ID="QuadrantScores" Visible="false"/>
<Setting ID="AdjectivePairs" Visible="false"/>
<Setting ID="ModeScores" Visible="true"/>
<Setting ID="Graph" Visible="true"/>
</Settings>
<Profile>
<PreferenceCode ID="PreferenceCode">3332</PreferenceCode>
<SequenceCode ID="SequenceCode">DCAB</SequenceCode>
<Graph ID="Graph">Graph.jpg</Graph>
<QuadrantScores ID="QuadrantScores">
<QuadrantScore Name="A" Value="3" />
<QuadrantScore Name="B" Value="3" />
<QuadrantScore Name="C" Value="23" />
<QuadrantScore Name="D" Value="46" />
</QuadrantScores>
<AdjectivePairs ID="AdjectivePairs">
<AdjectivePair Name="A" Value="4" />
<AdjectivePair Name="B" Value="7" />
<AdjectivePair Name="C" Value="9" />
<AdjectivePair Name="D" Value="10" />
</AdjectivePairs>
<ModeScores ID="ModeScores">
<ModeScore Name="Lt" Value="34" />
<ModeScore Name="Rt" Value="54" />
<ModeScore Name="Upr" Value="3" />
<ModeScore Name="Lwr" Value="24" />
</ModeScores>
</Profile>
</HBDI>'
SELECT #MyXML.query('
<HDBI> {
let $settings := /HBDI/Settings
for $element in /HBDI/Profile/*
where $settings/Setting[#ID = local-name($element) and #Visible = "true"]
return $element
} </HDBI>
')
The XQuery loops through each child node of the <Profile> tag and check if it's set to #Visible = "true" in the <Settings> node. local-name() gives the name of the current node.