JasperReports dynamic input controls - input

I'm currently trying to create a JasperReport report with some special input control behaviour. My needs are:
four input controls, two of them are dateboxes, the other ones are radio buttons
depending on radio button choice, one of the databoxes should be visible or not
so if option 1 is chosen, show both dateboxes; if option 2 is chosen, show only one datebox
I wonder if there's a "clean" solution - didn't find anything.
Any pointers will be helpful.

The Print when expression is not relevant for input controls on JasperReports Server.
There is no built-in support for hiding and showing an input control based on the value of a different one. The infrastructure for cascading input controls can certainly be extended to achieve this... but it would not be trivial.
The path I would take is to customize the .jsp page that displays the input control. There is a section in the JasperReports Server Ultimate Guide called "Customizing the Input Controls Form" which would get you started down this path.

For datebox part, you can use print when expression to decide whether certain blocks of the report is visible.
For other "input", if you meant some data you want to display inside the report, you can make some Parameter in your report, then set the Parameter from user input before you export the report.

Related

Radio buttons used in a rad grid in batch edit mode

I am trying to find any information about using a radio button in a rad grid in batch edit mode. I have created a template column, then added the radio button control, but it doesn't work in batch edit mode (nothing saves back to the DB). Is it even possible? I can't find anything on the Telerik site so I am suspecting its not supported. Thanks.
The Radio list is not supported in the batch editing mode. Such integration simply has not been implemented. The closest available option at this time is using a dropdown list: http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/batch-editing/defaultcs.aspx. Generally speaking, the standard way of editing boolean fields is through a checkbox column and not a radio button list - check the Discontinued checkboxes column.
What the grid does is that it loops through the controls with JS code when cells are opened and closed and determines control types and the proper API to use (e.g., $get().control.get_value() for dropdownlists, or $get().value for standard inputs). You can try implementing similar logic in the batch editing events.
You can try to use a RadRadioButtonList with the two items declared in its markup and its client-side API (see the get_selectedIndex() and set_selectedIndex() method: https://docs.telerik.com/devtools/aspnet-ajax/controls/radiobuttonlist/client-side-programming/radiobuttonlist-object) together with the following approach of working with templates: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/working-with-templates.
The idea is to have the radio button list in the edit template of the column and to select the correct item in it according to the newly opened cell value on the client, then fetch the selected item from the button list and put it in the grid data source.
You can find one example that you can try using as base in the following thread: https://www.telerik.com/forums/radiobuttonlist-in-gridtemplatecolumn.
Showing a radio button list in the item template is also something that is not supported, as the editing would basically happen in the "display" mode of the cell, and not in the edit mode of the cell. You could try using the server ItemDataBound event and FindControl() (see here: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#accessing-controls-in-template-column) may let you set initial values based on the data source for the radio button lists without data binding them. Then, perhaps a hidden field or hidden checkbox can be used for the actual data binding (see the template article above). You could also try using the batch editing manager changeCellValue() method on the client-side events of the radio button list, in a fashion similar to this article: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes.
Another approach you can consider is to use the client-side events of the radio button list and immediately upon change to call a service that will update the database. This may simplify the template handling logic (you could do this in a read-only column) but it goes against the purpose of batch editing to invoke one request with a lot of data, and you would also need to secure the service.
Another online resource to check is
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-editing/edit-mode/batch-editing/how-to/editing-checkboxes

How to enable datasheet’s filter triangle button in continuous form

Is it possible to use the built in triangle button to filter records for datasheet form in continuous forms?
If not. Then do you think if it is possible to code such a feature?
Also, is it possible to add a select all button within the datasheet form itself instead of placing it in a form containing the datasheet as a subform?
I’m afraid I have no choice but to use continuous forms because of how limiting datasheet forms are.
No, this is not an available feature. Also, no workarounds are available.
You can add an image with the filter icon and try to determine if the column is filtered, but that's both very difficult and not very useful (since you can't get the dialog to adjust the filter when you click on it).
If you want the filter dialog, however, you can just right click one of the fields to add a filter or adjust an existing filter.

Submitting an Infopath form section by section while making previous section uneditable

I have a InfoPath 2013 form in three sections. When one section is submitted I need the previous one to be become read-only/un-editable. I thought the approach might be to use Views as detailed here but I need to be able to submit the sections to a list as well as toggle.
I also though that Conditional Formatting might be the approach but when I righ click on the sectors I don't get the option. Any ideas?
Sections options
You can make section's elements disable.
For example, create checkbox chkOne. If Section2 was submitted, change chkOne's value to true. And add Formatting rule for all Section1's controls "If chkOne is true - disable".

How to create non-exclusive checkboxes with the same name in an Acrobat/PDF form

In Acrobat Professional, I create multiple checkboxes and assign the same name to each checkbox, but a different export value. With this, the checkboxes seem to behave like radio buttons: Acrobat only lets me check one of them. If the first is checked, and I click on the second one, Acrobat unchecks the first one.
If I assign different names to the checkboxes, then they do behave independently. However it would make things easier for my code that fills out the form if the name could be the same. Is it possible to create non-exclusive checkboxes (i.e. real checkboxes) that have the same name in Acrobat?
(For reference, this is the PDF I created: 20110503-exclusive-checkboxes.pdf)
Judging from the PDF Reference, it's impossible to create independent checkboxes with the same name.
In fact, a PDF Viewer should use the name to detect which checkboxes will form a check box field.
See Adobe's PDF Reference, 8.6.3 Field Types, Check Boxes (page 648) for more information.
Use the same name and export value for all your checkboxes and they will checked/unchecked together. Adobe Acrobat supports this, it is also permitted by PDF specification.
Can't be done.
That is the very definition of how you define radio groups in a PDF.
You can have different check boxes "foo.MyCheck", "bar.MyCheck", and so forth, and all are different fields. Different parent fields can have children with the same local name but different fully qualified names. Not a problem.
What is it that you're trying to do, anyway?
Adobe Acrobat versions 8,9 and X allow you to create non-exclusive checkboxes. Although, this allows you to create non-exclusive checkboxes, Orbeon does not recognize these fields.
Once you create the initial checkbox,
Right click the check box and select "Place Multiple Fields..."
http://i.stack.imgur.com/ASj3Q.png
In the Create Multiple Dialog box modify the number of fields needed (down/accross)
http://i.stack.imgur.com/gYOoU.png
Then select the other checkbox properties to modify the Export Values

ReportViewer: two text colors, one cell

Is it possible to have 2 areas of text in one cell such that each can have a different color? You can do this in crystal reports but I cannot see a way to do this in ReportViewer. What it is doing is essentially highlighting an important text fragment if it appears in a cell description to draw the users attention. I am fairly new to reportviewer so it for now I am assuming it's my lack of knowledge that is making this difficult. I am using VS2010.
Thanks.
Turns out VicarlnATutu wasn't quite right.
You can do this, but only if you are using VS2010 (which I am) because it includes the new SSRS rendering engine for SQL-Server 2008. This allows you to put some basic HTML into a field and have multiple formats in one cell. For more info see below:
http://msdn.microsoft.com/en-us/library/cc645967.aspx
http://msdn.microsoft.com/en-us/library/cc627491.aspx
One thing that tripped me up is what they call a 'placeholder' in the MS documentation is the little bit of text inside the textbox control that shows up by default. You can select two different things on the control in VS2010. One is the textbox itself. Right clicking on the textbox gives you 'text box properties'. The other thing you can select is the default text INSIDE the textbox. Right clicking on this 'placeholder' text gives you a different context menu where you can select 'placeholder properties'. This is where you can change the cell to accept HTML.
No, unfortunately not. I don't know if there are custom controls out there for ReportViewer, but the built-in TextBox only supports setting color (be it Foreground or Background) for the entire thing.
ah, good to know. kind of a unintuitive way to tell a TextBox to display HTML, but nice to know that you can!