desperately trying to get parameters into reports

Stimulsoft Dashboards.WEB discussion
Post Reply
TestBoy
Posts: 36
Joined: Tue Oct 23, 2018 8:14 pm

desperately trying to get parameters into reports

Post by TestBoy » Wed Aug 21, 2019 4:35 am

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.
Lech Kulikowski
Posts: 1863
Joined: Tue Mar 20, 2018 5:34 am

Re: desperately trying to get parameters into reports

Post by Lech Kulikowski » Thu Aug 22, 2019 9:29 pm

Hello,

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

Thank you.
TestBoy
Posts: 36
Joined: Tue Oct 23, 2018 8:14 pm

Re: desperately trying to get parameters into reports

Post by TestBoy » Thu Sep 05, 2019 4:17 pm

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?
Attachments
WebApplication1.zip
(1.72 MiB) Downloaded 8 times
Lech Kulikowski
Posts: 1863
Joined: Tue Mar 20, 2018 5:34 am

Re: desperately trying to get parameters into reports

Post by Lech Kulikowski » Mon Sep 09, 2019 11:04 pm

Hello,

We need some time yo investigate the issue.

Thank you.
Lech Kulikowski
Posts: 1863
Joined: Tue Mar 20, 2018 5:34 am

Re: desperately trying to get parameters into reports

Post by Lech Kulikowski » Tue Sep 10, 2019 8:20 am

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.
Attachments
photo_2019-09-10_10-18-49.jpg
photo_2019-09-10_10-18-49.jpg (48.49 KiB) Viewed 75 times
Post Reply