adding two values from two textboxes

Stimulsoft Reports.NET discussion
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: adding two values from two textboxes

Post by ddsmith99301 »

How do I write this so it will work with c# script? It was written with vb as the scripting engine. When I try to use the & operator in place of the AND it fails. How can I write it so c# will understand it?

SumIf(DataBand1,QueryResults.Invoice_Transaction_Gross_Amount,QueryResults.Invoice_Transaction_Charge_Code_Description="Property & Casualty Premium"
AND QueryResults.Invoice_Production_Reporting_Date>=VI2
AND QueryResults.Invoice_Production_Reporting_Date<=VI3
)
2022-12-29_10-22-29.png
2022-12-29_10-22-29.png (37.39 KiB) Viewed 846 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: adding two values from two textboxes

Post by Lech Kulikowski »

Hello,

Please check what language you are using - VB or CSharp, and use correct operators.

Thank you.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: adding two values from two textboxes

Post by ddsmith99301 »

Thanks for your answers. I finally figured that out on my own.
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: adding two values from two textboxes

Post by Lech Kulikowski »

Hello,

You are welcome.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: adding two values from two textboxes

Post by ddsmith99301 »

I tried to mimic what you showed in your sample report, but now I am getting the following. What could possibly cause this?

I am using data from SQL Server. You are using xml. Could this be the problem?

2022-12-28_21-23-27.png
2022-12-28_21-23-27.png (129.62 KiB) Viewed 814 times

On the first page the VB2 variable in the textbox doesn't present the value returned from the expression. It just shows the value 0

2022-12-30_11-21-47.png
2022-12-30_11-21-47.png (8.68 KiB) Viewed 814 times

On the second page the returned value of the expression on the first page shows instead of what should be the returned value from the expression on the second


page.
2022-12-30_11-20-21.png
2022-12-30_11-20-21.png (8.77 KiB) Viewed 814 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: adding two values from two textboxes

Post by Lech Kulikowski »

Hello,

Please send your report for analysis.

Thank you.
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: adding two values from two textboxes

Post by ddsmith99301 »

Here you go. Thank you!
Attachments
Compensation Report 1.mrt
(20.56 KiB) Downloaded 67 times
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: adding two values from two textboxes

Post by Lech Kulikowski »

Hello,

Please check that this component is higher in the Report tree.

Thank you.
Attachments
Screenshot 2023-01-03 090639.png
Screenshot 2023-01-03 090639.png (52.48 KiB) Viewed 784 times
ddsmith99301
Posts: 52
Joined: Wed May 17, 2017 10:14 pm

Re: adding two values from two textboxes

Post by ddsmith99301 »

It doesn't work no matter what order the components are in.

2023-01-03_14-22-22.png
2023-01-03_14-22-22.png (48.92 KiB) Viewed 776 times
2023-01-03_14-26-46.png
2023-01-03_14-26-46.png (8.34 KiB) Viewed 776 times
2023-01-03_14-31-33.png
2023-01-03_14-31-33.png (48.31 KiB) Viewed 776 times
2023-01-03_14-38-34.png
2023-01-03_14-38-34.png (18.65 KiB) Viewed 776 times
Post Reply