I am using DCP with MS CRM to print documents based on templates. I have multiple templates for different business units. I follow the code during debugging and the Guid is pointing to the correct template. It goes to the printer and prints out the wrong template.
Things I have looked at;
I know its damn near impossible but have two templates fluked the
same Guid? No
Does the correct template have the wrong
information. No
I don't understand why its happening. Right up to the point of printing, the Guid IS the correct Guid for the correct template. When I go to the printer, wrong template with the right merged feilds. And the template is attached to the order. (Which is also wrong)
== UPDATE ==
Looking into the database, there are 2 templates with the same name. However only 1 of them shows in the list in Word so I can not see the content of the other. Still looking for solution.
There were two templates in the database. One of them was inactive and one active. My code was selecting ALL templates with that name and giving back the first or default one.
I changed the code to only select active templates. This solved my problem.
Related
I'm using the reporting engine for aspose and everything is working fine.
The issue I have is that my document model has some larger names in it. I didn't build the model and I would rather not create a new one just for reporting, but if that's my only option I will. Thought I'd check here first.
Example:
<<[NatureOfInjury]>><<[NatureOfInjuryOptionA]>>
Hurt Hit thumb with hammer
The markup for <<[NatureOfInjury]>> is wider on the word document than the value that will end up going in there, and it's making formatting the document difficult.
Is there any way other than changing the object model to make the markup smaller, independent of the actual text values that will go in there?
Thanks very much in advance.
Unfortunately, there is no other way to populate template tag with data source field name using LINQ Reporting. You need to use the same name in template document and data source.
I work with Aspose as Developer Evangelist.
I am getting "Object reference not set to an instance of an object" exception when using the following code in Partial views section but same code working fine in Templates. Didn't understand why ?
That's a really general question. If you follow the Archetype documentation you won't have a problem getting the values.
Two things: "Not set to an instance of an object" means that you literally have asked something that doesn't exist. I've came across this error so many times and every time was the fact that my path
(e.g. your Model.Content in this case) is wrong. Maybe your editor is in another node or a parent or a descendant etc etc.
Second is: don't let razor 'guess' the type of value you need. Instead of
Model.Content.GetPropertyValue("example")
Try either: Model.Content.GetPropertyValue<string>("example")
Or: Model.Content.GetPropertyValue<int>("example")
That way, you won't be making mistakes when for example you ask for an int, but razor 'guesses' by itself you're asking for a string. Even if your path is correct, that might mess your code up.
However, first check your path. "Not set to an instance of an object" usually means that you're asking for something that's not there. Different path needed most probably.
I'm trying to get these parameters while creating a visual studio template but it doesn't return a value, it just stays like this:
string rootnamespace = $rootnamespace$; // this is the output, it just stays as it was declared
string SpecificSolutionName = $SpecificSolutionName$; // this is the output, it just stays as it was declared
According to msdn - Template Parameters:
SpecificSolutionName:
The name of the solution. When "create solution directory" is checked, SpecificSolutionName has the solution name. When "create solution directory" is not checked, SpecificSolutionName is blank.
And I made sure that the "create solution directory" is checked, but still it doesn't give any value.
How can I get these values. please... ?
I also found $SpecificSolutionName$ to be broken. As a work around it turns out the directory of the solution is usually the same as the name of the solution and thus:
If your solution template has only 1 project: the solution and project names are identical and thus you can simply use $projectname$ in lieu of the broken $SpecificSolutionName$.
If your solution template has multiple projects (aka ProjectCollection): add the attribute CopyParameters="true" to the desired ProjectTemplateLink element and use $ext_projectname$ in lieu of the broken $SpecificSolutionName$.
I think the documentation is not enough clear when it comes to multiproject templates. Putting the wizard declaration in the vstemplate of your multiproject definition, and on the project/s that you desired to use to, makes the "broken" variable appears.
This is because, it launch the wizard for each time you declare it, so to speak, and it behaves differently depending on the context.
Pay attention: the variable $SpecificSolutionName$ only has value when executing the first time for the multiproject vstemplate declaration, and only executes RunStarted, ProjectFinishedGenerating and RunFinished methods. So, to use it in a global context you need to figure out some kind of mechanism to mantain the value between Wizard executions, as adding a new key in the replacementsDictionaryor something.
Hope this help.
I fixed this by adding this doctype declaration to the start of my .vstemplate.
<?xml version="1.0" encoding="utf-8"?>
The doctype declaration is not supplied by the template wizard, but is present in all the preinstalled templates. Good luck and thank you for your patience while I researched this question.
$SpecificSolutionName$ is always empty. How can I tell if the user is making a new solution directory or not?
Frustratingly, the docs are wrong in 2 ways.
There is no "SpecificSolutionName". It is "SpecifiedSolutionName".
If the user unticks "Create directory for solution", then $SpecifiedSolutionName$ is not blank as stated; it actually becomes the same as $projectname$. How you determine when this has or has not occurred and whether what you're reading is a unique solution folder's name or not, is another story.
I have a SharePoint 2010 solution in Visual Studio 2013. Every time I close and reopen Visual Studio, a new feature is added to the solution with one list inside it. The list was removed from another feature that it should be in. It is always the same list. As soon as I open the solution this pops up in the Output window before I do anything...
A new feature Feature2 has been added to the project Solution
C:\Code\Solution\Package\Package.package (0,0): Added Feature2 to Package
What is causing this?
I have tried the following:
Recreated the solution and copied all files over - No change
Checked the package and project manifest. - Everything looks okay.
Loaded the project every different way, including unload and reload command. - No change
Recreated the list it likes to isolate into its own feature - No change
Recreated the feature the list should be in but it keeps moving to this new feature - No change
Added a new list and put it after the problem list in the feature - VS then created 3 new features! It took 3 lists out of my feature and put one in each of its own features. I guess I made it angry.
If the lists in the same feature have the same Type ID, the tooling will move the lists into a newly created feature, because the Type must be unique within a feature. You can check the documentation on the ListTemplate element for more information.
It is because features cannot contain list templates that have identical values for Type. This is explained here: https://msdn.microsoft.com/en-us/library/office/ms462947.aspx
Type
Optional Integer.
Provides a unique identifier for the template. This identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions. For a list of the default list template types, see SPListTemplateType.
You will probably find that your Elements.xml file for your list templates contains the same value for Type.
To fix this, you will need to edit the Elements.xml files of the list template and the list instance.
Change the Type of the ListTemplate xml element to a unique integer.
Change the TemplateType of the ListInstance xml element to the same integer
I have started to choose numbers over 1000 to avoid conflicts (Although 1100, 1200, 1220 and 1221 are system types)
Seems like once you set the Testers field on a Test Case in MTM, it will not allow you to clear it. You are only allowed to change it to a different value. Has anyone found a way to clear this field?
It is important to not get the "Assigned" Tester field confused with the Assigned To field. They are distinct fields on a Test Case work item. One reason why someone might want the Tester field to be blank is if a team all pitches in to help with testing during an iteration and leaving the assigned tester blank allows the team to know that no one has "picked up" this test to execute. The team member could then assign the test to his or herself and execute it.
The template pulls the Assigned Tester Values from a list using the 'AllowedValues' tag. Instead, simply change this to 'SuggestedValues'. That will allow for empty values - easy as that.
If you'd rather not allow free entry, you can also add a default value such as 'None' and use that rather than blank.
Unless you've customized your work item type, this field should never be blank after being saved. It defaults to the person who created the bug in all Microsoft supported process templates, and a value is required by default.
That being said, why would you want to change it to blank?
If you really, really want to be able to blank it out (which I don't think is a good idea at all), you'll need to customize your template. See the below guidance:
http://msdn.microsoft.com/en-us/library/ms243849(v=vs.110).aspx