Current filter:
                                You should refresh the page.
                                  • Hi,

                                    What I need to do should be very basic. I need to pass a string array, or a List of strings as a parameter to a Sub Report.

                                    Right now I have string array for example like {"firstString", "SecondString", "thirdString"}. I have a sub report that has a Parameter that is set as a string (because there is no way to set it as a string array) thats multivalue is set to true. After reading multiple support tickets, I have found that if you set the multivalue to true it really makes the parameter a string array.

                                    But everytime I try to print the report I am getting the error: "A Parameter Binding assigns a value of incompatible type to the subreport paramter "testParameter".

                                    I have tried all of the possible solutions but to no avail

                                     - Tried to pass the values as a List of strings.
                                     - Tried to pass the values as a string array.
                                     - built a string that would split the string array into a string split by commas Like so :

                                    testParamToPass = ""; Foreach(string test in array) { testParamToPass += test + ","; }

                                    Which to my surprise still didn't work.

                                    I am working on a time crunch, and I thought if you have the ability to set a filter string using the IsAnyOf tool (which would be an array of values) then you should be able to easily pass an array of values through the parameter binding.

                                    I look forward to your answer


                                • Andrey (DevExpress Support) 12.16.2019

                                  I tried to reproduce the issue by setting the value of the subreport multivalue parameter via the Parameter Bindings and via code, but without success. In the attachment, you will find a sample video showing my results. I have also attached a sample project. Please modify it to illustrate the issue.

                                • Eric Daniels 12.16.2019

                                  The values that are passed to the Sub Report are invisible or not set by the user. The values come from the Master Report and I think the issue is due to the value being a VARCHAR(Max) in the database. So I have to convert this somehow in the scripts 

                                • Eric Daniels 12.16.2019
                                  private void CheckStubsSubReport_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { XtraReport report = sender as XtraReport; string invoiceNumberString = report.Parameters["InvoiceNumber"].Value.ToString(); char[] trimChar = {'[', ']'}; invoiceNumberString = invoiceNumberString.Trim(trimChar); string[] bits = invoiceNumberString.Split(','); for(int i=0; i < bits.Length; i++) { bits[i] = "'" + bits[i] + "'"; } invoiceNumberString = string.Join(",", bits); string[] param = new string[]{invoiceNumberString}; report.Parameters["InvoiceNumberArray"].Value = param; }

                                  I have tried multiple things but this is the closest to working the value that should be returned should be working I am not sure why not

                                • Eric Daniels 12.16.2019

                                  Once again this is an urgent matter 

                                1 Solution

                                Creation Date Importance Sort by

                                Due to this being an urgent matter I will be changing my database tables.

                                I thought If i checked urgent on the ticket I would get an "Urgent" response but I must have been mistaken.

                                Also, I find it odd that the video created had the Sub Report parameters that are visible. If I am using a Sub Report I would never think there would be a need to show parameters due to the binding of the from the Main Report.

                                I constantly find myself asking questions on XtraReports and a number of ones in the Dashboards. The support for these two items I believe are sub par. If this was the case I would expect the documentation of these two items to be more in depth. Very disappointed with this response. 

                                • Andrey (DevExpress Support) 12.17.2019

                                  Hello Eric,
                                  I'm sorry for the misunderstanding.
                                  Usually it takes less than one business day for us to process incoming queries. Tickets marked 'Urgent' are placed in a separate priority queue, and we process them faster.

                                  The first part of the video illustrates how to use ParameterBindings to bind a multi-value parameter value of a subreport to a multi-value parameter value of the main report. For more information you can refer to the Embed the Subreport help topic. The second part of the video shows how to pass an array to a multi-value parameter in code. See the Multi-ValueParameters help topic for more information about this. The subreport has hidden parameters, and the main report has a visible parameter for demonstration purposes.

                                  I assume that the value that you are trying to pass to your subreport's parameter is a string: [Value1,Value2], correct? If so, to convert this value to a string array and pass this array to a multi-value report parameter, use the following code snippet:

                                  private void xrSubreport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { XRSubreport subreport = sender as XRSubreport; string inputValue = "[First,Fourth]"; char[] trimChar = { '[', ']' }; inputValue = inputValue.Trim(trimChar); string[] bits = inputValue.Split(','); subreport.ReportSource.Parameters["parameter1"].Value = bits; }

                                  I attached a sample project. If the value has a different format, please modify my sample project to demonstrate your real values.

                                  It would be great if you described your experience with our documentation in greater detail so that we could share it with our documentation team.
                                  I look forward to your reply.