How to convert one or more filters from "From/To" range style (two separate single-select fields) into the "multi-select" style (single field with a green "..." button)
How to convert one or more filters from "From/To" range style (two separate single-select fields) into the "multi-select" style (single field with a green "..." button)
الخطوة 1: قم بتحميل ملف الـ JRXML من تعريف التقرير ثم فتح محادثة جديدة مع Claude
الخطوة 2: ارفع ملف الـ JRXML اضغط على زر إرفاق الملفات وأرفع ملف .jrxml المطلوب تعديله.
الخطوة 3: انسخ البرومبت بالكامل والصقه
انسخ كل المحتوى من ملف "JRXML_MultiSelect_Prompt.md" (الموجود معك) والصقه في الرسالة، مع كتابة اسم الفلتر أو الفلاتر المطلوب تحويلها في السطر المخصص لها أول البرومبت، مثلاً:
الفلاتر المطلوب تحويلها: المخزن (Warehouse) و الصنف (Item)
ملحوظة: ممكن تطلب فلتر واحد، أو أكتر من فلتر في نفس الطلب، البرومبت يدعم الاتنين.
الخطوة 4: ابعت الرسالة وانتظر الملف الناتج Claude هيرجع لك ملف JRXML معدّل وجاهز للتحميل.
الخطوة 5: تأكد بالعين قبل الاستخدام افتح التقرير في الـ NamaERP وتأكد إن الفلتر ظهر بشكل زرار أخضر "..." بدل الحقلين القدام (من / إلى).
الخطوة 6: لو حصلت أي مشكلة
ارفع صورة الشاشة (Screenshot) للفلتر زي ما ظهر، وقول لـ Claude "لسه نفس المشكلة" أو وصف اللي شايفه، وهو هيراجع الملف ويصلحه.
SoftVision | NamaERP PRO Edition
Convert JRXML Filters "From/To" range style into the "multi-select style"
I have a JRXML report from SoftVision | NamaERP PRO Edition. I need you to convert one or more filters from the old "From/To" range style (two separate single-select fields) into the multi-select style (single field with a green "..." button), following the exact technical pattern below. This pattern is confirmed working and tested in production — follow it precisely, do not improvise alternative approaches.
[Tell me which filter(s) to convert, e.g.: "Warehouse" / "Item" / "Branch" / "Supplier" / "Employee" / "Sector", etc. You can list more than one.]
Replace the existing From/To pair (e.g. FWarehouse + TWarehouse, or fromWare + toWare, or any naming variant) with a single parameter:
<parameter name="EntityName_In" class="java.lang.String">
<property name="entityType" value="EntityType"/>
<property name="property" value="code"/>
<property name="arabic" value="Arabic label without من/الي prefix"/>
<property name="english" value="English label without From/To prefix"/>
<property name="list" value="true"/>
</parameter>
Critical rules — do not deviate:
class must be java.lang.String (NOT java.util.Collection — that breaks rendering)<property name="list" value="true"/> (NOT multiSelect, NOT anything else)property value must be code (NOT id)EntityName_In (e.g. Warehouse_In, Item_In, Branch_In, Supplier_In)If the old From/To parameters have companion "display" parameters (commonly named X_1 with a <property name="src" value="FWarehouse"/> style reference), delete those too — they no longer apply.
Replace every instance of the BETWEEN filter:
-- OLD (any of these variants):
$X{[BETWEEN],Warehouse.code,FWarehouse,TWarehouse}
$X{[BETWEEN] ,W.code,fromWare,toWare}
-- NEW:
$X{IN,Warehouse.code,Warehouse_In}
Important: Search the entire SQL query, not just the main WHERE clause. namaERP reports often have multiple CTEs/subqueries (opening balance calculations, cost calculations, etc.) that repeat the same filter — every single occurrence must be updated, or the filter will be partially ignored and produce wrong report totals.
Syntax rules:
$X{IN,...} — no square brackets around IN (unlike [BETWEEN]).code column, not .idIf the report's header section displays the selected filter value(s) as text (commonly two textField elements referencing the old From/To parameters), update them:
<!-- OLD -->
<textFieldExpression><![CDATA[$P{FWarehouse_1}]]></textFieldExpression>
<textFieldExpression><![CDATA[$P{TWarehouse_1}]]></textFieldExpression>
<!-- NEW -->
<textFieldExpression><![CDATA[($P{Warehouse_In} != null && !$P{Warehouse_In}.isEmpty()) ? $P{Warehouse_In}.toString().replaceAll("[\\[\\]]","") : ""]]></textFieldExpression>
<textFieldExpression><![CDATA[""]]></textFieldExpression>
Before returning the file, confirm:
_In parameter appears in: the parameter declaration, every SQL filter occurrence, and the header display expression (if applicable)$X{IN,...,EntityName_In} matches the number of places the old BETWEEN filter appearedclass="java.util.Collection" for the parametermultiSelect="true" as the trigger property — it is not recognized by namaERP.id in the SQL — use .code$X{[IN],...} with brackets — correct syntax is $X{IN,...} without bracketssrc propertyReturn the complete, updated JRXML file with all changes applied, ready to import into NamaERP PRO Edition.