0

I need to call a stored procedure during my report to insert values into a table. These values are the result of fields from the dataset added. For example, I have a row of values, and the far right column is "ReportItems!TextBox1.Value + ReportItems!TextBox2.Value ..." This gives the correct total on the report. Now I need to call a procedure using this value as a parameter.

Using a stored procedure as a dataset, I am unable to reference the ReportItems! I am also unable to create additional report parameters (even internal or hidden) which could be a result of a dataset due to the reporting infrastructure we are using.

I know using custom report code, I can call a stored procedure and also reference the ReportItems, but I have been unable to find the correct syntax. I am not familiar with VB.net so please be specific. If i could get an example of how to call: Procedure TEST_INSERT(ReportItems!TextBox1.Value), I would be able to figure out how to implement it.

I am using an oracle backend as my data source. Thanks

4

2 回答 2

2

If I've understood you correctly, you want to do an database update using a value calculated with an expression in your report. My answer to this would be threefold.

First up: don't do it!.

Second: seriously, don't do it!! Reporting services is not meant or well suited for this kind of task, you most likely are looking at an XY-Problem.

Third, if you insist on doing it anyways, the easiest way I can think of to accomplish that is by using a seperate report to trigger the update, and pass the value you're after into a parameter for that report. In the main report, you set a click action on the cell with the total that calls the report, with the same value into the parameter.

A similar setup which may work as well, is to create a parameter based on the first dataset with that same "sum" expression you mention, and pass that down to another dataset.

However: don't do it! ;-)

于 2013-01-29T20:33:31.050 回答
0

I would set up a dataset in the report service that calls an update or insert function in oracle and returns a value/s. This way you can send in the total you need calculate and produce a result telling the user if the update was successful.

There is no special method for doing this just select or enter your procedure name and refresh the fields to update the parameter/s. See Oracle stored procedure in SSRS.

Also using this method you can run the stored procedure in oracle, update the table and display the results.

于 2013-01-31T09:22:32.463 回答