Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesExport data in Excel file from MVC module.Export data in Excel file from MVC module.
Previous
 
Next
New Post
8/26/2016 6:11 AM
 

Hello guys,

I'm trying to export data from MVC modulo with this code :

_____________________________________________________________________________________________________________________________________________   

   public ActionResult ExportToEXCEL()

        {

            TECHNICALViewModel TECHNICALReportModel = new TECHNICALViewModel();

            TECHNICALReportModel.ITSystemStatus = db.ITSystemStatus.ToList();

            Response.Clear();

            Response.Buffer = true;

            StringBuilder sb = new StringBuilder();

            // Parts With No Allergen settings

            sb.Append("<h1> Parts With No Allergen settings </h1>");

            sb.Append("<table style='1px solid black; font-size:12px;'>");

            sb.Append("<tr>");

            sb.Append("<td style='width:120px;'><b>Part</b></td>");

            sb.Append("<td style='width:300px;'><b>Description</b></td>");

            sb.Append("<td style='width:100px;'><b>Status</b></td>");

            sb.Append("</tr>");

 

            var query2 = db2.F8PARTTECH.Where(d =>

                    d.PartStatus == null && d.AllergenFree == null

                    && d.F8PARTTECH_Id.StartsWith("1")

                    && d.AL1 == null

                    && d.AL2 == null && d.AL3 == null

                    && d.AL4 == null && d.AL5 == null

                    && d.AL6 == null && d.AL7 == null

                    && d.AL8 == null && d.AL9 == null

                    && d.AL10 == null && d.AL11 == null

                    && d.AL12 == null).OrderBy(d => d.F8PARTTECH_Id);

 

            foreach (var ReportData in query2)

            {

                sb.Append("<tr>");

                sb.Append("<td>" + ReportData.F8PARTTECH_Id + "</td>");

                sb.Append("<td>" + ReportData.PartDecrip + "</td>");

                sb.Append("<td>" + ReportData.PartStatus + "</td>");

                sb.Append("</tr>");

            }

 

            var sFileName = string.Format("Parts_With_No_Allergen_settings_{0}.xls", DateTime.Now.ToString("s"));

            Response.AddHeader("content-disposition", "attachment; filename=" + sFileName);

            Response.ContentType = "application/vnd.ms-excel";

            byte[] buffer = System.Text.Encoding.UTF8.GetBytes(sb.ToString());

 

            return File(buffer, "application/vnd.ms-excel");

        }

_________________________________________________________________________________________________________________________________________________________________________________

 

But the export file contains html code of the menu bar and header of portal in addition to data exported :

_____________________________________________________________________________________________________________________________________

 

<h1> Parts With No Allergen settings </h1><table style='1px solid black; font-size:12px;'><tr><td style='width:120px;'><b>Part</b></td><td style='width:300px;'><b>Description</b></td><td style='width:100px;'><b>Status</b></td></tr><tr><td>10000001-2</td><td>BREAK</td><td></td></tr><tr><td>10000003-2</td><td>MAXXD 24C (COLD)</td><td></td></tr><tr><td>10000004-2</td><td>CIP- SCANIMA</td><td></td></tr><tr><td>10000005-2</td><td>CIP - K3</td><td></td></tr><tr><td>10000006-2</td><td>CIP- K4</td><td></td></tr><tr><td>10000007-2</td><td>CIP - Hotline</td><td></td></tr><tr><td>10000010-2</td><td>MAXXD ARC</td><td></td></tr><tr><td>10000011-2</td><td>MAXXD GDR</td><td></td></tr><tr><td>10000012-2</td><td>ARC - SCANIMA</td><td></td></tr><tr><td>10000013-2</td><td>FLUSH-SCANIMA</td><td></td></tr><tr><td>10000014-2</td><td>ARC K3</td><td></td></tr><tr><td>10000015-2</td><td>FLUSH-K3</td><td></td></tr><tr><td>10000016-2</td><td>FRYMA ARC</td><td></td></tr><tr><td>10000017-2</td><td>FLUSH-FRYMA</td><td></td></tr><tr><td>10000018-2</td><td>ARC - HOTLINE</td><td></td></tr><tr><td>10000019-2</td><td>FLUSH- HOTLINE</td><td></td></tr><tr><td>10000020-2</td><td>ARC- K4</td><td></td></tr><tr><td>10000021-2</td><td>FLUSH- K4</td><td></td></tr><tr><td>10000022-2</td><td>FRYMA 24C COLD</td><td></td></tr><tr><td>10000023-2</td><td>MAXXD PRC </td><td></td></tr><tr><td>10000024-2</td><td>MAXXD 24C (HOT)</td><td></td></tr><tr><td>10000025-2</td><td>FRYMA PRC</td><td></td></tr><tr><td>10000026-2</td><td>FRYMA GDR</td><td></td></tr><tr><td>10000027-2</td><td>Compact 24C (COLD)</td><td></td></tr><tr><td>10000028-2</td><td>Compact ARC</td><td></td></tr><tr><td>10000029-2</td><td>Compact GDR</td><td></td></tr><tr><td>10000030-2</td><td>Compact PRC</td><td></td></tr><tr><td>10000031-2</td><td>Compact 24C (HOT)</td><td></td></tr><tr><td>10000099-2</td><td>DUMMY part Chester</td><td></td></tr><tr><td>10103754-105</td><td>EPC VL Garlic Paste 10kg</td><td></td></tr><tr><td>10103754-105*H</td><td>EPC VL Garlic Paste 10kg</td><td></td></tr><tr><td>10103754-282</td><td>EPC VL Garlic Paste 75g</td><td></td></tr><tr><td>10103754-B</td><td>EPC VL Garlic Paste 75g</td><td></td></tr><tr><td>10103757-105</td><td>EPC VL Ginger Paste 10kg</td><td></td></tr><tr><td>10103757-105*H</td><td>EPC VL Ginger Paste 10kg</td><td></td></tr><tr><td>10103757-282</td><td>EPC VL Ginger Paste 75g</td><td></td></tr><tr><td>10103757-B</td><td>EPC VL Ginger Paste 75g</td><td></td></tr><tr><td>10107217-282</td><td>^EPC VL Garlic Paste 6 x 75g</td><td></td></tr><tr><td>10107217-B</td><td>EPC Garlic Paste  75g</td><td></td></tr><tr><td>10107218-282</td><td>^EPC VL Ginger Paste 6 x 75g</td><td></td></tr><tr><td>10107218-B</td><td>EPC VL Ginger Paste  75g</td><td></td></tr><tr><td>10107219-282</td><td>^EPC VL Chilli Paste 6 x 70g</td><td></td></tr><tr><td>10107219-B</td><td>EPC VL Chilli Paste 75g</td><td></td></tr><tr><td>10107220-282</td><td>^EPC VL Lemongrass Paste 6 x 75g</td><td></td></tr><tr><td>10107220-B</td><td>EPC VL Lemongrass Paste 75g</td><td></td></tr><tr><td>10107221-282</td><td>^EPC VL Basil Paste 6 x 75g</td><td></td></tr><tr><td>10107221-B</td><td>EPC VL Basil Paste 75g</td><td></td></tr><tr><td>10107222-282</td><td>^EPC VL Coriander 6 x 75g </td><td></td></tr><tr><td>10107222-B</td><td>EPC VL Coriander 75g </td><td></td></tr><tr><td>10107223-282</td><td>^EPC VL M'can Harrisa Pste 6x75g</td><td></td></tr><tr><td>10107223-B</td><td>EPC VL M'can Harrisa Pste Bld 75g</td><td></td></tr><tr><td>10107557-105</td><td>ING EPC VL lime Leaves  Paste 10kg</td><td></td></tr><tr><td>10107557-105*H</td><td>ING EPC VL lime Leaves  Paste 10kg</td><td></td></tr><tr><td>10107557-282</td><td> EPC VL lime Leaves Paste Tube 6x?g</td><td></td></tr><tr><td>10107557-B</td><td>EPC VL lime Leaves Paste Tube ?g</td><td></td></tr><tr><td>10257536-2</td><td>^Lidl Wholegrain Mustard 175g</td><td></td></tr><tr><td>10257686-371</td><td>Sol Y Mar Lidl Quince Paste 100g</td><td></td></tr><tr><td>10257820-75</td><td>^Lidl Mixed Case Must (Gres Pots)  </td><td></td></tr><tr><td>10257915-75</td><td>^Lidl Premium Mustard 12 x 8oz</td><td></td></tr><tr><td>10257932-2</td><td>Lidl Hollandaise sce ?g</td><td></td></tr><tr><td>10257932-B</td><td>Lidl Hollandaise sce ?g</td><td></td></tr><tr><td>10353710-105</td><td>Sainsbury Free From Mayo 10kg</td><td></td></tr><tr><td>10353710-105*B</td><td>Sainsbury Free From Mayo 10kg</td><td></td></tr><tr><td>10353710-105*G</td><td>Sainsbury Free From Mayo 10kg</td><td></td></tr><tr><td>10357433-259</td><td>JS Mirin 14% 150ml</td><td></td></tr><tr><td>10357433-B</td><td>JS Mirin 14% 150ml </td><td></td></tr><tr><td>10357575-105</td><td>JS ING Thai Blend Paste 10kg</td><td></td></tr><tr><td>10357575-105*H</td><td>JS ING Thai Blend Paste 10kg</td><td></td></tr><tr><td>10357575-282</td><td>JS Thai Blend Paste Tube 6x80g</td><td></td></tr><tr><td>10357575-B</td><td>JS Thai Blend Paste Tube 6x80g</td><td></td></tr><tr><td>10387585-154</td><td>^Co op French Mustard 5x180g</td><td></td></tr><tr><td>10387585-37</td><td>^Co-op French Mustard 6x180g</td><td></td></tr><tr><td>10387586-154</td><td>^Co op Dijon Mustard 5x180g</td><td></td></tr><tr><td>10387586-37</td><td>^Co-op Dijon Mustard 6x180g</td><td></td></tr><tr><td>10387587-154</td><td>^Co op Wholegrain Must 5x180g</td><td></td></tr><tr><td>10387587-37</td><td>^Co-op Wholegrain Must 6x180g</td><td></td></tr><tr><td>10403800-146</td><td>Tesco Fin EVO Mayo Red Salt ?g</td><td></td></tr><tr><td>10403800-B</td><td>Tesco Fin EVO Mayo Red Salt ?g</td><td></td></tr><tr><td>10403800-K*J</td><td>ING Tesco Fin EVO Mayo Red Salt 10k</td><td></td></tr><tr><td>10407528-37</td><td>^Tesco Finest Dijon Mustard  6x175g</td><td></td></tr><tr><td>10407529-37</td><td>^Tesco Fin Coarse Grain Must 6x175g</td><td></td></tr><tr><td>10407668-156</td><td>Tesco Sambal Paste 95g</td><td></td></tr><tr><td>10407668-B</td><td>Tesco Sambal Paste 95g</td><td></td></tr><tr><td>10407865-80</td><td>Tesco Fat Free Vinaigrette 250ml</td><td></td></tr><tr><td>10407865-B</td><td>Tesco Fat Free Vinaigrette Dre250ml</td><td></td></tr><tr><td>10697836-37</td><td>M&S Rocoto Chilli Jelly 200 g</td><td></td></tr><tr><td>10697836-B</td><td>M&S Rocoto Chilli Jelly 200g</td><td></td></tr><tr><td>10697892-37</td><td>M&S Cran & Blood Orange Jelly 215g</td><td></td></tr><tr><td>10697892-B</td><td>M&S Cran & Blood Orange Jelly 215g</td><td></td></tr><tr><td>11694607-K</td><td>M&S Tomato Ketchup Chester </td><td></td></tr><tr><td>12143174-183</td><td>^Country Range Dijon Must 2x 2.2L</td><td></td></tr><tr><td>12143175-183</td><td>^Country Range W/Grain Must 2x2.2L</td><td></td></tr><tr><td>12333543-105</td><td>Greencore Lime & Chilli Dress 10kg</td><td></td></tr><tr><td>12333543-105*H</td><td>Greencore Lime & Chilli Dress 10kg</td><td></td></tr><tr><td>12333818-105</td><td>GCore Bow Lime & Chilli Dress 10kg</td><td></td></tr><tr><td>12333818-105*H</td><td>GCore Bow Lime & Chilli Dress 10kg</td><td></td></tr><tr><td>12333941-105</td><td>Greencore Chilli & Lime Sauce 10kg</td><td></td></tr><tr><td>12333941-105*H</td><td>Greencore Chilli & Lime Sauce 10kg</td><td></td></tr><tr><td>12488888-105</td><td>NPD Samples  </td><td></td></tr><tr><td>12488888-K</td><td>NPD SAMPLE</td><td></td></tr><tr><td>12488889-105</td><td>Purchasing Samples</td><td></td></tr><tr><td>12488889-K</td><td>Purchasing Samples</td><td></td></tr><tr><td>12492230-105</td><td>MFG Prosp Bus Flav Mayo 10kg</td><td></td></tr><tr><td>12492231-K</td><td>MFG Prosp Bus 25-40% Mayo 1kg </td><td></td></tr><tr><td>12492232-K</td><td>MFG Prosp Bus 40-60% Mayo 1kg </td><td></td></tr><tr><td>12492233-K</td><td>MFG Prosp Bus Full Fat Mayo 1kg </td><td></td></tr><tr><td>12492961-105</td><td>MFG Hotline Propsective Bus 10kg</td><td></td></tr><tr><td>12493923-105</td><td>Cranswick Vegan Mayonnaise 10kg</td><td></td></tr><tr><td>12493923-105*B</td><td>Cranswick Vegan Mayonnaise 10kg</td><td></td></tr><tr><td>12497288-174</td><td>^EPC Hot Horseradish 2.5kg</td><td></td></tr><tr><td>12592961-105</td><td>MFG Hot Sandwich Growth 2016</td><td></td></tr><tr><td>12692961-105</td><td>MFG Cold sandwich Growth 2016</td><td></td></tr><tr><td>12994374-K</td><td>ING 3% Premium mayo</td><td></td></tr><tr><td>12994375-K</td><td>ING  concentrated pre mix</td><td></td></tr><tr><td>14003174-183</td><td>^Un-lab Cntry Rng Dijon Mstd 2x2.2L</td><td></td></tr><tr><td>14492232-K</td><td>MFG Prosp Bus 40-60% Mayo Chester</td><td></td></tr><tr><td>14492234-K</td><td>MFG Prosp Bus Hot Pallecon Chester</td><td></td></tr><tr><td>14494813-173</td><td>MFG Chester Prospective Bus 2.2kg </td><td></td></tr><tr><td>14494813-183</td><td>MFG Sapphire Prospective Bus 2.4kg</td><td></td></tr><tr><td>14494814-175</td><td>MFG Chester Prosp. Bus Hot Pots</td><td></td></tr><tr><td>14494815-175</td><td>MFG Chester Prosp Bus Cold Pots</td><td></td></tr><tr><td>14494817-106</td><td>MFG Chester Prospective Bus 2.5kg </td><td></td></tr><tr><td>14494904-192</td><td>MFG Chester Prospective Bus Sachet </td><td></td></tr><tr><td>148110091-L</td><td></td><td></td></tr><tr><td>14890687-K</td><td>Rapeseed Oil KG</td><td></td></tr><tr><td>14890687-K*J</td><td>Rapeseed Oil KG</td><td></td></tr><tr><td>15003174-183</td><td>^Labeld Cntry Rng Dijon Mstd 2x2.2L</td><td></td></tr><tr><td>15003175-183</td><td>^Labelld Cntry Rng Wgrn Mstd 2x2.2L</td><td></td></tr><!DOCTYPE html>

<html  lang="en-US">

<head id="Head">

<!--*********************************************-->

<!-- DNN Platform - http://www.dnnsoftware.com   -->

<!-- Copyright (c) 2002-2015, by DNN Corporation -->

<!--*********************************************-->

<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><title>

Technical

</title><meta id="MetaDescription" name="DESCRIPTION" content="Technical functions of Enterprise Portal." /><meta id="MetaKeywords" name="KEYWORDS" content="Technical functions Enterprise Portal,DotNetNuke,DNN" /><meta id="MetaGenerator" name="GENERATOR" content="DotNetNuke " /><meta id="MetaRobots" name="ROBOTS" content="INDEX, FOLLOW" /><link href="/Resources/Shared/stylesheets/dnndefault/7.0.0/default.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/DesktopModules/MVC/EPCEPTECHNICAL/module.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/Resources/Search/SearchSkinObjectPreview.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/Portals/_default/Skins/Xcillion/bootstrap/css/bootstrap.min.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/Portals/_default/Skins/Xcillion/css/jquery.smartmenus.bootstrap.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/Portals/_default/Skins/Xcillion/Menus/MainMenu/MainMenu.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/Portals/_default/Skins/Xcillion/skin.css?cdv=131" type="text/css" rel="stylesheet"/><link href="/Portals/0/portal.css?cdv=131" type="text/css" rel="stylesheet"/><script src="/Resources/libraries/jQuery/01_09_01/jquery.js?cdv=131" type="text/javascript"></script><script src="/Resources/libraries/jQuery-UI/01_11_03/jquery-ui.js?cdv=131" type="text/javascript"></script><link rel='SHORTCUT ICON' href='/Portals/0/icon.ico?ver=2016-07-11-164109-310' type='image/x-icon' /><link href="http://epcep/technical/moduleId/447/controller/TECHNICAL/action/ExportToEXCEL" rel="canonical" /><meta name="viewport" content="width=device-width,initial-scale=1" /></head>

<body id="Body">

    

    <form method="post" action="/technical/moduleId/447/controller/TECHNICAL/action/ExportToEXCEL" id="Form" enctype="multipart/form-data">

<div class="aspNetHidden">

<input type="hidden" name="StylesheetManager_TSSM" id="StylesheetManager_TSSM" value="" />

<input type="hidden" name="ScriptManager_TSM" id="ScriptManager_TSM" value="" />

<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />

<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="u8QjpK76agWW1L9g6heFtDfpCIqbDQyc7emdUe6d81ADbGAa4w+69cNYZEWjMUGgBP+iFvnJMzesOCbxwWaA8iaTr6V9hSK2QftIw+eBMAUKMnRYVG+OHA2KXNphhOtIS0bwUV+B9RPBx8ZcfDZL2cXumwvd41pIlRP3ERKI/isb5rzVzItUSvy1SE3ZFClzIMTb0V4FrAHQ3le9JLSwNyuHAdr/LnWndLOK7w==" />

</div>

 

<script type="text/javascript">

//<![CDATA[

var theForm = document.forms['Form'];

if (!theForm) {

    theForm = document.Form;

}

function __doPostBack(eventTarget, eventArgument) {

    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {

        theForm.__EVENTTARGET.value = eventTarget;

        theForm.__EVENTARGUMENT.value = eventArgument;

        theForm.submit();

    }

}

//]]>

</script>

 

 

<script src="/WebResource.axd?d=pynGkmcFUV2Op-73V4qjTmAX1WvKrKABZXQVv81eIKwdyP6uTCA1JdqDzSM1&amp;t=635973343457771492" type="text/javascript"></script>

 

 

<script src="/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ScriptManager_TSM&amp;compress=1&amp;_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a6b5ccaa5-a290-46bd-afb1-b6039033842c%3aea597d4b%3ab25378d2" type="text/javascript"></script>

<div class="aspNetHidden">

 

<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="CA0B0334" />

<input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" />

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="mRy0AF7z55jDSL07m5zAHI3TJLwKU5M/k1T+5fhNiMJ+PAbGbh9hEyL2pvNBZQAICIzTfSdyqsZ4gZNGZp50BB5S1NPNAxKINq2HNntnKyrk7TxhOWaTLxEZKAAICNK1YRzvIkucPMG/O1fcyZ/qTyeNM/NH4Z/YPA1oXWcvgcGfjMxMR11JfB3/QRlxNJFMsZeyWA==" />

</div><script src="/js/dnn.js?cdv=131" type="text/javascript"></script><script src="/js/dnn.modalpopup.js?cdv=131" type="text/javascript"></script><script src="/Portals/_default/Skins/Xcillion/bootstrap/js/bootstrap.min.js?cdv=131" type="text/javascript"></script><script src="/Portals/_default/Skins/Xcillion/js/jquery.smartmenus.js?cdv=131" type="text/javascript"></script><script src="/Portals/_default/Skins/Xcillion/js/jquery.smartmenus.bootstrap.js?cdv=131" type="text/javascript"></script><script src="/Portals/_default/Skins/Xcillion/js/scripts.js?cdv=131" type="text/javascript"></script><script src="/js/dnncore.js?cdv=131" type="text/javascript"></script><script src="/Resources/Search/SearchSkinObjectPreview.js?cdv=131" type="text/javascript"></script><script src="/js/dnn.servicesframework.js?cdv=131" type="text/javascript"></script><script type="text/javascript">

//<![CDATA[

Sys.WebForms.PageRequestManager._initialize('ScriptManager', 'Form', [], [], [], 90, '');

//]]>

</script>

 

        

        

        

 

<!--[if lt IE 9]>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>

<![endif]-->

 

<div id="siteWrapper">

 

    <!-- UserControlPanel  -->

    <div id="topHeader">

        <div class="container-fluid">

            <div class="row">

                <div class="col-md-6">

                    <div id="search-top" class="pull-right small-screens hidden-sm hidden-md hidden-lg">

                        <span id="dnn_dnnSearch2_ClassicSearch">

    

    

    <span class="searchInputContainer" data-moreresults="See More Results" data-noresult="No Results Found">

        <input name="dnn$dnnSearch2$txtSearch" type="text" maxlength="255" size="20" id="dnn_dnnSearch2_txtSearch" class="NormalTextBox" autocomplete="off" placeholder="Search..." />

        <a class="dnnSearchBoxClearText" title="Clear search text"></a>

    </span>

    <a id="dnn_dnnSearch2_cmdSearch" class="SearchButton" href=" __doPostBack(&#39;dnn$dnnSearch2$cmdSearch&#39;,&#39;&#39;)">Search</a>

</span>

 

 

<script type="text/javascript">

    $(function() {

        if (typeof dnn != "undefined" && typeof dnn.searchSkinObject != "undefined") {

            var searchSkinObject = new dnn.searchSkinObject({

                delayTriggerAutoSearch : 400,

                minCharRequiredTriggerAutoSearch : 2,

                searchType: 'S',

                enableWildSearch: true,

                cultureCode: 'en-US',

                portalId: -1

                }

            );

            searchSkinObject.init();

            

            

            // attach classic search

            var siteBtn = $('#dnn_dnnSearch2_SiteRadioButton');

            var webBtn = $('#dnn_dnnSearch2_WebRadioButton');

            var clickHandler = function() {

                if (siteBtn.is(':checked')) searchSkinObject.settings.searchType = 'S';

                else searchSkinObject.settings.searchType = 'W';

            };

            siteBtn.on('change', clickHandler);

            webBtn.on('change', clickHandler);

            

            

        }

    });

</script>

 

                    </div>

                </div>

            </div>

            <div class="row">

                <div class="col-md-12">

                    <div class="language">

                        <div class="language-object" >

 

 

</div>

                    </div>

                    <div class="search hidden-xs">

                        <span id="dnn_dnnSearch_ClassicSearch">

    

    

    <span class="searchInputContainer" data-moreresults="See More Results" data-noresult="No Results Found">

        <input name="dnn$dnnSearch$txtSearch" type="text" maxlength="255" size="20" id="dnn_dnnSearch_txtSearch" class="NormalTextBox" autocomplete="off" placeholder="Search..." />

        <a class="dnnSearchBoxClearText" title="Clear search text"></a>

    </span>

    <a id="dnn_dnnSearch_cmdSearch" class="SearchButton" href=" __doPostBack(&#39;dnn$dnnSearch$cmdSearch&#39;,&#39;&#39;)">Search</a>

</span>

 

 

<script type="text/javascript">

    $(function() {

        if (typeof dnn != "undefined" && typeof dnn.searchSkinObject != "undefined") {

            var searchSkinObject = new dnn.searchSkinObject({

                delayTriggerAutoSearch : 400,

                minCharRequiredTriggerAutoSearch : 2,

                searchType: 'S',

                enableWildSearch: true,

                cultureCode: 'en-US',

                portalId: -1

                }

            );

            searchSkinObject.init();

            

            

            // attach classic search

            var siteBtn = $('#dnn_dnnSearch_SiteRadioButton');

            var webBtn = $('#dnn_dnnSearch_WebRadioButton');

            var clickHandler = function() {

                if (siteBtn.is(':checked')) searchSkinObject.settings.searchType = 'S';

                else searchSkinObject.settings.searchType = 'W';

            };

            siteBtn.on('change', clickHandler);

            webBtn.on('change', clickHandler);

            

            

        }

    });

</script>

 

                    </div>

                    

                    <a href="#" id="search-action">

                        <img src="/Portals/_default/Skins/Xcillion/images/search-icon.png" alt="Zoeken">

                    </a>

                    <div id="login" class="pull-right">

                        

<div id="dnn_dnnLogin_loginGroup" class="loginGroup">

    <a id="dnn_dnnLogin_enhancedLoginLink" title="Logout" class="LoginLink" rel="nofollow" href="http://localhost/technical/ctl/Logoff">Logout</a>

</div>

                        

<div id="dnn_dnnUser_registerGroup" class="registerGroup">

    <ul class="buttonGroup">

        <li id="dnn_dnnUser_messageGroup" class="userMessages alpha"><a id="dnn_dnnUser_messageLink" title="Check Messages" href="http://localhost/Activity-Feed/Messages/userId/8"><strong> Messages</strong></a></li>

        <li id="dnn_dnnUser_notificationGroup" class="userNotifications omega"><a id="dnn_dnnUser_notificationLink" title="Check Notifications" href="http://localhost/Activity-Feed/Messages/userId/8/view/notifications/action/notifications"><strong> Notifications</strong></a></li>

    <li class="userDisplayName"><a id="dnn_dnnUser_enhancedRegisterLink" title="Visit My Profile" rel="nofollow" href="http://localhost/Activity-Feed/userId/8">Roberto Belmonte</a></li>

        <li id="dnn_dnnUser_avatarGroup" class="userProfileImg"><a id="dnn_dnnUser_avatar" title="Profile Avatar" href="http://localhost/Activity-Feed/userId/8"><img title="Profile Avatar" src="/DnnImageHandler.ashx?mode=profilepic&amp;userId=8&amp;h=32&amp;w=32" alt="" /></a></li>                                       

    </ul>

</div>

                    </div>

                </div>

            </div>

        </div>

    </div>

 

    <!--Header -->

    <header role="banner">

        <div id="mainHeader-inner" class="container-fluid">

            <div class="navbar navbar-default" role="navigation">

                <div id="navbar-top-wrapper">

                    <div id="logo">

                        <span class="brand">

                            <a id="dnn_dnnLOGO_hypLogo" title="EPC Enterprise Portal" href="http://localhost/"><img id="dnn_dnnLOGO_imgLogo" src="/Portals/0/Images/epc_logo%20-%20Copy.png?ver=2016-07-12-093338-903" alt="EPC Enterprise Portal" /></a>

                        </span>

                    </div>

                </div>

                <!-- Brand and toggle get grouped for better mobile display -->

                <div class="navbar-header">

                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">

                        <span class="sr-only">Toggle navigation</span>

                        <span class="icon-bar"></span>

                        <span class="icon-bar"></span>

                        <span class="icon-bar"></span>

                    </button>

                </div>

                <div id="navbar" class="collapse navbar-collapse pull-right">

                    <div id="dnnMenu">

<ul class="nav navbar-nav topLevel">

        <li class="">

        

            <a href="http://localhost/"><span>EPC Enterprise Portal</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/company-wide"><span>Company Wide</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/finance"><span>Finance</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/hr"><span>HR</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/mfg"><span>MFG</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/retail"><span>Retail</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/npd"><span>NPD</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/planning"><span>Planning</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/purchasing"><span>Purchasing</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/stock-control"><span>Stock Control</span> </a>

        

        </li>

    

        <li class="active">

        

            <a href="http://localhost/technical"><span>Technical</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/warehouse-and-distribution"><span>Warehouse &amp; Distribution</span> </a>

        

        </li>

    

        <li class="">

        

            <a href="http://localhost/it"><span>IT</span> </a>

        

        </li>

    

</ul>

</div>

    

                </div>

            </div>

        </div>

    </header>

 

    <!-- Page Content -->

    <div class="container-fluid">

        <main role="main">

            <div class="row dnnpane">

                <div id="dnn_HeaderPane" class="col-md-12 headerPane DNNEmptyPane"></div> 

            </div>

            <div id="breadcrumb" class="col-md-12">

                <span id="dnn_dnnBreadcrumb_lblBreadCrumb" itemprop="breadcrumb" itemscope="" itemtype="https://schema.org/breadcrumb"></span>

            </div>

            <div id="mainContent-inner">

                <div class="row dnnpane">

                    <div id="dnn_ContentPane" class="col-md-12 contentPane"><div class="DnnModule DnnModule-EPCEPTECHNICAL DnnModule-447"><a name="447"></a>

<div class="DNNContainer_noTitle">

<div id="dnn_ctr447_ContentPane"><!-- Start_Module_447 --><div id="dnn_ctr447_ModuleContent" class="DNNModuleContent ModEPCEPTECHNICALC">

</div><!-- End_Module_447 --></div>

<div class="clear"></div>

</div>

</div></div>

                </div>

 

                <div class="row dnnpane">

                    <div id="dnn_P1_75_1" class="col-md-8 leftPane spacingTop DNNEmptyPane"></div>

                    <div id="dnn_P1_25_2" class="col-md-4 rightPane spacingTop DNNEmptyPane"></div>

                </div>

 

                <div class="row dnnpane">

                    <div id="dnn_P2_25_1" class="col-md-4 spacingTop DNNEmptyPane"></div>

                    <div id="dnn_P2_75_2" class="col-md-8 spacingTop DNNEmptyPane"></div>

                </div>

 

                <div class="row dnnpane">

                    <div id="dnn_P3_33_1" class="col-md-4 spacingTop DNNEmptyPane"></div>

                    <div id="dnn_P3_33_2" class="col-md-4 spacingTop DNNEmptyPane"></div>

                    <div id="dnn_P3_33_3" class="col-md-4 spacingTop DNNEmptyPane"></div>

                </div>

 

                <div class="row dnnpane">

                    <div id="dnn_ContentPaneLower" class="col-md-12 contentPane spacingTop DNNEmptyPane"></div>

                </div>

            </div><!-- /.mainContent-inner -->

        </main>

        <!-- /.mainContent -->

    </div>

    <!-- /.container-fluid -->

 

    <!-- Footer -->

    <footer role="contentinfo">

        <div class="footer-above">

            <div class="container-fluid">

                <div class="row dnnpane">

                    <div id="dnn_footer_25_1" class="footer-col col-md-3 col-sm-6 DNNEmptyPane"></div>

                    <div id="dnn_footer_25_2" class="footer-col col-md-3 col-sm-6 DNNEmptyPane"></div>

                    <div class="clearfix visible-sm"></div>

                    <div id="dnn_footer_25_3" class="footer-col col-md-3 col-sm-6 DNNEmptyPane"></div>

                    <div id="dnn_footer_25_4" class="footer-col col-md-3 col-sm-6 DNNEmptyPane"></div>

                </div>

            </div>

        </div>

        <div class="footer-below">

            <div class="container-fluid">

                <div class="row dnnpane">

                    <div class="col-md-12">

                        <div class="copyright">

                            <span id="dnn_dnnCopyright_lblCopyright" class="SkinObject">Copyright 2016 by English Provender Company Ltd. 2016</span>

 

                        </div>

                        <div class="terms-priv">

                            

                            <a id="dnn_dnnTerms_hypTerms" class="SkinObject" rel="nofollow" href="http://localhost/Terms">Terms Of Use</a>

                            |

       <a id="dnn_dnnPrivacy_hypPrivacy" class="SkinObject" rel="nofollow" href="http://localhost/Privacy">Privacy Statement</a>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </footer>

 

</div>

<!-- /.SiteWrapper -->

 

 

<!--CDF(Css|/Portals/_default/Skins/Xcillion/bootstrap/css/bootstrap.min.css?cdv=131)-->

<!--CDF(Css|/Portals/_default/Skins/Xcillion/css/jquery.smartmenus.bootstrap.css?cdv=131)-->

<!--CDF(Css|/Portals/_default/Skins/Xcillion/Menus/MainMenu/MainMenu.css?cdv=131)-->

<!--CDF(Css|/Portals/_default/Skins/Xcillion/skin.css?cdv=131)-->

 

 

<!--CDF(Javascript|/Portals/_default/Skins/Xcillion/bootstrap/js/bootstrap.min.js?cdv=131)-->

<!--CDF(Javascript|/Portals/_default/Skins/Xcillion/js/jquery.smartmenus.js?cdv=131)-->

<!--CDF(Javascript|/Portals/_default/Skins/Xcillion/js/jquery.smartmenus.bootstrap.js?cdv=131)-->

<!--CDF(Javascript|/Portals/_default/Skins/Xcillion/js/scripts.js?cdv=131)-->

 

        <input name="ScrollTop" type="hidden" id="ScrollTop" />

        <input name="__dnnVariable" type="hidden" id="__dnnVariable" autocomplete="off" value="`{`__scdoff`:`1`,`sf_siteRoot`:`/`,`sf_tabId`:`100`}" />

        <input name="__RequestVerificationToken" type="hidden" value="EqYoExGuWMESnWrTRjQQ7Ozx3RzYL5BYlREPC1VVPzXeujaGkPXFgrT2UzHdHg7FPOiLUr1EomhOKDHEFhsxSrStR_81" />

    </form>

    <!--CDF(Javascript|/js/dnncore.js?cdv=131)--><!--CDF(Javascript|/js/dnn.modalpopup.js?cdv=131)--><!--CDF(Css|/Resources/Shared/stylesheets/dnndefault/7.0.0/default.css?cdv=131)--><!--CDF(Css|/Portals/_default/Skins/Xcillion/skin.css?cdv=131)--><!--CDF(Css|/DesktopModules/MVC/EPCEPTECHNICAL/module.css?cdv=131)--><!--CDF(Css|/Portals/0/portal.css?cdv=131)--><!--CDF(Css|/Resources/Search/SearchSkinObjectPreview.css?cdv=131)--><!--CDF(Javascript|/Resources/Search/SearchSkinObjectPreview.js?cdv=131)--><!--CDF(Css|/Resources/Search/SearchSkinObjectPreview.css?cdv=131)--><!--CDF(Javascript|/Resources/Search/SearchSkinObjectPreview.js?cdv=131)--><!--CDF(Javascript|/js/dnn.js?cdv=131)--><!--CDF(Javascript|/js/dnn.servicesframework.js?cdv=131)--><!--CDF(Javascript|/Resources/libraries/jQuery/01_09_01/jquery.js?cdv=131)--><!--CDF(Javascript|/Resources/libraries/jQuery-UI/01_11_03/jquery-ui.js?cdv=131)-->

    

</body>

</html>

____________________________________________________________________________________________________________________________________________________________________________________________________________

 

What is wrong ?

 

Thank you.

 

Best Regards,

Roberto

 
New Post
9/1/2016 6:10 AM
 

Hello guys,

 

Anyone can advice me how export html table in excel from DNN module that works fine ?

 

Thank you very much.

 

Kind Regards,

Roberto

 
New Post
9/1/2016 10:46 AM
 

Roberto,

to create Excel files I use the Simple OOXml library, which is a great tool: http://simpleooxml.codeplex.com/

Happy DNNing!
Michael


Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
New Post
9/2/2016 12:17 PM
 

Thank you very much Michael, I managed to create the excel file, but I could not send it correctly to the browser for download from a DNN module, because the downloaded file contains  hml the code of the page. You can give me a working example of a DNN module that returns an excel file?

Thank you very much.

Kind Regards,

Roberto

 
New Post
9/5/2016 6:54 AM
 
Roberto,

a bit old but this should work: http://helferleinform.codeplex.com

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

dnn-Connect.org - The most vibrant community around the DNN-platform
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesExport data in Excel file from MVC module.Export data in Excel file from MVC module.


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out