C# And Queryprompts Follow

0
Avatar
Legacy Poster

I'm upgrading a custom application from Windows XP to Windows 7, and it's functionality is almost fully replicated.  I am, however, experiencing trouble with the .btw files that have QueryPrompts. 

 

At first, they weren't prompting at all, and were just putting the default reply into that field.  However, once I set the Bartender.Application.VisibleWindows property to btInteractiveDialogs, I would get the prompt to come up at print time (which is identical tho the XP version).  However, the QueryPrompts collection is empty, regardless of which bartender format is being used, so this code no longer minimizes the code for the value to be entered:

BarTender.QueryPrompts prompts = btFmt.Databases.QueryPrompts;

if (prompts.Count > 0)
{
  savState = this.WindowState;
  this.WindowState = FormWindowState.Minimized;
}

btFmt.PrintOut(false, false); //The printing happens here


 

My dev machine does have multiple monitors, so I can confirm that the value entered is printed in the format, but the production machines have only one monitor, so they will need to have it minimized before the print occurs.

 

I have attached a sample document with such a prompt.

 

2 comments

0
Avatar
Shotaro Ito
Comment actions Permalink

The attached document doesn't have a query prompt (which can be defined in database connection setup), so your code works as expected.

Besides, the document has data entry form enabled.

When there's any control exists on data entry form AND Print dialog's Options > [Enable Data Entry] is enabled, The Entry form will be shown.

From code, you can check Format.EnablePrompting property.

However..  [Enable Data Entry] is default enabled in document even no data entry has been created,

so you need to manually disable that in the document, to identify data entry is enabled or not.

(there's no simple method to count how many controls exists in data entry form - or, is there?)

 

I would simply minimize for all documents.

0
Avatar
Legacy Poster
Comment actions Permalink

Thanks for your help - I've checked, and none of my formats have the EnablePrompting flag set to be disabled  It seems like I'll just need to minimize the window every time, unless there's a way to tell which formats have Data Entry Forms

Please sign in to leave a comment.