Render DevExpress XtraReport template as HTML - asp.net-mvc-3

We are using DevExpress DX.10.2. Our client has asked to be able to view the XtraReport templates (not the report itself, just the template) within an MVC 3 application that we maintain for them.
My first thought was that I'd have to fake the data to look like the "template" and show the actual reports. However, I noticed in Visual Studio that the XtraReport designer has an "HTML View" option that renders the template in HTML.
I would think that if DevExpress is able to render the template as HTML in the designer then it's likely that there's a way to extract that HTML to render on a view. Is there a way to extract HTML from an XtraReport template?
Thanks!

Stumbled across the solution. Had to add a reference to DevExpress.XtraReports.Web and then the following line writes the report HTML to the response stream:
XtraReport1 report = new XtraReport1();
DevExpress.XtraReports.Web.ReportViewer.WriteHtmlTo(System.Web.HttpContext.Current.Response, report);

Related

Exporting MVC3 Print view to PDF

Is it possible with MVC3 (using 3rd party plugins if necessary) to generate a PDF dynamically using the print view of a page? As in, the layout you see if you print or print preview the view.
I know that iText(sharp) can create a PDF out of a normal view of a page but I need to create the print view PDF (via the controller preferably) so that it can be emailed.
I had Crystal Reports in place previously but have scrapped it in favor of HTML reports.
I solved my problem by implementing Rotativa (available from NuGet). It's much simpler and more effective than other converters around (gets a bit tricky with custom authentication though).

Render a RDL (Reporting Services) in MVC3

Can I display report services file (RDL), direclty in a view with MVC (Razor)? Tried in various ways, but without success. Anyone have any useful tips about this?
Sorry for bad english.
Regards,
No, you cannot as the RDL file requires a viewer control which is a server side control to render the report. MVC Razor views do not support server side controls.
But.. you can add an .aspx page to your project and add a report viewer to that page. It won't work with the Razor .vbhtml or .cshtml files in MVC

Dev Express MVC Extensions with Razor - Controls Show as Lists

Any DevExpress control I use, just renders a list. I’ve tried all 3 possible syntaxes (listed on the site below) and every time, the control I want to use (TreeView, NavBar, etc.) just renders as a bulleted list. Any ideas why? I’ve checked Google and the DevExpress support center, but I can’t find any issues like this.
DevExpress with razor guide: http://documentation.devexpress.com/#AspNet/CustomDocument9944
I just put this code on my index page to test that DevExpress is working:
#{Html.DevExpress().NavBar(settings => {
settings.Name = "myNavBar";
settings.Groups.Add("Group1").Items.Add("Item1-1");
settings.Groups.Add("Group2").Items.Add("Item2-1");
settings.Groups.FindByText("Group2").Expanded = false;
}).Render();}
When it reaches the page, it just shows a bulleted list:
Group1
Item1-1
Group2
Any ideas what's causing this?
The project I was working on was being rendered inside another project. I just needed to get rid of my project's layout and add using statements to the cshtml pages:
#using DevExpress.Web.Mvc.UI;
#using DevExpress.Web.Mvc;
The only problem I still have, is the scriptlet code gets highlighted red (but it builds/works fine and has intellisense).
It seems that any required DevExpress' entry is not registered within the MasterPage (_Layout.cshtml) / Web.config http://help.devexpress.com/#AspNet/CustomDocument8163. I suggest that you use specially designed Visual Studio Project Templates http://help.devexpress.com/#AspNet/CustomDocument9145 to avoid missing any required DevExpress' entry.

Adding HTML5 markup to a MVC3 site

I have already created a MVC3 site but when I did I didn't select the HTML5 markup option. I would like to add some 'safe' HTML5 markup into the MVC3 site unless there is a way to convert the project to use HTML as if I had selected it from the start (is that possible?).
Would I be safe changing the _layout.cshtml to use HTML5 markup such as nav? How do I use my current CSS style sheet to make sure it positions it correctly (is it as simple as adding the class)?
I understand you can select the 'Target Schema For Validation' option to HTML5. Is that mainly for intellisense? Is this one of the primary bi-products of selecting the HTML5 option at project creation time or are there many more impacts other then this target schema and the _layout page?
Thanks much in advance!
There is no magic to the HTML5 support in MVC3. The checkbox in the project template dialog simply creates a different _layout file with <nav> instead of <div>, a reference to modernizr.js, etc. You're free to change the markup of the _layout file to whatever you like.
The schema validation dropdown simply governs what code completion options you get from Intellisense, and what warnings you get when adding markup that does not conform to the schema. But again, if the HTML5 standard gets updated with new tag next week, and Microsoft fails to update Visual Studio, you're free to add markup that doesn't conform to the VS schema.

How can I get TextMate to recognize intellisense for ASP.NET MVC Razor views?

I'm using TextMate on a Mac as a front end designer and trying to open cshtml (razor) views to just tweak html, but the html intellisense does not trigger. How do i get html intellisense on the cshtml files?
TextMate doesn't have HTML intellisense. It has language-specific tab completion and dumb attribute completion on some languages but nothing that comes close to Visual Studio's "intellisense" or Eclipse's "content assist".
If you want to use its HTML-related features you only have to select HTML in the "Language" menu at the bottom of the window.
That said, I just saved a sample of .cshtml from a random tutorial and TextMate recognizes it as HTML automatically so I'm not sure what's going on.
There are a couple of ASP.NET oriented HTML bundles available, did you try them ?
Here's some information I found on associating file types in textmate. Hopefully it will be of assistance.
https://superuser.com/questions/40506/textmate-file-type-association
http://blog.macromates.com/2007/file-type-detection-rspec-rails
Ultimately, you need to tell TextMate to use the html engine with any file that has a cshtml or vbhtml extension.

Resources