@JKage what I meant to say is that my report has Options. I can see that they are stored in the Option01 - 04 fields in the report params. I see this when doing a trace on the report run, but when I try to add those in there my report does not run as expected. It is not filtering on those options.
You could replace .FieldValue with some of the field names that i listed in the earlier posting. Such as “Character01”, etc. Just set that field to the data you want to use. IE: rptDs.BAQRptOptionFld[0].Character01 = “MyParameter” or you could set up a variable in the code and set the field value to it so it’s dynamically set.
It would help in the sense of calling a custom SSRS report but for calling two at the same time and referencing that in a autoprint job per a save action or print upon material queue is the tricky part.
Why does this have the ! in front?
Wouldn’t this say "If agentID has something, then change to “SystemTaskAgent”?
If you are doing that, then why bother pulling AgentID?
I do have an issue of where I need to pass the report some type of filtering parameters.
I am running this from a dashboard and it prints everything the dashboard pulls up.
Is there a way to pass a selected rows fields to the report as options?
string.IsNullOrEmpty returns a true of false boolean. the “!” inverses the value of the boolean, so that statement reads as “If that string is not null”.
Yes you’re crazy
It’s saying that if the agent ID isn’t null, meaning it has no value, then we want to hard code in “SystemTaskAgent”. It’s just a way to check the agentID variable before passing it, since he is receiving it from the GetDefaultTaskAgentID method, rather than assuming that the method returned a value.
I put a MessageBox before it to show the AgentID mine pulled. It was ‘TaskAgent’.
I also had a MesageBox after the line and it told me it was ‘SystemTaskAgent’.
Then it errored out with:
Why did it change it if it was not empty?
I know it was typed correctly because it was a straight copy from here.
So you are saying if agentID had something in it before this line of code, it should change it to be SystemTaskAgent?
Why should it do that?
I feel like we are having a circular argument here, lol.
Try that piece of code the way it is originally and put a MessageBox on either side of it to monitor the variable.
With the !(not) on IsEmptyOrNull, that tells me if IsEmptyOrNull is true (nothing there), then make it false (something there).
That means unless the TaskAgent was empty, it will change it. If it is empty, it will ignore it.
I feel like that is the reverse of the intention.
Please double check me and let me know if I am wrong.
I hate to keep on about it but no one has convinced me otherwise, especially since I am running it with the logic in front of my eyes and it is doing what I am saying.
When I do a trace I see that they are Option1 Option2 and Option 3 and when I set them the report takes FOREVER to run because it is not using the parameters in the query. That results in the report displaying info for a completely different Job / Order because I am using aggregates on the parameters. Not sure how to pass them.