Page 1 of 1

desperately trying to get parameters into reports

Posted: Wed Aug 21, 2019 4:35 am
by TestBoy
I don't know how to articulate this so bear with me.

I have a page with something as simple as a textbox.
I need to somehow get that value into my controller.. or somewhere?

I have these actions:

Code: Select all

Actions =
    {
        GetReport = "GetReport",
        ViewerEvent = "ViewerEvent",
        Interaction = "ViewerInteraction"
        
    }
None of these have any variables from my page. If I try to include a model .. well, my model is null when one of the above methods is fired.
So it does not pass the model back even tho the model was returned to the page and the forms are filled with data from that model.
It seems to me that the only way to make this work is to have a page where the user can enter their data and then post that to a second page?
There has to be a better solution than something hacky like that.
I can do that and it works but that's just crap.

All I have been able to do so far is get it to refresh:
jsNetCoreViewer.postAction('Refresh');

That's it.
How do I get new variables into the report on refresh?

I amn lost... this web stuff isn't my thing so I am really out of my element.

Re: desperately trying to get parameters into reports

Posted: Thu Aug 22, 2019 9:29 pm
by Lech Kulikowski
Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your task in more details?

Thank you.

Re: desperately trying to get parameters into reports

Posted: Thu Sep 05, 2019 4:17 pm
by TestBoy
Ok, I posted this in the wrong place but I will probably have the same issue with the dashboards to be fair.
Consider the following workspace (attached)

I just altered the index page and controller to add the report.
I also added a simple model.

On the index page there are two textboxes and a button.
Those values are tied to the test model.
When you push the button the values are posted to the controller, values are there... all is well.

But I need those values in GetReport. It fires next.
But of course, it does not pass the model in. I tried that. It's all null.
I need that model.

How do I get it?

Re: desperately trying to get parameters into reports

Posted: Mon Sep 09, 2019 11:04 pm
by Lech Kulikowski
Hello,

We need some time yo investigate the issue.

Thank you.

Re: desperately trying to get parameters into reports

Posted: Tue Sep 10, 2019 8:20 am
by Lech Kulikowski
Hello,

Please set the following option for the viewer:

Code: Select all

Server =
{
    PassFormValues = true
}
In the viewer action, you can get values from the form:

Code: Select all

public IActionResult GetReport()
{
    var formValues = StiNetCoreViewer.GetFormValues(this);

    StiReport report = new StiReport();
    report.Load(StiNetCoreHelper.MapPath(this, "~/Reports/Report.mrt"));
    report.Dictionary.Variables["Variable1"].Value = formValues["foo"];
    report.Dictionary.Variables["Variable2"].Value = formValues["bar"];
    return StiNetCoreViewer.GetReportResult(this, report);
}
Thank you.

Re: desperately trying to get parameters into reports

Posted: Mon Sep 21, 2020 7:36 pm
by Alejandro323
did you resolve that issue?

Re: desperately trying to get parameters into reports

Posted: Tue Sep 22, 2020 3:19 pm
by Lech Kulikowski
Hello,

Yes, was provided solution in the last reply.

Thank you.