How can I change granularity in highcharts? - highcharts

Is it possible to change granularity on graphics? I have such schedule:
How can I change granularity? That data would be displayed not on days but on months. For example: Sep, Oct, Dec etc.
Code report:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
<!-- 2016-01-31T20:54:38 -->
<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="Blank_A4_Landscape" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="a0a85c1c-ef3e-4a4d-bca5-2569e695b407">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="ireport.jasperserver.report.resource" value="/public/Blank_A4_Landscape_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/public/Blank_A4_Landscape"/>
<subDataset name="Dataset1" uuid="7d75e5f3-311c-4d74-8f4f-13af8f33cc78">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<queryString>
<![CDATA[SELECT top 100 * FROM Orders --WHERE "ORDERS"."SHIPPEDDATE" > NOW() - INTERVAL 30 DAY;]]>
</queryString>
<field name="ORDERID" class="java.lang.Integer"/>
<field name="CUSTOMERID" class="java.lang.String"/>
<field name="EMPLOYEEID" class="java.lang.Integer"/>
<field name="ORDERDATE" class="java.sql.Timestamp"/>
<field name="REQUIREDDATE" class="java.sql.Timestamp"/>
<field name="SHIPPEDDATE" class="java.sql.Timestamp"/>
<field name="SHIPVIA" class="java.lang.Integer"/>
<field name="FREIGHT" class="java.math.BigDecimal"/>
<field name="SHIPNAME" class="java.lang.String"/>
<field name="SHIPADDRESS" class="java.lang.String"/>
<field name="SHIPCITY" class="java.lang.String"/>
<field name="SHIPREGION" class="java.lang.String"/>
<field name="SHIPPOSTALCODE" class="java.lang.String"/>
<field name="SHIPCOUNTRY" class="java.lang.String"/>
</subDataset>
<queryString>
<![CDATA[Select * From Orders]]>
</queryString>
<field name="ORDERID" class="java.lang.Integer"/>
<field name="CUSTOMERID" class="java.lang.String"/>
<field name="EMPLOYEEID" class="java.lang.Integer"/>
<field name="ORDERDATE" class="java.sql.Timestamp"/>
<field name="REQUIREDDATE" class="java.sql.Timestamp"/>
<field name="SHIPPEDDATE" class="java.sql.Timestamp"/>
<field name="SHIPVIA" class="java.lang.Integer"/>
<field name="FREIGHT" class="java.math.BigDecimal"/>
<field name="SHIPNAME" class="java.lang.String"/>
<field name="SHIPADDRESS" class="java.lang.String"/>
<field name="SHIPCITY" class="java.lang.String"/>
<field name="SHIPREGION" class="java.lang.String"/>
<field name="SHIPPOSTALCODE" class="java.lang.String"/>
<field name="SHIPCOUNTRY" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="533" splitType="Stretch">
<componentElement>
<reportElement x="0" y="80" width="791" height="295" uuid="d836a1b4-c816-4f45-b0f8-0c3ac80a37a0"/>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="StackedColumn">
<hc:chartSetting name="default">
<hc:chartProperty name="chart.zoomType">
<hc:propertyExpression><![CDATA["xy"]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.href">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="plotOptions.pie.showInLegend" value="true"/>
<hc:chartProperty name="title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="chart.backgroundColor">
<hc:propertyExpression><![CDATA[new java.awt.Color(-16777216)]]></hc:propertyExpression>
</hc:chartProperty>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset>
<dataset>
<datasetRun subDataset="Dataset1" uuid="a05e665b-8ead-41d2-a6e8-3ebad99d8c4d"/>
</dataset>
</multiAxisDataset>
<dataAxis axis="Rows">
<axisLevel name="Level1">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression><![CDATA[$F{SHIPPEDDATE}]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Integer" calculation="DistinctCount">
<labelExpression><![CDATA["Total Orders"]]></labelExpression>
<valueExpression><![CDATA[$F{ORDERID}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1"/>
</hc:chart>
</componentElement>
</band>
</title>
</jasperReport>

Change your query to group and count data on month
Example (mysql syntax)
SELECT DATE_FORMAT(SHIPPEDDATE,'%y %M') as LABEL, COUNT(ORDERID) AS CNT_ORDERID
FROM Orders
GROUP BY YEAR(SHIPPEDDATE), MONTH(SHIPPEDDATE)
ORDER BY SHIPPEDDATE
Note: this will change your fields in Dataset1 (just 2, LABEL and CNT_ORDERID) and bucketExpression, valueExpression will point to the new fields.

Related

xslt - for-each-group challenge

My challenge is that I have to group everything in the values ​​/ value tags. I have to group every tag <Value ID="0" AttributeID="att_X">0 - AAAAA</Value> when there is a value with AAAAA in it.
The values ​​0 - AAAAA, 23 - AAAAA B, 12 - AAAAA C must come together in the output message, What is the best way to do this?
I have tried to group it
<xsl:for-each-group select="Entity/Values/Value[#AttributeID='att_PVPP']" group-by="substring-before(substring-after(Entity/Values/Value[#AttributeID='att_X'], '- '), ' ') ='AAAAA'">
also tried
<xsl:for-each-group select="Entity/Values/Value[#AttributeID='att_PVPP']" group-by="matches(Entity/Values/Value[#AttributeID='att_X'], 'AAAAA')">
and
<xsl:for-each select="matches(Entity/Values/Value[#AttributeID='att_X'], 'AAAAA')">
I have the following input xml:
<Entities>
<Entity Referenced="true" Selected="false" ParentID="P" UserTypeID="V" ID="PVP-1">
<Name>123456 - 0</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-06</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="0" AttributeID="att_X">0 - AAAAA</Value>
<Value AttributeID="att_PVPEi">2020-10-06</Value>
<Value UnitID="Y.unit." AttributeID="C">10</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-2">
<Name>789012 - 200</Name>
<Values>
<Value AttributeID="att_PVPS">2020-09-16</Value>
<Value AttributeID="att_PVPP">789012</Value>
<Value ID="200" AttributeID="att_X">200 - BBBBB</Value>
<Value AttributeID="att_PVPEi">2020-10-22</Value>
<Value UnitID="Y.unit." AttributeID="C">200</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-3">
<Name>123456 - 0</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-07</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="0" AttributeID="att_X">0 - BBBBB</Value>
<Value AttributeID="att_PVPEi">2020-10-13</Value>
<Value UnitID="Y.unit." AttributeID="C">1</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-4">
<Name>123456 - 23</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-16</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="23" AttributeID="att_X">23 - AAAAA B</Value>
<Value AttributeID="att_PVPEi">2020-10-21</Value>
<Value UnitID="Y.unit." AttributeID="C">1</Value>
<Value ID="3" AttributeID="att_Z">C</Value>
</Values>
</Entity>
<Entity Referenced="true" Selected="false" ParentID="W" UserTypeID="V" ID="PVP-5">
<Name>123456 - 12</Name>
<Values>
<Value AttributeID="att_PVPS">2020-10-14</Value>
<Value AttributeID="att_PVPP">123456</Value>
<Value ID="12" AttributeID="att_X">12 - AAAAA C</Value>
<Value AttributeID="att_PVPEi">2020-10-16</Value>
<Value UnitID="Y.unit." AttributeID="C">15</Value>
<Value ID="2" AttributeID="att_Z">A</Value>
</Values>
</Entity>
</Entities>
The output must be:
<test>
<test1>
<value-ID-att_X-att_X>0</value-ID-att_X>
<lines>
<line>
<att_PVPS>2020-10-06</att_PVPS>
<AttributeID-C>10</AttributeID-C>
<value-ID-att_Z>2</value-ID-att_Z>
</line>
</lines>
</test1>
<test1>
<value-ID-att_X>23</value-ID-att_X>
<lines>
<line>
<att_PVPS>2020-10-16</att_PVPS>
<AttributeID-C>1</AttributeID-C>
<value-ID-att_Z>3</value-ID-att_Z>
</line>
</lines>
</test1>
<test1>
<value-ID-att_X>12</value-ID-att_X>
<lines>
<line>
<att_PVPS>2020-10-14</att_PVPS>
<AttributeID-C>15</AttributeID-C>
<value-ID-att_Z>2</value-ID-att_Z>
</line>
</lines>
</test1>
</test>

Cytoskape xgmml edge.color and edge weight is not getting applied, how should I change this?

I made an .xgmml file to load into cytoscape. In the .xgmml I have different weights and colours for the edges (See bottom for the .xgmml file). However, when I load the .xgmml file into cytoscape and apply layout, the edges have the same weights and colour.
How can I apply the .xgmml edge weights and colours to the network?
<?xml version="1.0" encoding="UTF-8" ?>
<graph label="Depression" directed="0" xmlns="http://www.cs.rpi.edu/XGMML" schemaLocation="http://www.cs.rpi.edu/~puninj/XGMML/xgmml.xsd">
<node id="A" label="A">
<graphics type="rectangle" fill="#F8FF00"/>
<att name="description" value="A"/>
</node>
<node id="B" label="B">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="B"/>
</node>
<node id="C" label="C">
<graphics type="triangle" fill="#CC51FF"/>
<att name="description" value="C"/>
</node>
<edge id="rs2" label="TRANS" source="A" target="B" weight="10">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="51,153,25"/>
</edge>
<edge id="rs1" label="CIS" source="A" target="C" weight="1">
<att name="edge.shape" value="circle"/>
<att name="edge.color" value="0,153,0"/>
</edge>
</graph>
We don't use those properties. For color and width, we encode them as attributes in the graphic line:
<edge id="732" label="YDR412W (pp) YPR119W" source="386" target="382" cy:directed="1">
<att name="shared name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="shared interaction" value="pp" type="string" cy:type="String"/>
<att name="name" value="YDR412W (pp) YPR119W" type="string" cy:type="String"/>
<att name="selected" value="1" type="boolean" cy:type="Boolean"/>
<att name="interaction" value="pp" type="string" cy:type="String"/>
<att name="EdgeBetweenness" value="18040.0" type="real" cy:type="Double"/>
<att name="isInPath" value="0" type="boolean" cy:type="Boolean" cy:hidden="1"/>
<graphics width="5.0" fill="#FF00FF">
<att name="EDGE_STROKE_SELECTED_PAINT" value="#FF0000" type="string" cy:type="String"/>
<att name="EDGE_SELECTED" value="true" type="string" cy:type="String"/>
<att name="EDGE_TOOLTIP" value="" type="string" cy:type="String"/>
<att name="EDGE_LABEL_COLOR" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_BEND" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_LABEL" value="" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SIZE" value="6.0" type="string" cy:type="String"/>
<att name="EDGE_CURVED" value="true" type="string" cy:type="String"/>
<att name="EDGE_VISIBLE" value="true" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SELECTED_PAINT" value="#FFFF00" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_TRANSPARENCY" value="255" type="string" cy:type="String"/>
<att name="EDGE_TRANSPARENCY" value="170" type="string" cy:type="String"/>
<att name="EDGE_LINE_TYPE" value="SOLID" type="string" cy:type="String"/>
<att name="EDGE_SOURCE_ARROW_UNSELECTED_PAINT" value="#000000" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_FACE" value="Dialog.plain,plain,10" type="string" cy:type="String"/>
<att name="EDGE_LABEL_FONT_SIZE" value="10" type="string" cy:type="String"/>
<att name="EDGE_TARGET_ARROW_SHAPE" value="NONE" type="string" cy:type="String"/>
<att name="EDGE_LABEL_WIDTH" value="200.0" type="string" cy:type="String"/>
</graphics>
</edge>
This results in a magenta edge of width 5.
-- scooter

Unable to manually set the intervals for Y axis

I have a HTML5 column chart in my jasper report. I need to configure the y axis and be able to set the intervals manually
I have used,
<property name="net.sf.jasperreports.chart.range.axis.tick.count" value="false"/>
<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="2"/>
It has no effect on the chart
The source code is as follows
<?xml version="1.0" encoding="UTF-8"?>
<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="customizechart" pageWidth="1000" pageHeight="1000" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="23a00417-b19d-4f98-aa59-dc6422d51386">
<property name="net.sf.jasperreports.chart.range.axis.tick.count" value="false"/>
<property name="net.sf.jasperreports.chart.range.axis.tick.interval" value="2"/>
<queryString>
<![CDATA[Select * from some_table]]>
</queryString>
<field name="Name" class="java.lang.String"/>
<field name="AppliedQuantity" class="java.lang.Float"/>
<summary>
<band height="959" splitType="Stretch">
<componentElement>
<reportElement x="0" y="0" width="960" height="500" uuid="774dd6b9-b5b9-4d3c-b518-6f7c7ca40043"/>
<hc:chart xmlns:hc="http://jaspersoft.com/highcharts" xsi:schemaLocation="http://jaspersoft.com/highcharts http://jaspersoft.com/schema/highcharts.xsd" type="Column">
<hc:chartSetting name="default">
<hc:chartProperty name="chart.zoomType">
<hc:propertyExpression><![CDATA["xy"]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.enabled">
<hc:propertyExpression><![CDATA[false]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.href">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="credits.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
<hc:chartProperty name="yAxis.title.text">
<hc:propertyExpression><![CDATA[""]]></hc:propertyExpression>
</hc:chartProperty>
</hc:chartSetting>
<multiAxisData>
<multiAxisDataset/>
<dataAxis axis="Rows">
<axisLevel name="Name">
<labelExpression><![CDATA["Level Label expression"]]></labelExpression>
<axisLevelBucket class="java.lang.String">
<bucketExpression><![CDATA[$F{Name}]]></bucketExpression>
</axisLevelBucket>
</axisLevel>
</dataAxis>
<dataAxis axis="Columns"/>
<multiAxisMeasure name="Measure1" class="java.lang.Integer" calculation="Nothing">
<labelExpression><![CDATA["f"]]></labelExpression>
<valueExpression><![CDATA[$F{AppliedQuantity}]]></valueExpression>
</multiAxisMeasure>
</multiAxisData>
<hc:series name="Measure1"/>
</hc:chart>
</componentElement>
</band>
</summary>
</jasperReport>
Any ideas on this?
net.sf.jasperreports.chart.* properties apply to the charts built into the community/open source JasperReports library (which are based on JFreeChart).
For HTML5 charts - part of JasperReports Professional - what you have to do is set the yAxis.tickInterval property in the chart:
<hc:chartProperty name="yAxis.tickInterval">
<hc:propertyExpression><![CDATA[500]]></hc:propertyExpression>
</hc:chartProperty>

how to locate the new added field in Openerp when two of parent view's fields are repetitive?

I'm new to Openerp v 7.0,when I was trying to add one field in my inherited view, it didn't work. I found in parent view ,there were two fields has the same name , does this reason cause the problem?
here is the parent view code:
<page string="Contacts" attrs="{'invisible': [('is_company','=',False), ('child_ids', '=', [])]}" autofocus="autofocus">
<field name="child_ids" mode="kanban" context="{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier}">
<kanban>
<field name="color"/>
<field name="name"/>
<field name="title"/>
<field name="email"/>
<field name="parent_id"/>
<field name="is_company"/>
<field name="function"/>
<field name="phone"/>
<field name="street"/>
<field name="street2"/>
<field name="zip"/>
<field name="city"/>
<field name="country_id"/>
<field name="mobile"/>
<field name="fax"/>
<field name="state_id"/>
<field name="has_image"/>
<templates>
<t t-name="kanban-box">
<t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
<div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '')" style="position: relative">
<a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
<div class="oe_module_vignette">
<a type="open">
<t t-if="record.has_image.raw_value === true">
<img t-att-src="kanban_image('res.partner', 'image', record.id.value, {'preview_image': 'image_small'})" class="oe_avatar oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.image and record.image.raw_value !== false">
<img t-att-src="'data:image/png;base64,'+record.image.raw_value" class="oe_avatar oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.has_image.raw_value === false and (!record.image or record.image.raw_value === false)">
<t t-if="record.is_company.raw_value === true">
<img t-att-src='_s + "/base/static/src/img/company_image.png"' class="oe_kanban_image oe_kanban_avatar_smallbox"/>
</t>
<t t-if="record.is_company.raw_value === false">
<img t-att-src='_s + "/base/static/src/img/avatar.png"' class="oe_kanban_image oe_kanban_avatar_smallbox"/>
</t>
</t>
</a>
<div class="oe_module_desc">
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
<table class="oe_kanban_table">
<tr>
<td class="oe_kanban_title1" align="left" valign="middle">
<h4><a type="open"><field name="name"/></a></h4>
<i><div t-if="record.function.raw_value">
<field name="function"/></div></i>
<div><a t-if="record.email.raw_value" title="Mail" t-att-href="'mailto:'+record.email.value">
<field name="email"/>
</a></div>
<div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
<div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
<div t-if="record.fax.raw_value">Fax: <field name="fax"/></div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
<form string="Contact" version="7.0">
<sheet>
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" style="width: 70%%"/></h1>
<field name="category_id" widget="many2many_tags" placeholder="Tags..." style="width: 70%%"/>
</div>
<group>
<field name="function" placeholder="e.g. Sales Director"/>
<field name="email"/>
<field name="phone"/>
<field name="mobile"/>
</group>
<div>
<field name="use_parent_address"/><label for="use_parent_address"/>
</div>
<group>
<label for="type"/>
<div name="div_type">
<field class="oe_inline" name="type"/>
</div>
<label for="street" string="Address" attrs="{'invisible': [('use_parent_address','=', True)]}"/>
<div attrs="{'invisible': [('use_parent_address','=', True)]}" name="div_address">
<field name="street" placeholder="Street..."/>
<field name="street2"/>
<div class="address_format">
<field name="city" placeholder="City" style="width: 40%%"/>
<field name="state_id" class="oe_no_button" placeholder="State" style="width: 37%%" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
<field name="zip" placeholder="ZIP" style="width: 20%%"/>
</div>
<field name="country_id" placeholder="Country" class="oe_no_button" options='{"no_open": True}'/>
</div>
</group>
<field name="supplier" invisible="True"/> <-------------- 1st one
</sheet>
</form>
</field>
</page>
<page string="Sales & Purchases">
<group>
<group>
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company" widget="selection"/>
</group>
<group>
<field name="customer"/>
<field name="supplier"/><-----------------2nd one
</group>
<group>
<field name="ref"/>
<field name="lang"/>
<field name="date"/>
</group>
<group>
<field name="active"/>
</group>
</group>
</page>
……
there are two fields like in above code. what I wanted to do was added a new field name "product_categ_id" after the field. but it didn't work. here are my codes
<openerp>
<data>
<record model="ir.ui.view" id="rainsoft_partner_form_view">
<field name="name">rainsoft_partner.rainsoft_partner</field>
<field name="type">form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="title" position="after">
<field name="QQ" placeholder="input your QQ number here."/>
<!--<field name="product_categ_id"/>-->
</field>
<field name="supplier" position="after"> <-------------it doesn't work
<field name="product_categ_id"/>
</field>
<field name="date" position="replace">
<field name="date" string="合同开始日期"/>
</field>
<field name="date" position="after">
<field name="contract_end_date" string="合同结束日期" />
</field>
</field>
</record>
<record model="ir.ui.view" id="rainsoft_partner_tree_view">
<field name="name">rainsoft_partner.rainsoft_partner</field>
<field name="type">tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree"/>
<field name="arch" type="xml">
<field name="name" position="before" >
<field name="ref" string="No"/>
</field>
</field>
</record>
</data>
but when I replace " name='supplier' " by " name='customer' " it works, I guess coz the "customer" only show once in the code.
Anyone here has the resolution? Thanks a lot.
I've found the solution:
using the xpath instead of the way using field name positioning.
here is my new code:
<openerp>
<data>
<record id="res_partner_view_supplier_product_categ" model="ir.ui.view">
<field name="name">res.partner.view.supplier.product_categ</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="priority" eval="40"/>
<field name="arch" type="xml">
<xpath expr="/form/sheet/notebook/page[#string='Sales & Purchases']/group/group/field[#name='supplier']" position="after">
<field name="product_categ_id" attrs="{'invisible': [('supplier', '=', False)]}"/>
</xpath>
</field>
</record>
</data>

Limit on clientdataset columns and size

Is there a limit on the number of columns a client dataset can have and also is the limit on the size of the columns?
We have an app that loads the client dataset from an xml file (it is not a file on disk but an xml block in memory which is loaded) and we found that if we set the width on one of the columns to over a 1000, then we would get some obscure access violation (sometimes the application would just hang).
JD.
Ps. As far I can recall we are still using the client dataset which came with delphi 2006.
Okay, some code:
We have an xml block of data that is in this format:
string xmlDataSet=
<METADATA>
<FIELDS>
<FIELD attrname="f:CNAME" fieldtype="string" width="50"/>
<FIELD attrname="f:CTITL" fieldtype="string" width="500"/>
<FIELD attrname="f:ID" fieldtype="string" width="250"/>
<FIELD attrname="f:CREDT" fieldtype="string" width="250"/>
<FIELD attrname="f:HEADT" fieldtype="string" width="500"/>
<FIELD attrname="f:BODYT" fieldtype="string" width="500"/>
<FIELD attrname="f:DATE1" fieldtype="string" width="500"/>
<FIELD attrname="f:TIME1" fieldtype="string" width="500"/>
<FIELD attrname="f:DATE2" fieldtype="string" width="500"/>
<FIELD attrname="f:TIME2" fieldtype="string" width="500"/>
<FIELD attrname="f:IMG_1" fieldtype="string" width="500"/>
<FIELD attrname="f:IMG_2" fieldtype="string" width="500"/>
<FIELD attrname="f:IMG_3" fieldtype="string" width="500"/>
<FIELD attrname="f:VID_1" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_A" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_B" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_C" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_D" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_E" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_F" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_G" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_H" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_I" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_J" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_K" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_L" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_M" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_N" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_O" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_P" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_Q" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_R" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_S" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_T" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_U" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_V" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_W" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_X" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_Y" fieldtype="string" width="500"/>
<FIELD attrname="f:FLD_Z" fieldtype="string" width="500"/>
</FIELDS>
</METADATA>
<ROWDATA>
<ROW f:DATE2="" f:TIME2="" f:IMG_2="" f:IMG_3="" f:VID_1="" f:FLD_A="" f:FLD_B="" f:FLD_C="" f:FLD_D="" f:FLD_E="" f:FLD_F="" f:FLD_G="" f:FLD_H="" f:FLD_I="" f:FLD_J="" f:FLD_K="" f:FLD_L="" f:FLD_M="" f:FLD_N="" f:FLD_O="" f:FLD_P="" f:FLD_Q="" f:FLD_R="" f:FLD_S="" f:FLD_T="" f:FLD_U="" f:FLD_V="" f:FLD_W="" f:FLD_X="" f:FLD_Y="" f:FLD_Z="" f:CNAME="YahooNewsTopStories" f:CTITL="Yahoo! News: Top Stories" f:ID="ap/20100119/cb_haiti_earthquake" f:HEADT="Haiti chaos hampers aid delivery; death toll rises (AP)" f:BODYT="AP - Relief workers say pockets of violence in Haiti's devastated capital are hindering a slow increase in much-needed aid delivery, and some residents have banded together to protect the few possessions they have left." f:IMG_1="http://d.yimg.com/a/p/ap/20100118/capt.cb4c93423c284ca985dd02fd38d283e4.haiti_earthquake_xgb107.jpg?x=130&y=82&q=85&sig=gRxfiZPe6KlqoVNPtadFzQ--" flab:DATE1="Publication Date" f:CREDT="(AP)" f:TIME1="13:03:59" f:DATE1="mardi 19 janvier 2010"/>
<ROW f:DATE2="" f:TIME2="" f:IMG_2="" f:IMG_3="" f:VID_1="" f:FLD_A="" f:FLD_B="" f:FLD_C="" f:FLD_D="" f:FLD_E="" f:FLD_F="" f:FLD_G="" f:FLD_H="" f:FLD_I="" f:FLD_J="" f:FLD_K="" f:FLD_L="" f:FLD_M="" f:FLD_N="" f:FLD_O="" f:FLD_P="" f:FLD_Q="" f:FLD_R="" f:FLD_S="" f:FLD_T="" f:FLD_U="" f:FLD_V="" f:FLD_W="" f:FLD_X="" f:FLD_Y="" f:FLD_Z="" f:CNAME="YahooNewsTopStories" f:CTITL="Yahoo! News: Top Stories" f:ID="ap/20100119/us_marriage_economics" f:HEADT="Report: More men get economic boost from marriage (AP)" f:BODYT="AP - Historically, marriage was the surest route to financial security for women. Nowadays it's men who are increasingly getting the biggest economic boost from tying the knot, according to a new analysis of census data." f:IMG_1="" flab:DATE1="Publication Date" f:CREDT="" f:TIME1="13:03:59" f:DATE1="mardi 19 janvier 2010"/> etc...LOTS MORE ROWS.
With this xml block in memory, we load as follows:
FClientDataSet := TClientDataSet.Create(nil);
TransformedXSLTStream := TStringStream.Create(xmlDataSet); (from above)
ClientDataSet.LoadFromStream(TransformedXSLTStream);
TransformedXSLTStream.Free;
ClientDataSet.First;
Now if I set width above to 1000, then I get an Access violation (read addresss xxx etc) on the LoadStream.
My guess would be that it is memory related or a hard coded limit. If you trace the component you should be able to find the exception rather easily. I would start with loadstream. Also you might try it with test data that you know is clean. I have had situations while parsing XML and other similar formats where the data had "invalid" characters which would cause the application to crash. Ansi/unicode did it for me too in of all things a simple text file.

Resources