KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How to pass multiple parameters and call the MS SQL stored procedure in koolreports #3028

Open Ravin Wijesinghe opened this topic on on Apr 6, 2023 - 1 comments

Ravin Wijesinghe commented on Apr 6, 2023

Dear Friends

I have implemented the code using MS SQL stored procedure in place of query. There are examples for MySQL but that does not work for MS SQL.Need to do same as done in #2540 but for MS SQL.

Thanks :)

Sebastian Morales commented on Apr 12, 2023

Pls try this code and let us know how it works:

    $this->src("sql_server")
    ->query("EXEC my_stored_procedure @param1 = :param1, @param2 = :param2")
    ->params(array(                
		':param1' => $param1,
		":param2" => $param2,
    ))  

If there's any error pls post the full error message and stack trace. Tks,

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

None