Prompting From Btxml 追蹤

Legacy Poster


I would like to use BTXML with .NET SDK or with the Commander, but I have problems when the format contains prompted fields. In these cases the prompt dialog does not shows up and prompted fields will contain empty value. If I check the responseXML, the corresponding Object fields are empty (the not prompted field values, like namedsubstrings that I change from XML are OK).

I suppose the btw file is OK, because when printing from Bartender App the prompt dialog appears.

In the XML I set "<EnablePrompting>true</EnablePrompting>" in <PrintSetup> tag as well, but it has not helped.

Interesting is that, when I run bartender from command line with the same XML: " bartend.exe /P /XMLScript="test.xml" /X " the prompt dialog shows up, but the children of <QueryPrompt> tag (DefaultReply, UserPrompt) are ignored, the default reply and prompt appears.

I tried Commander with "Bartender" and "Bartender XML Script" command types, but has no diference, prompt dialog does not appear. In the .NET SDK I use:
"string XMLResponse = btEngine.XMLScript(@"D:\test.xml", XMLSourceType.ScriptFile);"

What am I missing?

Any help would be really appreciated!


3 意見

Gene Henson
評論操作 永久連結

Hello Tamas,

I will try to see if I can address all of these issues here.

First, the reason you are not seeing the prompt dialog come up from Commander or from your .NET application is likely because both are running non-interactively. That means that they run in a non-interactive desktop so pop-up dialogs and messages are not displayed to the current desktop. When running from the Command Line, the commands are still run in the interactive desktop, so you can see the prompts.

If you do want to display the prompt dialogs, you can get around this by following these steps:

Set Commander to run as an application instead of as a service because the service will usually not have access to the current user desktop. Then set the visible window properties to [b]Interactive Dialogs[/b].

[*]Open Commander
[*]Stop Detection
[*]Go to Administer > Service Setup
[*]Change Run As: from service to application.
[*]Go to Detection > BarTender Command Handler Setup
[*]Change the Visible Windows to [b]Interactive Dialogs[/b]

That will keep the main BarTender window hidden, but it will allow the pop-up dialogs. One thing to keep in mind is that, when set as an application, Commander will need to be open on the desktop anytime you want to print.

[b].NET SDK[/b]
This one can actually be a little trickier as it somewhat depends on how your application is developed. But, if I assume it’s a standard windows application, you will need to set the Visible Windows property of the Window class to Interactive Dialogs.

Like this:

[code]btEngine.Window.VisibleWindows = VisibleWindows.InteractiveDialogs[/code]
You can find more information on this in the BarTender Help under Automating BarTender.

Also, a quick note, the <QueryPrompt> tag actually does not apply to user prompts. The user prompts are used to data source individual label objects, as you know. But, the query prompts are used to select a range of records from your database.

Let me know if that helps you.

Legacy Poster
評論操作 永久連結

Thanks for the quick response Gene!

I'll try these methods as soon as I get back to my development environment and will post the results. Actually, I have a WPF application, but the commander version will surely work.
Legacy Poster
評論操作 永久連結


Thank you very much, both method you mentioned are working. I was confused with the query and user prompts, I read more on them, and it is more clear now. (I am a newbie on this Bartender topic, only use it for 3 days, but I already see that it's a great, professional stuff.)

Thank you again!