It is about using the join function to save a multi-valued parameter and then restore the same parameters from the database later.
I just finished the report with the requirements that the parameters should be saved, and when the report is opened again (the report is transmitted by the OrderID parameter), the values previously selected by the user must be selected again.
The report used half of ten parameters, each of which had its own data set and as a result of the drop-down list. The parameters depended on the previous parameters in order to narrow the final selection, and when the report was “viewed”, a stored procedure was called to fill out.
The stored procedure received each of the parameters passed to it from the report. He checked the storage table in the database to see if any parameters were stored for this OrderID. If not, then he saved all the parameters. If so, it updates all the parameters for this order (this is the case when the user changes his mind later).
When the report is run, there is a dsParameters dataset that displays the SQL text and selects one row for this order identifier, if any. Each of the parameters in the report receives its default value from this data set and its selection list from the data set dedicated to this parameter.
I am having a problem with the multi-select parameter. I used the join command (@Value, ",") in the parameter list of the main dataset, passing a comma-separated string to the stored procedure. But how to restore it? You cannot pass a comma-delimited string back to the parameter's default value field.
I had to create another dataset to separate a parameter similar to what you are talking about. It looks like this:
IF OBJECT_ID('tempdb..#Parse','U') IS NOT NULL DROP TABLE
Each time a form is opened, this dataset checks the database for the stored row for this multi-valued parameter. If it is not, it returns null. If it is turned on, it parses the commas and creates a string for each of the values.
Then, this dataset and fldDesc are set to the default value field. It is working! When I select one or more, they save and replenish when the form opens again.
Hope this helps. I searched for a while and did not find any mention of storing the union string in the database, and then parsed it in the data set.