ExecutePrintDef in 7.8 showing a parameter pop-up if parameter input order is defined in layout
We have some layouts from a 5.x customer, being migrated to HANA and 7.81, that get programmatically launched with a list of parameters passed to them like so:
LayoutHelper.LayoutOpener.ExecutePrintDef("U0000068", LayoutHelper.LayoutOpener.OpenLayoutModes.Preview, ItemCode, itemCode, SubCatNum, bpItemCode, ItemQty, qty, TraceCode, traceNum, ExpDate, expDate);
The problem is that when you launch the layout this way, a popup appears displaying the parameters and giving you an opportunity to edit them, before the layout launches. To the customer this is an new annoyance they want to eliminate because they've already filled in the parameters through a data grid.
Support instructed us to remove the "Input Order" defined for these parameters (it's exactly the order shown in code; 1,2,3,4,5) from the layout, but once you do that, the code doesn't work at all, generating this error:
This is largely a user-annoyance issue so I don't want to invest too heavily in business consulting services, but I did look at the API documentation and it seems like we're passing everything fine. Just to ensure we're passing a parameter array matching the API documentation, I tried defining a "myparams[]" array like so, which also doesn't work, unless we put the input order values back into the layout, which leads to the same user annoyance of getting an extra popup.
string[] myparams = new string[] { "ItemCode", itemCode, "SubCatNum", bpItemCode, "ItemQty", qty, "TraceCode",traceNum, "ExpDate", expDate};
LayoutHelper.LayoutOpener.ExecutePrintDef("U0000068", LayoutHelper.LayoutOpener.OpenLayoutModes.Preview, myparams);
This is what the popup looks like -- any ideas on how to programmatically suppress this?
-
Hi Andrew,
have you tried to use it with fix parameters?
In my opinion the fields must stand in "" like
"ItemCode", "1234", "SubCatNum", "987"
regards Lothar
0 -
No luck with that, you're right that the param names were originally surrounded by quotes and I must've dropped those out while doing some trial and error, but I put the quotes back in around the parameter names and I have the same issue (input string error message, or the parameter box pops up when I have an input order defined in the layout).
I'm wondering what a creative workaround to the issue might be, possibly storing the parameters in a UDT and just pulling in from there as long as multiple users aren't running the layout at a time, but we're conserving hours on the project and trying to just get migrated at this point.
Definitely if I don't have the parameters ordered in the layout, I can't launch it at all with ExecutePrintDef, and I've verified the order of parameters matches what's in Crystal, so it's a bit of a head-scratcher.
0
Please sign in to leave a comment.
Comments
2 comments