Looking for examples report that does the following

Stimulsoft Reports.NET discussion
Post Reply
CCS
Posts: 23
Joined: Mon Oct 09, 2023 5:06 am

Looking for examples report that does the following

Post by CCS »

Anyone knows of sample reports that shows how to do the following using the Designer:

- Reference a String Range in a Data band Filter expression (I found the use of xxx.FromDate and xxx.Todate but nothing on using String)
Example:
VariableA is a String Range
in Filter Expression I want to use DBNAME >= VariableA.FromValue && DBNAME <= VariableA.ToValue
The syntax is wrong I guess but I did not see any errors

- I want to have a report variable switching from one field to another based on user's choice of an earlier variable entry. I tried to add a Switch to determine the field to use but it did not seem to work
Example:
Variable 1 is asking for Select by ID or Name
Variable 2 is using Switch to check if result of (Variable 1 == "ID", DBID, Variable 1 == "Name". DBName)
Lech Kulikowski
Posts: 6433
Joined: Tue Mar 20, 2018 5:34 am

Re: Looking for examples report that does the following

Post by Lech Kulikowski »

Hello,

For string variable, you can use From/To properties. However, it is not possible to compare string values.

> Variable 2 is using Switch to check if result of (Variable 1 == "ID", DBID, Variable 1 == "Name". DBName)

You can use the Switch() function.

Thank you.
CCS
Posts: 23
Joined: Mon Oct 09, 2023 5:06 am

Re: Looking for examples report that does the following

Post by CCS »

Hi

Thanks for the response. Can I just clarify.

"For string variable, you can use From/To properties. However, it is not possible to compare string values."

Does it mean I cannot do this?

table.fieldname >= variableA.From && table.fieldname <= variableA.To

where I have set up variableA as String and is a Range.

The purpose is to retrieve any records that has a string value >= to the from selection and <= to the toselection.

Thanks
Lech Kulikowski
Posts: 6433
Joined: Tue Mar 20, 2018 5:34 am

Re: Looking for examples report that does the following

Post by Lech Kulikowski »

Hello,

What do you mean by comparing strings? In the .NET it is no possible.

Please check:
https://learn.microsoft.com/en-us/dotne ... re-strings

Thank you.
Attachments
Screenshot 2024-01-11 145014.png
Screenshot 2024-01-11 145014.png (16.21 KiB) Viewed 1115 times
CCS
Posts: 23
Joined: Mon Oct 09, 2023 5:06 am

Re: Looking for examples report that does the following

Post by CCS »

Yes I can see it does not allow that.

I am trying to migrate a Crystal Report that allow at runtime, user selection of FROM TO of a string field. If using that in Databand Filter is not allowed, is there a technique you can suggest to get the same kind of filtering?

I think I have reviewed most if not all the sample reports but none come close to my needs.

Cheers
Lech Kulikowski
Posts: 6433
Joined: Tue Mar 20, 2018 5:34 am

Re: Looking for examples report that does the following

Post by Lech Kulikowski »

Hello,

You can implement and add your own function to the dictionary.

Thank you.
Post Reply