MVC 3 create Microsoft Word report Document - asp.net-mvc

I have a project where I need to create a Word document report based on some items which custumer can choose on MVC 3 (Razor) website.
Is it possible in any way? The only solutions I can find is report in Excel.
Do I need to create Word Templates?

I would probably use the: Open XML SDK 2.0 for Microsoft Office
there are many advantages in doing this like no need to instantiate Word on the web server, probably not even need to have it installed...

Related

Umbracco, forms and rich text editors

Looking to understand if it is possible in Umbraco to have a form page, that contains a rich text CMS editor too?
Do I need a plugin?
Umbraco has a paid for plugin called Umbraco Forms (https://umbraco.com/products/umbraco-forms/).
I'm sure there are likely plenty of free plugins for rich text editors if you want to create a custom form.
As mentioned in Bradley's answer, Umbraco Forms package is what most Umbraco Developers would use.
It is not free, but if you are working for an Umbraco Gold Partner company, then it is currently free for your company. If this is your case, then you should be able to generate as many Umbraco Forms licences as you need for your Umbraco projects and use them without any issues, otherwise, you need to purchase it.
After installing the Umbraco Forms package to your Umbraco project, you can create your Forms directly from the Umbraco Backoffice>Forms session:
You use "Answer types" to create your form fields. There is not a Rich Text Editor answer type out of the box at the moment.
Your options could be;
Using a Short or Long Answer answer type.
Using the Title and Description answer type.
Alternatively, you can extend the Umbraco backoffice for Umbraco forms and create your custom answer types by creating your custom Field types as described here . While doing this, you might need some custom workflows, and here is how you can create custom workflows.

oData client limit classes

I am currently testing oData client in combination with Dynamics AX 7. The metadata file coming from AX is over 900'000 lines big and if i use the default oData client and auto generate a C# class file it won't build because of too many string literals (.net error).
Now i'm looking for a way to tell the client generator which classes to generate (by entity name for example) and which not (about 95% isn't needed on the client-side).
Sadly limiting the metadata on AX side is not an option.
We had a similar issue, where we had to modify the available $metadata information from an ODATA service.
In our case we used the DataServiceContext generator and pointed to the original server URI but used Fiddler as a Proxy inbetween. By using a breakpoint in Fiddler we could serve our modifed $metadata xml to the DataServiceContext generator in Visual Studio. Works fine when you used sparingly and if the API is stable.
Yes using VS2015 will solve your "too many strings" error, but you will still have a problem where Visual Studio 2015 will crash if you open the huge file that is generated or accidentally step into the oData client file while debugging.
To get around this issue, I edited the T4 templates which auto-generate the oData client classes so that they create multiple files, so you do not end up with one huge 1 million+ line file. Using the updated T4 templates, it will generate the same code, but will split into a new file every 5MB.
The updated T4 templates can be found here:
https://github.com/batetech/D365FO-oData-T4-MultiFile-Templates

Cakephp bake equivalent in asp.net mvc

I was developing with cakephp for a few years and now want to try out asp.net mvc.
In cakephp there is a bake plugin, that allows to create standard functionalities based on customizable templates. E.g. changing these templates according to my needs
1) for controller
https://github.com/cakephp/bake/blob/master/src/Template/Bake/Controller/controller.ctp
https://github.com/cakephp/bake/blob/master/src/Template/Bake/Element/Controller/index.ctp
https://github.com/cakephp/bake/blob/master/src/Template/Bake/Element/Controller/add.ctp
2) for model file
https://github.com/cakephp/bake/blob/master/src/Template/Bake/Model/table.ctp
3) for view files
https://github.com/cakephp/bake/blob/master/src/Template/Bake/Template/index.ctp
https://github.com/cakephp/bake/blob/master/src/Template/Bake/Element/form.ctp
I could run a command from CLI and get full functional validation, controller files with actions and view files - based on the existing tables' structures and relations between them. The plugin will create actual php files in corresponding directories with content according to template files. Having pre-customized bake templates allows to generate the CRUD or any other custom functionality in a few minutes.
Is there a similar functionality in asp.net mvc (v5 or above)? The desired features are to be able to fully customize the templates, which will be used to create controllers, cshtml files and model files - assuming that we already have the tables with foreign key associations in the database. (Preferably free, but not necessarily)
Thanks
I think this link might help you with templates in visual studio. If you want to use command line, maybe yeoman can help you. See this link to see if it'll work for you.

Using the razor engine in SharePoint 2013 Visual Web Part

I'm trying to make use of the razor engine in a SharePoint 2013 Web Part. This, I read, shouldn't be too difficult since SharePoint 2013 Visual Web Parts can be built using .NET Framework 4.0
I'm simply not sure of where to begin to do this. I've seen an article on uploading the .cshtml file onto a document library and referencing the document library in the Web Part, but it is a bit unclear.
Does anyone have an idea of how I can start? Or point me to a step-by-step guide to achieve what I am after.
What my end goal is: Take a piece of an MVC application, customize it and make it a Web Part. I need to be able to modify or access SharePoint content on that site which is why I cannot use an App Part.
Okay.
First install the Office Development Templates from
http://www.microsoft.com/visualstudio/eng/office-dev-tools-for-visual-studio
This will give you the following template selection on reopening Studio
Then navigate to wherever EwsManagedApi32.msi is and enter the following command in an elevated prompt -
EwsManagedApi32.msi addlocal="ExchangeWebServicesApi_Feature,ExchangeWebServicesApi_Gac"
Now your templates are usable and the one you want is "VS2012 Web Part".
Now, by default this will add an ASP.NET project, which is not what you want, so manually delete the ASP.NET project, add an MVC one, highlight the SharePoint project in Solution Explorer, hit F4, and select the MVC project in the "Web Project" dropdown at the bottom of the properties.
And there you go. One controller per web part, sorted.
I am sharing link SharePoint MVC webpart that uses Knock out framework using MVC for SharePoint. It has step by step instructions which might help you.
Hope this will be a good starting point
http://www.codeproject.com/Tips/739445/SharePoint-Razor-View-WebPart

ASP.NET MVC Server File Browsers

On my current project we would like to expose some server directories to the client so they can control their own assets/static HTML/CSS etc. The existing web forms project is being replaced by MVC and I am struggling to find an out of the box server file browser with which to expose this functionality.
Here is an example for WebForms: Telerik FileExplorer demo
Can anyone recommend a decent alternative which is designed for the MVC framework? We don't mind paying license fees, however something extensible and preferably open source would be better :)
Look for some jQuery,Ajax based file managers
some links to start with
http://plugins.jquery.com/project/SFBrowser
http://riderdesign.com/articles/Build-a-file-tree-explorer-with-jQuery-and-ASP.NET.aspx
jQuery File Tree works well for me.
It is read-only and you can set root directory and other options.
It has an ASPX connector included in package.
[Full Disclosure: I work for Telerik.]
Telerik has not yet recreated the RadFileExplorer reusable UI experience for MVC, but we do have a powerful Treeview in our open source Telerik Extensions for ASP.NET MVC. Using the Treeview, you can easily create a server file explorer using techniques similar to those in the RiderDesign article highlighted by Ajay. One advantage of using the Telerik Extensions vs. something like a JavaScript UI plug-in is that you get server and client-side rendering, improving your application's accessibility and behavior in non-JS clients.
You can learn more about using the Treeview in these online examples:
http://demos.telerik.com/aspnet-mvc/TreeView
Hope that helps.

Resources