Ms-Word Mail Merging format - ms-word

I'm using MS-Office 2016 to do a Mail Merging for a contract where the original Data is stored in an Excel file.
I have problem formating the Plate number as it should be in a format like
this ##-##### and that's how it's shown in Excel, However, when i do the merge it shows like
this #####-## and here is a photo to show exactly one entry.
I tried placing the merged field out of the table, tweaked with right to left, left to right and tried to generate a format based on what i saw on the internet about formatting Date and Currency, However, I got no positive results.
I would appreciate if you could help me formatting this field or direct me to reference in which i can learn how this formatting thing works.
Or, I don't know if this viable but every time i open the .docx file it says that it need to run sql query, can I access that query?, I think I have a base knowledge about that and I may be able to format it through the query.

Related

Best Practice to Store Simulation Results

Dear Anylogic Community,
I am struggling with finding the right approach for storing my simulation results. I have datasets created that keep track of every value I am interested in. They live in Main (see below)
My aim is to do a parameter variation experiment. In every run, I change the value for p_nDrones (see below)
After the experiment, I would like to store all the datasets in one excel sheet.
However, when I do the parameter variation experiment and afterwards check the log of the dataset (datasets_log), the changed values do not even show up (2 is the value I did set up in the normal simulation).
Now my question. Do I need to create another type of dataset if I want to track the values that are produced in the experiments? Why are they not stored after executing the experiment?
I really would appreciate if someone could share the best way to set up this export of experiment results. I would like to store the whole time series for every dataset.
Thank you!
Best option would be to write the outputs to some external file at the end of each model run.
If you want to use Excel, which I personally would not advise, even though it has a nice excelFile.writeDataSet() function, you can.
I would rather write the data to a text file as you will have much for control over the writing, the file itself, it is thread-safe, and useable in many many more platforms than Microsoft Excel.
See my example below:
Setup parameters in your model that you will write the data to at the end of the model of type TextFile. Here I used the model on destroy code to write out the data from the data sets.
Here you can immediately see the benefit of using the text file! You can add the number of drones we are simulating (or scenario name or any other parameter) in a column, whereas with Excel this would be a pain...
Now you can pass your specific text file to the model to use by adding it to the parameter variation page, providing it to the model through the parameters.
You will see that I also set up some headers for the text file in the Initial Experiment setup part, and then at the very end of the experiment, I close the text files in the After experiment section so that the text files can be used.
Here is the result if you simply right-click on the text files and open them in Excel. (Excel will always have a purpose, even if it is just to open text files ;-) )

MS Word - using a date variable without macros

I want to create a Word template which will:
a) prompt user for a date
b) display that date
c) calculate other dates from that date.
I'm using MS Word 2016.
I've never done anything like this in Word but after doing a bit of research I see that there are advanced options in Word which maybe I could use for that. I don't want to use macros for this as I'm thinking that if I can make this work, then I would share this template with the rest of the company and I don't want them to enable macros (we have enough security concerns without that).
I've tried to use a FILLIN field to prompt user for a date. This works, however, I would like this field to be a variable which I can reference later in the document. I haven't found a way to do that with my FILLIN field. Is it possible?
I've seen others mention DocProperties but I'm having a hard time making it work.
For example, if I go to Quick Parts -> Document Property, none of the options are for a custom date. Is there a way to add your own?
And if I go to Quick Parts -> Fields, I see Date, CreateDate, SaveDate which insert "today's date" - not what I want. Again, how do I add my own Field?
I could do this in many ways by using Excel but I wanted to see if I can make it happen with Word. I hope you guys will have an idea.

Browse Field Data contains value but nothing is shown on the report

I have annoying issue with CR 2011. We are trying to upgrade from very old CR8.5 (DBF files are used as source(s) for the reports) to CR2011 and right now strange issue has appeared.
There are several fields on the report and all of them contain some data (as can be seen in the dbf file itself and/or in Browse Field Data) but few of them are never "shown" on the report. (If I, however, browse the data within the preview in CR2011 designer, I can see the data with no problem.)
This report uses two (non-linked) tables.
If I try to create a blank report, add these two tables & format the report again, I'll get what I expect (i.e. all fields shown on the report). (But this is not a solution as we have hundreds of reports.)
It does not matter if I (re)save report in latest format.
Everything is shown when using CR8.5 (designer or "runtime")
Has anyone experienced similar behavior and/or some tips where to look?
Non-linked tables are "less" supported than before (whole support for dbf files is limited). So the only correct solution is to link non-linked tables together. In my case, as the "free" table was parameter table. I had to simply add "paramid" to both tables (always set to 0) and perform the linking.

Exporting a log from iPhone application

One of the features in my application is a log where a user can add log entries. I want to make it possible to for the user to export this data. However I do not know which format I should use for this. The data looks like this:
A date, distance, duration, maximum four category names. What I want is to make it possible to send it on mail or open it with dropbox using the URL scheme if the user has dropbox.
I have read about CSV format but I don't know if that is a good file format? My main concern is that the user do not have to have a fixed number of categories (could be between 1-4 categories)
Seeing as the columns of data to be exported will be dynamic in total, it will depend on what the user selects - and there's nothing wrong with this.
I think .csv is fine for this purpose as well - but you need to ask yourself... what will the user be doing with the data? You could either offer multiple file export formats or whatever is the best-for-purpose format, depending on what your average user will do with it.
CSV (comma separated values) is simple (and adds very little overhead - the commas), but not terribly flexible. This is good for importing to MSFT Excel, for instance.
You should consider using XML (the same underlying format used for plists) which is a very flexible (future proof should you wish to add additional columns in the future) and well supported format.

Mailmerge Field not always saved the same way in Word .docx

I have created a Word document with Word 2003 and inserted some MergeField via the GUI.
I have saved it as a .docx by using Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats. Some Mergefields are stored as a SimpleField, while others are stored as a FieldCode (with start-FieldChar and end-FieldChar). Some Googling brought me to this blog. As you can see the guy is facing the same problem; but hasn't found a solution yet.
I'm using the following code sample on Codeplex [Fill Mergefields] to replace the MergeFields with the actual values from different datasources.
Any help is welcome.
If a field's value is just simple text with consistent formatting, it can be stored as a fldSimple node. However, if the field's value has varying formatting, it has to be saved as a complex field (fldChar Start, Optional Separate, and End) so that each run within the field's value can have it's different formatting defined in the run properties <w:rPr>. I think that also happens if word uses the rsid attributes to track changes. The fldChar Start/Separate/End are also necessary if the fields are nested, such as multiple IF fields, so that it can store an arbitrary number of <w:r>, <w:p>, <w:tbl> as the field's value.
And sometimes it stores them like that for seemingly no good reason. (As that blog noted).