How to set number of columns per page in rml - odoo

Please, I need to know how to set the number of columns per page in RML which I used to create reports for my Openerp session.
I have tried this but it does not work at all.
so I need your help please who can help me know.
<condPageBreak height="5cm"/>
either this:
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
Thanks a lot in advance.

Related

How to loop for each record in One2Many field in form view to create dynamic elements?

I have a customized One2Many field that contains several records for this current data.
I am working on a form view.
I need to construct something like this: (I don't want a tree)
<for every record in one2many_field>
<button something...>
</for>
I only want the result as to create 1 button per record in the one2many_field and be able to get the data in some fields from the model of the one2many_field too.
Is there any way to achieve it? I have searched for some time but found nothing even remotely close to this requirement.
You won't be able to achieve that in a Form View. Views in Odoo are kind of strict but it's mostly to avoid bad stuff to happen.
Anyway, you could think about re-creating the full view by yourself using QWeb View (doc for v14 here)
If you want to keep your Form View, you'll have to use a tree inside the form.
Know that you can totally add buttons in Tree views like adding on a sale.order.line something like <button class="btn btn-primary" type="object" name="product_id_change" string="Force Product Id Change"/> (useless, just for the example)
Check example image here
And play with some attrs to change the visibility of fields...
Hope it helped :)

Getting sequence of associated Product - IBM

I want to get 'Rank' value from MASSOCCECE table, since past 2 days I have been searching a lot to get this value but failed I tried 'ProductDatBean', 'RelatedProductDataBean' but couldn't figure out how to get the value of 'rank'.
I have four products as cross-sell of a product and I want to sort them on the basis of 'rank'.
It would be a great help if anyone could tell me how to get this value besides using customized bean.
EDIT: For more clarity, adding my code
<wcbase:useBean id="g_mA" classname="com.ibm.commerce.catalog.beans.ProductDataBean" >
<c:set target="${g_mA}" property="productID" value="${catentry_ID}" />
</wcbase:useBean>
<c:set var="g_associatedProducts" value="${g_mA.productCrossSells}" scope="request"/>
<c:forEach var="associatedProducts" items="${g_associatedProducts}" varStatus="status">
${associatedProducts.rank}
</c:forEach>
Got the value, thanks everyone for responses.
I was doing the right thing (${associatedProducts.rank}) for getting this value but I was misguided a little , They were items that were associated and I was informed that they were Products, so getting blank while implementing this logic for Item. Used ItemBean now everything is working fine.

Reporting Services Error?

When running a report in preview I get the following error The definition of the report is invalid , the tablix 'Tablix11' contains an invalid TablixMember. The sort Expressions element is not allowed if Group is omitted.
I have never come across this error before and cant understand what is causing it.
The error can be replicated by creating a simple Tablix and looking at the underlying XML.
When you create a Tablix with a group, the underlying RDL XML will include something like this:
<TablixRowHierarchy>
<TablixMembers>
<TablixMember />
<TablixMember>
<Group Name="Group1">
<GroupExpressions>
<GroupExpression>=Fields!val.Value</GroupExpression>
</GroupExpressions>
</Group>
<SortExpressions>
<SortExpression>
<Value>=Fields!val.Value</Value>
</SortExpression>
</SortExpressions>
<TablixMembers>
<TablixMember>
<Group Name="Details3" />
</TablixMember>
</TablixMembers>
</TablixMember>
</TablixMembers>
</TablixRowHierarchy>
If you remove the entire Group element, this will give the same error you're seeing:
If you also remove the SortExpressions element this will allow the report to render without error.
However - it's impossible for me to say how your RDL file got in this state in the first place. Given that hacking XML to get things running is seldom a good idea, my recommendation would be to start the tablix from scratch instead of hacking things to a working state - you might just be introducing more problems.
But at least hopefully now you can see why the error might be occurring.
I found that the Tablix header had a textbox property containing interactive sort. This text box is in the header, and not part of the detail. When I deleted the field from the detail of the tablix, the interactive sort remained on the textbox in the header.
Changing it on the header by right clicking on the header textbox of the tablix, then selecting textbox properties, then selecting "interactive sorting", and then correcting the "sort by" value to the correct field name did the trick.

Determining Last page position in xsl-fo

Can we somehow determine the position of the last-page in XSL-FO?
If I want to place my footer only on the last page, then how it could be done? As Input data varies and is not static. So any number of pages can come depending on the data.
Hope, it's not too late. But anyway, for all interested people:
Create a page master
<fo:simple-page-master master-name="my-last-page">...</fo:simple-page-master>
and put your footer as a "region-after" into that master.
Add this to your repeatable-page-master-alternatives
<fo:conditional-page-master-reference page-position="last" master-reference="my-last-page"/>
This is how you could define the last page. I don`t know your structure but you can add this in a block and reference with your footer.
<fo:block id="LASTPAGE"></fo:block>

Seam PDF - Aligning "p:data" keys to the left

I have the following code to generate a pdf from data:
<p:barchart is3D="true" legend="false" orientation="horizontal" width="520">
<p:series key="Gráfico">
<ui:repeat var="ocr" value="#{myBean.value}" >
<p:data key="#{ocr[0]}" value="#{ocr[1]}" />
</ui:repeat>
</p:series>
</p:barchart>
The problem is that the key from p:data gets aligned to the right (for some odd reason). I tried placing the code between divs with text-align, but it didn't worked.
I want the alignment to be on the left.
If someone has an answer, or at least an idea for me to try, I'd really appreciate.
Thanks in advance.
Is the value you're assigning an int or other numeric value? Trying casting it to a String instead.