DevExpress TreeList Control - c#-3.0

I need to display the xml data in the treelist control. I have one root node, one Child node and further four children for this child node.
I am not able to display it in the treelist. I am using the dataset.readXml method for reading the xml file and giving dataset as a datasource. Here is the code I am following:
DataSet dataSet = new DataSet();
dataSet.ReadXml(#"C:\foldersettings.xml");
treeList2.DataSource = dataSet;
treeList2.PopulateColumns();
treeList2.BestFitColumns();
treeList2.ExpandAll();
Can anyone tell me why am I not getting the data in treelist. I am using DevExpress 9.1 version control.

DataSet dataSet = new DataSet();
dataSet.ReadXml(#"C:\foldersettings.xml");
treeList2.DataSource = dataSet.Table[0];
treeList2.PopulateColumns();
treeList2.BestFitColumns();
treeList2.ExpandAll();

You should also set the KeyFieldName and ParentFieldName properties of the TreeList. Note, these properties should be set to the corresponding field names in the CaseSensitive manner. Also, the TreeList's DataSource should be set to dataSet.Tables[0]. I hope, this will help.

This treeList , from DevExpress will work fine if it will found in your DataSet dataSet in the first column Unique ID's, because it takes as Primary Keys, also, it must find a second column which will be considered like ParentId's.

Related

How to relate a column to the row rather than the other way in anylogic

I have created a database in anylogic. Previously, I have related the information in the row to the columnn, i.e. there is a component in the row, and its properties are in the columns, and have put this in a function. Now I want to make the component the column and the properties, but don't know how to make it all relate. Below is the code I've written for the former:
site = selectFrom(parameters) .where(parameters.box_number.eq(boxNumber)) .where(parameters.site.eq(site)) .firstResult(parameters.site);
So box_number is the component and site is one of the properties. With this method, site is a column, but I want it to be a row.
You should use the SELECT WHERE SQL syntax, see https://help.anylogic.com/index.jsp?topic=%2Fcom.anylogic.help%2Fhtml%2Fconnectivity%2Fquerying.html&resultof=%22%73%65%6c%65%63%74%22%20%22%77%68%65%72%65%22%20
You can filter and load data in any format. Also, best use the database query wizard to help:

Jaspersoft Table Element No data displayed

I have a table component on a subreport being used with an independent data source (dataset) thats hooked onto the table object. The table has two columns, the following issues arise upon debugging:
Not all descriptions are loaded from the query I used
The second column is not showing the data at all
Is there any properties that I am missing?
Thank you
Kind reagrds
Zain Nabi
Jasperstudio reports require all parameter names to be the same.

Passing data from main dataset to table dataset

I'm creating simple report in Jaspersoft Studio 5.6.1 with one table.
Sending data to this report from Java via JRBeanCollectionDataSource.
In report I already can get this data vie fields: report-> DAtaset and Query... -> JavaBean Tab ->
in Class Name write Java class, that comes in list in JRBeanCollectionDataSource -> add selected fields
So now I can display incoming data.
BUT if I want to do it in Table - I need to create Dataset (why?) and choose 'Use same connection used to fill the master report'. Adding same fields to new dataset doesn't help, neither choosing 'Connect to domain' for dataset. No errors displayed.
I need to create Dataset (why?)
In Jasper Reports tables are loosely coupled to the main report, i.e a table requires its own dataset to deal with.
Now say, you have JRBeanCollectionDataSource ready for the report and you wish to use it to fill table with it. Table as I said requires its own datasert, does also require its own datasource.
Now you can either specify a datasource or use same connection to fill the table as that of main report.
For more on jasper report tables visit this link and on java part visit here.
i had a similar problem. I find that you just need is set in the table of your report the REPORT_CONNECTION parameter like say
jaspercomunity
in this.
and then left the value in blank. Later in your java code use a maper object for set the SQL connection to your Data Base, something like this:
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&password=admin");
HashMap<String, Object> hm = new HashMap<String, Object>();
hm.put("REPORT_CONNECTION", conn);
jasperPrint = JasperFillManager.fillReport(reportPath, hm, beanCollectionDataSource);

JasperReports: dynamic report generation

I am new to JasperReports. I need to design a report where certain columns and rows are dynamic. For this how I have to design the report and after design i want to integrate with my application for fetching data from action class and dto. How to map data for its?
I don't know how dynamic it will be, but it may help you: http://dynamicjasper.com/
It uses JasperReports to generate your report and it also allow you to create your report on the fly.
There are 2 options to map data with the columns. First option is u can pass ur data into data Source binding with the column name as key value pair. And the second option is u can pass the obj of your dto to data source directly in list form.
Use report.setDataSource() for setting the data. In first option make sure your type of the data matches with the column name.

How to use the same datasource twice in JasperReports/iReport

I'm trying to work out how best to do reports with a chart then a table representing the same dataset. I need to overcome the positioning of the summary is at the bottom, so intend to use subreports and table-subreports. I am experimenting with two tables and a chart in one detail band.
If I set the datasourceexpression for to $P{REPORT_DATA_SOURCE} only the chart displays data (presumably the first subreport type item) and the tables are empty. Seems the data can be consumed only once?
If I use a Dataset to query the database it works however it executes the Query three times, once for each table/chart. That will be a massive overhead.
Obviously I am not doing this right but I cannot find any examples of using the same dataset more than once.
There is no simple answer so I have raised a feature request http://jasperforge.org/projects/jasperreports/tracker/view.php?id=5487
The suggested workarounds were:
implement a custom query executer to retrieve data from a cached datasource
generate a rewindable datasource based on the retrieved result set
Thanks to sanda aka shertage on the jasperforge forum for these suggestions.
An alternative solution, cloning the dataset:
http://code.google.com/p/cloning/
Cloner cloner=new Cloner();
ArrayList clone = cloner.deepClone(getSomeArrayList());
final JRDataSource ds = new JRBeanCollectionDataSource(AnotherBean);
HashMap parameters = new HashMap();
parameters.put("PARAM_A", new JRBeanCollectionDataSource(getSomeArrayList()));
parameters.put("PARAM_B", new JRBeanCollectionDataSource(clone));