Jaspersoft studio connecting list with sub dataset with report main data set - dataset

I'm new at jaspersoft studio and I couldn't find proper solution for my problem. My impression is that this is pretty simple but I can't solve it on my own. I think I need step by step explanation on how to do it...
So, this what I what to achieve:
I have XML file with structure like this:
`
<Model>
<chapter>
<id>943</id>
<name>ChapterName</name>
<status>0/2</status>
<items>
<id>56441</id>
<number>1.</number>
<check>Default</check>
<question>text</question>
</items>
<items>
<id>56542</id>
<number>2.</number>
<check>Default</check>
<question>text</question>
</items>
</chapter>
<chapter>
<id>944</id>
<name>ChapterName</name>
<status>0/2</status>
<items>
<id>45542</id>
<number>1.</number>
<check>Default</check>
<question>text</question>
</items>
<items>
<id>21456</id>
<number>2.</number>
<check>Default</check>
<question>text</question>
</items>
</chapter>
</Model>
`
2. My report should look like this:
Name of chapter and below all items that are belonging to that chapter
it should list all chapters with its belonging items
Best solution is to sort items based on the id of chapter because it is unique integer
I created main dataset with fields of /Model/chapter
and sub dataset with fields of /Model/chapter/items
In report in detail band I put id and name (of chapter) and below it I created List with Dataset Run to be sub dataset I created (/Model/chapter/items)
what i see now in previewer is list of chapters and all items from file are joined to each chapter
It needs to be filtered to join items to chapter based on the chapter id
I need to create parameter which will sort items but i dont know how to create it to work.
It seems pretty easy but I just dont know how to make it work. Can someone please help me?

Related

Having an issue with XML containing nested objects to POCO (de)serialisation (VB.Net)

I've created an SP in SQL Server that returns as XML. I decided to do this as the information has contacts and addresses in it and I wanted to reduce the amount of data I get.
<Accounts>
<Account>
<Company />
<ContactNumber />
<Addresses>
<Address>
<Line1 />
....
</Address>
<Addresses>
<Contacts>
<Contact>
<Name />
....
</Contact>
<Account>
</Accounts>
I have found SqlCommand.ExecuteXmlReader but I'm confused as to how to serialise this into my POCO. Can someone point me at what my next step is. (The POCO was created by the Insert XML as a class menu item in VS2019).
My Google fu is letting me down as I'm not sure what I should be looking for to help understand how to serialize the XML into something that will allow me to go with Foreach Account in AccountsClass type logic.
Any help is greatly appreciated.
PS The XML above is just a sample to show what I'm doing. The actual data is over 70 fields and with two FK joins the initial 40000 rows is well in excess of 1.8 million once selected as a normal dataset.
EDIT: Just in case someone stumbles on this and are in the same situation I was in.
When preparing a sample record for the Past XML to class make sure you have more than one record if you are expecting something similar to my example above. (The class changes to support more than one record.)
You get very different results when searching for deserialize when doing your research. This small change resulted in me figuring out the issue.

How do I set a conditional for a checkbox in an access report

so basically I am making a student database that contains student grades, I have a query that gives me a list of what classes a specific student has taken that are part of their major.
This is what the query returns:
Query result
So what I want to do is create a report that has a section like this where it lists all possible classes they can taken per that major:
Report
and I want to have a checkbox next to each class and have the box be checked off if they have taken the class, if they have not I want the box to be empty, so I don't necessarily need anything on the report like grades etc. I just want it checked off if they have taken that specific class . How can I go about this, lost on this part.
Although more information may be required to answer your question correctly, I'll give this a shot:
Assuming your the check box in question is called "Check1" and the table in question is called "Table1" and the field is called "Test" and the Report you mentioned is a form called "Report"... AND its only on the table when it has been completed.
Something to the effect of an "On Load" command into the form like:
If Not IsNull(DLookup("Class_UID", "Table1", "Class_UID = 'INF-202'")) Then
Forms("Report").Check1.Value = 1
End If
Of course, this would need to be added for each unique Class_UID
It's a simplistic way to do it, but far from the only option.

Finding an id from the given table by using selenium web driver

How can I find "id" of above web table, if I only know name of a particular customer. For example from the above table how can I find "CUSTOMER ID" of "THOMAS HANDY".
The code you are looking for looks similar this (Note this is written in Ruby)
if(tab['class'].include?(var))
tab is a selector variable.
var would be what you want it to have.
So something like the following...
#Logic to Loop through each table - Parameterising it as table
if(table.text.include?('Thomas Hardy'))
table['id']
end
#End of Loop Logic
Although as people have said, you're missing lots of info

Where is the data saved, from the Datatable-items, in ECM eRoom-database?

I am trying to retrieve data out of the ECM eRoom Database (which isn't documented, as I know of).
I have an eRoom with an custom "Database", some Fields.
When I query the objects table I find the "Database" row
select * from[dbo].[Objects] where internalId = 1234567
and the Rows for the entries
select top 10 * from[dbo].[Objects] where parentInternalId = 1234567
but I don't find any field with the values of the entries, only an Column with NonSearchableProperties., that is only full with Hex Data.
My Question(s),
how could i retrieve the values?
Is it possible to retrieve them with mere SQL?
What is the simplest way?
This is not the silver bullet, but it is okay for my usecase
After long goolging and alot of test scripts, i found some answers, but probably due to the fact the the system is soon end-of-life and that the documentation is not easy to read, here are my finding.
Is it possible to retrieve them with mere SQL?
As far as I could find out, no! (please correct me If I'm wrong)
how could i retrieve the values?
With the eRoom API(on the Server there are some Sample programms to query the data/objects <installation-path>\eRoom Server\Toolkit\Samples, with c++, vb, vbscript, ... all a bit to much overhead), or with the eRoom XML Query Language(exql) over soap calls.
What is the simplest way?
After alot of tests, searching in forums and many tests with soap ui. I found out that queries with exql seem to be the simplest way to retrieve Data, if you understand the structure.
Here some ressource that were helpful:
(very) Basic info of exql from the manufacturer https://eroom.asce.org/eRoomHelp/en/XML_Help/Introduction.htm
(disclaimer: I didn't find it helpful, but it shows at least some basics)
short 9 page Developer guide https://developer-content.emc.com/developer/downloads/eRoomXMLCapabilitiesUseCaseProgramDashboard.pdf (the last example on page 8, helped me understand how to setup the query, with alot of fantasy)
But for this to work, don't forget, to activate Allow XML queries and commands from external applications in the Site Settings
TIP 1:
you always can go go deeper you just need to know the right xml-element under. <Database>, <Cells> and <DBCell> can help you go deeper
TIP 2:
don't query to much data since this query likely run into timeouts
Update 1:
Just to save time for anyone who is looking, this "query" returns all rows (properties) for a Database(s) created in an eRoom Root.
(don't forget to set facility and room in the Url ex. http://server/eroomxml/facilities/TEST/Rooms/TestRoom, although it could be set in the query)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:er="http://www.eroom.com/eRoomXML/2003/700">
<soapenv:Header/>
<soapenv:Body>
<er:ExecuteXMLCommand>
<er:eRoomXML>
<er:command er:select="HomePage/Items">
<er:getproperties>
<er:Item>
<Database>
<Rows>
<Item>
<Cells>
<DBCell>
<Content>
</Content>
</DBCell>
</Cells>
</Item>
</Rows>
</Database>
</er:Item>
</er:getproperties>
</er:command>
</er:eRoomXML>
</er:ExecuteXMLCommand>
</soapenv:Body>
</soapenv:Envelope>

How to create a table in adf with variable no of columns

Hello I am developing a web application using ADF (jdeve11.1.2.4). I know how to populate a table programatically from this post Programmatic ADF Table
But in the above post the no of columns are fixed (It is bean structure). But I cannot use the above post. Because I need to create a table with 'n' no-of columns. Means Columns are not fixed. Some times the columns may be 4 or some times the columns may be 7 and what ever it may be. Suppose I have two sqls and both contains differnt no of columns.
Ex: (suppose student is a table)
select id from student
select id,name from student
so in the above two sqls no of columns are diffent. I need to show the resul set of the above queries in a tablular format.
Please help me how I can achieve this.
Thanks in advance.
I wonder if declarative mode view objects would help? Blog here. So the query is not built until the UI is gen'd. You could dynamically generate the table and insert columns and then bind to the VO.
That's quite complex to do and it may require some extra study:
create a programatic view object by passing your sql statement using:
ApplicationModuleImpl.createViewObjectFromQueryStmt(java.lang.String voName,java.lang.String query)
try to construct af:columns in a loop:
<af:table value="#{bindings.EmployeesView1.collectionModel}" .. id="t1">
<af:iterator id="i1" value="#{bindings.EmployeesView1.attributesModel.attributes}" var="column" rows="0">
<af:column headerText="#{column.label}" id="c1">
<af:outputText id="d1" attributeModel="#{column}" value="#{row.bindings[column.name].inputValue}" />
</af:column>
</af:iterator>
</af:table>

Resources