Using Table Values for User Variables

Stimulsoft Reports.NET discussion
ben.w
Posts: 18
Joined: Tue Jul 30, 2019 5:43 pm

Using Table Values for User Variables

Post by ben.w »

Hi!
We have a report that uses a table for various customer values that normally are not overridden at the report level, like labor values, etc. However, we would like to have the ability to override the default sales tax value because of non-profits (0%). I am able to do the following, but it isn't ideal:
- set a default value in the report (ignores our table) and the user can override the value as needed
- set the variable to pull a value from the table (it only pulls the top value) and the user can override the value
- not have a variable and the report uses what is set in the table

How can I get the 2nd option to work with filtering the table?

Please let me know if this makes sense. Thank you!
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using Table Values for User Variables

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
ben.w
Posts: 18
Joined: Tue Jul 30, 2019 5:43 pm

Re: Using Table Values for User Variables

Post by ben.w »

Hi Lech,
Attached are the files you requested.
- MicrovellumFactory.sdf contains a table called ActivityStations, which is used by the ActivityStations.mrt report.

Thank you!
Ben
Attachments
Desktop.zip
(179.41 KiB) Downloaded 126 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using Table Values for User Variables

Post by Lech Kulikowski »

Hello,

Ok. Could you explain your issue in more detail, which result do you need in your report?

Thank you.
ben.w
Posts: 18
Joined: Tue Jul 30, 2019 5:43 pm

Re: Using Table Values for User Variables

Post by ben.w »

Hi Lech,
I would like to set a variable in the report with the following criteria:
1) default value to be set to a value in a table (which isn't the first row in the table)
2) allow the variable to be overridden by the user
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using Table Values for User Variables

Post by Lech Kulikowski »

Hello,

Ok, where do you want to use that variable - in filtering, query, etc?
Could you explain your issue in more detail?

Thank you.
ben.w
Posts: 18
Joined: Tue Jul 30, 2019 5:43 pm

Re: Using Table Values for User Variables

Post by ben.w »

Hi Lech,
The use of the variable will be in text formulas, such as: Quote = {(MaterialCosts + Labor Costs) * (Markup + SalesTax)}

To explain this more fully:
We are designing 4 reports that will calculate the materials and labor needed for a project. There values are then multiplied by Sales Tax, Markup and Overhead percentages for the total cost that a customer would pay for the project. These 3 variables currently only exist in the report with an initial value set. We would like these values to be set by a value in a table (ActivityStations) so that report modifications can be minimized.

Basically, we are looking for the following:
1. ActivityStations table is populated with various values, including the 3 I just mentioned above
2. Reports display the appropriate value (i.e. Sales Tax), which the user of the report can override
3. The variable is then used in formulas to calculate the total cost

Our difficulty is in filtering the ActivityStations table to display the one value we need for the user to see and override. I can point the variable to the table, but I only get the first row of the table for values, which is incorrect.

Does that help?
Ben
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using Table Values for User Variables

Post by Lech Kulikowski »

Hello,

In your report, the SalesTax variable is static with 7.5 value and uses only on the TitleBand. Perhaps, you sent a report which does not show your issue.
If you need to use the value from data source in that variable, you should set the ReadOnly property. But in that case, the user won't be able to provide your own value.

Thank you.
ben.w
Posts: 18
Joined: Tue Jul 30, 2019 5:43 pm

Re: Using Table Values for User Variables

Post by ben.w »

Hi Lech,
I set the variable as we have it set today, with is to a static value. I am asking how I can tie it to a value in a table which can be overridden.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using Table Values for User Variables

Post by Lech Kulikowski »

Hello,

To set the value from data source as initializing value, you can set the expression as - datasourcename.columnname
and set the ReadOnly property.

Thank you.
Post Reply