Hi there, my company's software product has a feature that allows users to generate forms from Word templates. The program auto fills some fields from the SQL database and the user can fill in other data that they desire. So we have a .dotx template that holds the design of the form, and then the user gets the .docx file to fill out when they call it from our program. The problem we're having is that some of our users have been finding that the forms take an exceptionally long time to open up and then, once open, are so slow to respond (scroll around, etc) that they're unusable. So in my investigations so far, I've found out that the problem systems are one with lower powered CPUs (unfortunately it happens for systems above our system requirements) and the Word forms that cause the problems are ones with large amount of ActiveX style checkboxes on them. I verified that reducing the ActiveX checkboxes fixes the form loading problems. So I have the following questions about solutions (we're using Word 2007): 1) Is there any way to configure Word, or some other settings, so that there won't be such a strain opening a Word form with lots of ActiveX checkboxes? Any way of speeding up Word's opening? 2) Using Legacy style checkboxes instead of the ActiveX ones makes the forms load fine, but it looks like the user has to double-click the checkbox and change Default Value->Checked. Is there a way to configure it so that they can simply click on the checkbox to tick it? "Legacy Forms" checkbox as a name kind of worries me (Legacy…), does that mean a future version of word at some point wouldn't load the checkboxes because they're "legacy"? 3) Yes, it became clear to me after a little bit of research into solutions that Word is not the tool for the job for forms like I'm describing. InfoPath seems to be exactly what we should have been using all along but unfortunately I wasn't involved in the decision making or development of these forms, just tasked with coming up with a solution. I'd appreciate answers to any of these, or if anyone has any other ideas for solutions to this problem. Thanks
msx23
Posts
-
Could use some guidance on Word Checkboxes -
Printing documentsHi, I'm working on a part of a program where I have a list of file paths and I want to write a method to send each file to the printer. Files in the list would be stuff like .txt and .doc. I've collected each path in a List docPaths = new List(); and I need to do something like:
foreach (string file in docPaths)
{
//Send the file to the printer
}What would people suggest is the best way to go about this? Thanks for any help
-
BULK INSERT and collation problemI'm trying to use BULK INSERT to import a text file and then check its contents against a table in the database. I'm getting a problem when I compare the results however. I'm making a temp table to hold the text file's contents
CREATE TABLE #Temp(Code varchar(5), number varchar(2))
Then using BULK INSERT to get the contents in
BULK INSERT #Temp FROM 'PATH.txt' WITH (FIELDTERMINATOR = ',',ROWTERMINATOR = '\n')
And then checking if any matches occur
SELECT Code, (CASE WHEN
(SELECT Count(DBTable.Code) From DBTableWHERE DBTable.Code= #Temp.Code) > 0
THEN "Yes"
ELSE "No" END) AS FLAG
From #TempCCServsThe problem is that I get the following error message now: "Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation." Anyone have an idea what I'm doing wrong? Thanks for any help.
-
Handling a paste into a textbox.Hi all. I am trying to modify some code that clears other textboxes on a form when the user starts entry in a textbox. So I'm handling the KeyDown event of each textbox and clearing the others. But I don't want to clear the other boxes when a CTRL or ALT key is pressed (unless something is pasted into the textbox, which is my problem) so that the user can use shortcuts and such when focused on a textbox. The code I'm using is:
if (((Control.ModifierKeys & Keys.Alt) != Keys.Alt) && ((Control.ModifierKeys & Keys.Control) != Keys.Control)) { //Do event handling work here (clear other textboxes etc.) }
The problem is that it skips over the stuff it needs to do when a CTRL-V is invoked. How can I handle that while still keeping those CTRL and ALT checks in there. Thanks for any help. -
PrintPreviewDialog printer selection.Hi, I'm using the PrintPreviewDialog class to print a PrintDocument object. I'm wondering how to bring up a print options dialog after the print button on the preview screen is hit. Can't seem to find a way to "get in between" the PrintPreviewDialog's print button and the actual printing.
-
Concurrency violation on update command.Hi all, I'm having a problem with updating a row in the table when the value was originally NULL. Using c# and Visual Studio 2005 by the way. Through my front end I can modify existing values and commit those changes to the database just fine, but the problem arises when I try and change a field that was NULL to a non-NULL value. (Oh, I can also change a field that has a value to NULL just fine) When I get to my DbAdapter.Update(DATASET HERE); line I catch an exception with the following text: "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records." And the thing is, when I comment out (of the update stored procedure in SQL) the part of the WHERE clause that states
((@IsNull_FIELDNAME = 1 AND [FIELDNAME] IS NULL) OR ([FIELDNAME] = @Original_FIELDNAME))
where FIELDNAME is the one field that I'm trying to update, it works fine. I can't figure out why that WHERE clause is failing. I'm not updating the database anywhere else in the code other than the one spot that is failing out when I try and fill a previously NULL field. I've used VS2005's auto-generating wizard to create my stored procedures and command generators so there isn't any disagreement between the table/SP/c# that I can find. When I breakpoint at the DbAdapter.Update(DATASET HERE); line my dataset has the right values in it. Does anyone have any ideas? I'm pretty stuck here. Thanks -
Combo Box slected index changedHi, I'm playing around with a form and I want it to know if I've changed the contents of a combo box (selecting a new index that is, it doesn't take text extry) placed on it. So I just made a global bool variable 'ComboBoxChanged' initialized as FALSE, and I set it to TRUE upon handling the ComboBox.SelectedIndexChanged event. The problem I have is that the event is triggered when the form is loaded, thus setting my 'ComboBoxChanged' variable event though I haven't actually selected a new index. What do you guys think is the best solution to this? Thanks for any help.
-
Checking for database concurrency violationsHey, thanks for the reply. Yeah, the
Message
property only contains that one line response as well instead of the whole message. Anyone have any other ideas on how to check for concurrency violations? Thanks -
Checking for database concurrency violationsIn the app I'm writing I would like to be able to check if any concurrency violations have occurred on the database it's monitoring in the recent past. In SQL Server Management studio I can run the command DBCC CONCURRENCYVIOLATION which gives me the message back (where I forced concurrency violations):
Concurrency violations since 2007-10-10 10:47:47.383 1 2 3 4 5 6 7 8 9 10-100 >100 4727 2800 1118 0 0 0 0 0 0 0 0 Concurrency violations will be written to the SQL Server error log. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
So this is the info I need, the way that I'm trying to get it into my program is:conn.Open(); conn.InfoMessage += new SqlInfoMessageEventHandler(SqlMessageEventHandler); SqlCommand c = new SqlCommand("DBCC CONCURRENCYVIOLATION", conn); c.ExecuteNonQuery();
where conn is my SQL connection and SqlMessageEventHandler grabs the error message:public void SqlMessageEventHandler(object sender, SqlInfoMessageEventArgs e) { string CVTest = ""; foreach (SqlError err in e.Errors) { CVTest += err.Message; } }
The problem is that the "CVTest" sting I'm using to monitor the message only gives me backDBCC execution completed. If DBCC printed error messages, contact your system administrator.
rather than the whole message as in Server Management Studio. This occurs whether the DB I'm checking has violations logged or not. Does anyone know how I can get all the information that DBCC CONCURRENCYVIOLATION should return? Alternatively, if anyone knows a better way to programatically check for concurrency violations that have occurred on the database that would be great, since parsing that message to determine can't be the most efficient way. Thank you.