handcri Posted November 16, 2023 Share Posted November 16, 2023 JasperReportsで2つの列の掛け算結果を表示するには、以下のステップを実行します。 場所を決める: 最初に、掛け算結果を表示したい位置を決定します。例えばDetailセクションやColumn Footerセクションなどが選択できます。 テキストフィールドを追加: その位置に新しいテキストフィールドを追加します。これは、JasperReportsのデザインビューでドラッグ&ドロップで行うことができます。 Expressionを書く: テキストフィールドをダブルクリックしてExpression Editorを開きます。ここに2つのフィールドを掛け合わせる式を書きます。例えば、フィールドがpriceとquantityであれば、式は ($F{price}).doubleValue() * ($F{quantity}).doubleValue() となります。 これで、2つの列(この例ではpriceとquantity)の掛け算結果が表示されるようになります。ただし、priceとquantityがnullの場合にはNullPointerExceptionが発生するため、nullチェックを行うなど、実際のデータを考慮した実装が必要になるでしょう。 Link to comment Share on other sites More sharing options...
Mehak Rajkumar Posted November 20, 2023 Share Posted November 20, 2023 Thank you for posting to the Jaspersoft Community. Our team of experts has read your question and we are working to get you an answer as quickly as we can. If you have a Jaspersoft Professional Subscription plan, please visit https://support.tibco.com/s/ for direct access to our technical support teams offering guaranteed response times. Link to comment Share on other sites More sharing options...
taille60 Posted November 23, 2023 Share Posted November 23, 2023 (edited) Hello Hancri, Thank you for your contribution here. If my translator works well, I don't see a question here, if you indeed intended to create a knowledge-based article, you would need to create it under the knowledge-based section. Thank you, Raphaël Edited November 23, 2023 by taille60 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now