This is a migrated thread and some comments may be shown as answers.

user interaction before generating the report

10 Answers 96 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Wassim
Top achievements
Rank 1
Veteran
Iron
Wassim asked on 22 Feb 2021, 03:34 PM

Hello,

I would like to create a report where the user has two checkboxes and has the choice to either show or not display a crosstab and/or graph when generating the report.
I am working with Telerik Report Designer with Telerik Reporting REST service and using HTML5 MVC Report Viewer as a report viewer.

 

the management of this need is done when defining the report or I have to add js events handler in my viewer ?

 

Thanks !

10 Answers, 1 is accepted

Sort by
0
Wassim
Top achievements
Rank 1
Veteran
Iron
answered on 25 Feb 2021, 08:32 AM

Does any one have an example please to how can i choose to display or not a graph or crosstab or together before generating report ?

It would be much appreciated if you can help me on this.

Thanks !

0
Accepted
Dimitar
Telerik team
answered on 25 Feb 2021, 01:12 PM

Hello Wassim,

Such functionality can be achieved both through the report definition itself and passing values through the report viewer. Both approaches will however require the use of a Report Parameter. You can have a look at our How to Add Report Parameters and Using Report Parameters in Expressions articles.

The first approach is the following:

1. Create a report parameter of type Boolean and set its Visible property to True. This way the report will be visible through the parameters area and its value will be available to be switched interactively.

2. Choose the report item you wish to apply this functionality to, for example, the graph item and create the following binding:

  • Property Path:  Visible
  • Expression:  =Parameters.[ParameterName].Value

This way whether the item will be visible or not will depend on the report parameter. I have attached a sample report that demonstrates this functionality.

The second approach will utilize the report viewer's properties:

1. First in the report like the first approach create a report parameter of type BooleanThis time we will not be making the parameter visible.

2. Follow step 2 from the first approach.

3. Follow our How to Pass Values to Report Parameters article to learn how to pass the values to the report parameters from the report viewer.

You might be wondering why I am suggesting the second approach since it takes 1 more step to achieve the same result as the first, however, that is not completely true. The report parameter looks more like a radio button which may or may not be a problem for you but if it is completely necessary to use checkboxes for this, then the second approach might be a better option for you.

I hope that I have managed to help you, please let me know if you have any other questions.

Regards,
Dimitar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Wassim
Top achievements
Rank 1
Veteran
Iron
answered on 03 Mar 2021, 05:13 PM

Thank you Dimitar for your reply !

I have another need:
in my report, I need to add a checkbox to choose whether or not we want to display null amounts in my report.
the fact of adding in my parameters list a parameter of boolean type but afterwards I do not know how to do to link that if the column amount in my sql table is equal to zero
if is equal to zero, they should not be displayed in the text boxes which are well located in groups that I have created.
if not, they must be displayed and this is the case by default.

 

any suggestions please.

Thank you in advance

0
Neli
Telerik team
answered on 08 Mar 2021, 09:34 AM

Hello Wassim,

There are two options that I can suggest:

1) You can set Binding to the item that should be visible based on the report parameter's value and if its value is zero. For example:

Property path: Visible

Expression: = (Parameters.showNull.Value = False And Fields.Values = 0)  ? False : True

2) The same outcome can be achieved by defining ConditionalFormatting to the item:

Click on Style -> unmark Visible.

Please, check the attached report that demonstrates both approaches.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Wassim
Top achievements
Rank 1
Veteran
Iron
answered on 08 Mar 2021, 12:59 PM

Hello Neli,

Thank you for your replying.

following the first approach, it generates an error Alert: "Index must be within list limits
Parameter name: index" I think because i attached another "Visible" binding in the same item(crosstab wizard)

I tried the 2nd approach, by applying conditionalformatting on my crosstab wizard item but it still always displays the values which are different to zero and equal to zero.

 

0
Neli
Telerik team
answered on 08 Mar 2021, 01:16 PM

Hello Wassim,

I am sorry to hear that you are experiencing issues during the requirement's implementation. To be able to investigate what's causing the problem, could you please send us the report with some sample data (for example in CSV or JSON format)? 

I will be looking forward to receiving an update from you.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Wassim
Top achievements
Rank 1
Veteran
Iron
answered on 08 Mar 2021, 02:02 PM

I can not attach the file in the replying .. I am sharing it with you online via Dropbox.

https://www.dropbox.com/s/3iebujj6qj2uy8z/Report_graph_crosstab.zip?dl=0

Regards,

Wassim

0
Wassim
Top achievements
Rank 1
Veteran
Iron
answered on 10 Mar 2021, 06:49 PM

https://www.dropbox.com/s/3iebujj6qj2uy8z/Report_graph_crosstab.zip?dl=0

 

Please advise me any way to address this requirement.
Thank you in advance

0
Accepted
Neli
Telerik team
answered on 11 Mar 2021, 09:27 AM

Hello Wassim,

Thank you for the provided report. It helped me a lot to find an approach that I hope that it will satisfy your needs. You can test to remove the conditional formatting and set the following Filter to the crosstab:

I also attached the updated report. Please, test the approach and let me know if you need further assistance.

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Wassim
Top achievements
Rank 1
Veteran
Iron
answered on 11 Mar 2021, 10:31 AM

Neli,

Thank you so much for responding.

This is what I am looking for.

Regards,

Wassim

Tags
Report Designer (standalone)
Asked by
Wassim
Top achievements
Rank 1
Veteran
Iron
Answers by
Wassim
Top achievements
Rank 1
Veteran
Iron
Dimitar
Telerik team
Neli
Telerik team
Share this question
or