找回密码
 立即注册

QQ登录

只需一步,快速开始

jszxzym

论坛元老

8

主题

33

帖子

7056

积分

论坛元老

积分
7056

活字格认证

jszxzym
论坛元老   /  发表于:2013-7-15 09:41  /   查看:7028  /  回复:7

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

7 个回复

倒序浏览
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-7-15 10:18:00
沙发
jszxzym 你好

从以上错误提示来看是因为Visual Studio版本的问题,ActiveReports V7 本身是支持 VS2008开发环境,但是这个演示程序 ActiveReports报表功能展示-ASP.NET  是使用VS2010开发的,所以运行该程序需要VS2010或VS2012版本。
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-7-16 09:51:00
板凳
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-7-17 09:33:00
地板
回复 1楼jszxzym的帖子

动态数据源绑定方法,绑定集合对象数据源的博客文章,请参考:ActiveReports 报表控件动态绑定数据源之集合对象数据源
回复 使用道具 举报
jszxzym
论坛元老   /  发表于:2013-7-17 10:36:00
5#
关于demo运行时的问题




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-7-17 11:31:00
6#
回复 5楼jszxzym的帖子

您需要修改 Data 目录下 NWind_CHS_Access.rdsx 文件的路径,修改为您源代码放置的位置:

  1. <RptDataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  2.   <Name>NWind_CHS</Name>
  3.   <ConnectionProperties>
  4.     <ConnectString>provider=Microsoft.Jet.OLEDB.4.0;data source=D:\ActiveReports 7 Demo\ActiveReports for ASP.ENT\Data\NWind_CHS.mdb;</ConnectString>
  5.     <!--<ConnectString>provider=Microsoft.Jet.OLEDB.4.0;data source=C:\AR\Data\NWind_CHS.mdb;</ConnectString>-->
  6.     <Extension>OLEDB</Extension>
  7.   </ConnectionProperties>
  8. </RptDataSource>
复制代码
回复 使用道具 举报
jszxzym
论坛元老   /  发表于:2013-7-17 15:55:00
7#
回复 6楼dof的帖子

在更改路径之后依然抱同样的问题,已确认绝对路径一致
回复 使用道具 举报
ZenosZeng讲师达人认证 悬赏达人认证
超级版主   /  发表于:2013-7-17 16:21:00
8#
请用以下代码覆盖 Export.aspx.cs 文件中的代码:
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Text;

  8. namespace ControlExplorer.Viewers
  9. {
  10.     public partial class Export : System.Web.UI.Page
  11.     {
  12.         protected void Page_Load(object sender, EventArgs e)
  13.         {
  14.             if (!IsPostBack)
  15.             {
  16.                 System.Xml.Linq.XElement xEle;

  17.                 if (Cache[&quot;ControlList&quot;] == null)
  18.                 {
  19.                     xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  20.                     Cache[&quot;ControlList&quot;] = xEle;
  21.                 }
  22.                 else
  23.                 {
  24.                     xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  25.                 }

  26.                 string categoryid = Request.QueryString[&quot;category&quot;];
  27.                 string actionid = Request.QueryString[&quot;action&quot;];
  28.                 string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;
  29.                 string viewtype = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;viewtype&quot;).Value;

  30.                 switch (viewtype.ToLower())
  31.                 {
  32.                     case &quot;htmlviewer&quot;:
  33.                         this.WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.HtmlViewer;
  34.                         this.WebViewer1.HtmlExportOptions.IncludePageMargins = true;
  35.                         break;
  36.                     case &quot;rawhtml&quot;:
  37.                         this.WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.RawHtml;
  38.                         break;
  39.                     case &quot;acrobatreader&quot;:
  40.                         this.WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.AcrobatReader;
  41.                         break;
  42.                     case &quot;flashviewer&quot;:
  43.                         this.WebViewer1.FlashViewerOptions.ResourceLocale = &quot;zh_CN&quot;;
  44.                         this.WebViewer1.ViewerType = GrapeCity.ActiveReports.Web.ViewerType.FlashViewer;
  45.                         break;
  46.                     default:
  47.                         break;
  48.                 }

  49.                 LoadReport(report);

  50.                 C1Dialog1.ContentUrl = string.Format(&quot;ImageExportSetting.aspx?category={0}&amp;action={1}&quot;, categoryid, actionid);
  51.             }
  52.         }

  53.         protected override void OnInit(EventArgs e)
  54.         {
  55.             System.Xml.Linq.XElement xEle;

  56.             if (Cache[&quot;ControlList&quot;] == null)
  57.             {
  58.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  59.                 Cache[&quot;ControlList&quot;] = xEle;
  60.             }
  61.             else
  62.             {
  63.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  64.             }

  65.             string categoryid = Request.QueryString[&quot;category&quot;];
  66.             string actionid = Request.QueryString[&quot;action&quot;];

  67.             string height = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;height&quot;).Value;

  68.             this.WebViewer1.Height = Unit.Pixel(Convert.ToInt32(height));

  69.             base.OnInit(e);
  70.         }

  71.         private void LoadReport(string report)
  72.         {
  73.             switch (report)
  74.             {
  75.                 case &quot;rptInvoice&quot;:
  76.                     GrapeCity.ActiveReports.PageReport report1 = null;
  77.                     report1 = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../Reports/&quot; + report + &quot;.rdlx&quot;)));
  78.                     report1.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  79.                     report1.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  80.                     report1.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));
  81.                     WebViewer1.Report = report1;
  82.                     break;
  83.                 default:
  84.                     break;
  85.             }
  86.         }

  87.         protected void btnExcel_Click(object sender, EventArgs e)
  88.         {
  89.             System.Xml.Linq.XElement xEle;

  90.             if (Cache[&quot;ControlList&quot;] == null)
  91.             {
  92.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  93.                 Cache[&quot;ControlList&quot;] = xEle;
  94.             }
  95.             else
  96.             {
  97.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  98.             }

  99.             string categoryid = Request.QueryString[&quot;category&quot;];
  100.             string actionid = Request.QueryString[&quot;action&quot;];
  101.             string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;

  102.             GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../&quot;) + &quot;Reports/&quot; + report + &quot;.rdlx&quot;));
  103.             _reportDef.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  104.             _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  105.             _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));

  106.             GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);

  107.             GrapeCity.ActiveReports.Export.Excel.Section.XlsExport XlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport();

  108.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  109.             XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx;
  110.             XlsExport1.Export(_reportRuntime, ms);

  111.             Response.ContentType = &quot;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet&quot;;
  112.             Response.AddHeader(&quot;content-disposition&quot;, Server.UrlPathEncode(&quot;attachment;filename=客户订单.xlsx&quot;));
  113.             Response.BinaryWrite(ms.ToArray());
  114.             Response.End();
  115.         }

  116.         protected void btnWord_Click(object sender, EventArgs e)
  117.         {
  118.             System.Xml.Linq.XElement xEle;

  119.             if (Cache[&quot;ControlList&quot;] == null)
  120.             {
  121.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  122.                 Cache[&quot;ControlList&quot;] = xEle;
  123.             }
  124.             else
  125.             {
  126.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  127.             }

  128.             string categoryid = Request.QueryString[&quot;category&quot;];
  129.             string actionid = Request.QueryString[&quot;action&quot;];
  130.             string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;

  131.             GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../&quot;) + &quot;Reports/&quot; + report + &quot;.rdlx&quot;));
  132.             _reportDef.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  133.             _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  134.             _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));

  135.             GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);

  136.             GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension _renderingExtension = new GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension();
  137.             GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider _provider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
  138.             GrapeCity.ActiveReports.Export.Word.Page.Settings s = new GrapeCity.ActiveReports.Export.Word.Page.Settings();
  139.             s.UseMhtOutput = true;

  140.             _reportRuntime.Render(_renderingExtension, _provider, s);

  141.             Response.ContentType = &quot;application/msword&quot;;
  142.             Response.AddHeader(&quot;content-disposition&quot;, Server.UrlPathEncode(&quot;attachment;filename=客户订单.doc&quot;));
  143.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  144.             _provider.GetPrimaryStream().OpenStream().CopyTo(ms);
  145.             Response.BinaryWrite(ms.ToArray());
  146.             Response.End();
  147.         }

  148.         protected void btnPdf_Click(object sender, EventArgs e)
  149.         {
  150.             System.Xml.Linq.XElement xEle;

  151.             if (Cache[&quot;ControlList&quot;] == null)
  152.             {
  153.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  154.                 Cache[&quot;ControlList&quot;] = xEle;
  155.             }
  156.             else
  157.             {
  158.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  159.             }

  160.             string categoryid = Request.QueryString[&quot;category&quot;];
  161.             string actionid = Request.QueryString[&quot;action&quot;];
  162.             string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;

  163.             GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../&quot;) + &quot;Reports/&quot; + report + &quot;.rdlx&quot;));
  164.             _reportDef.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  165.             _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  166.             _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));

  167.             GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);

  168.             GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension _renderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
  169.             GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider _provider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
  170.             _reportRuntime.Render(_renderingExtension, _provider);

  171.             Response.ContentType = &quot;application/pdf&quot;;
  172.             Response.AddHeader(&quot;content-disposition&quot;, Server.UrlPathEncode(&quot;attachment;filename=客户订单.pdf&quot;));
  173.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  174.             _provider.GetPrimaryStream().OpenStream().CopyTo(ms);
  175.             Response.BinaryWrite(ms.ToArray());
  176.             Response.End();
  177.         }

  178.         protected void btnHtml_Click(object sender, EventArgs e)
  179.         {
  180.             System.Xml.Linq.XElement xEle;

  181.             if (Cache[&quot;ControlList&quot;] == null)
  182.             {
  183.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  184.                 Cache[&quot;ControlList&quot;] = xEle;
  185.             }
  186.             else
  187.             {
  188.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  189.             }

  190.             string categoryid = Request.QueryString[&quot;category&quot;];
  191.             string actionid = Request.QueryString[&quot;action&quot;];
  192.             string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;

  193.             GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../&quot;) + &quot;Reports/&quot; + report + &quot;.rdlx&quot;));
  194.             _reportDef.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  195.             _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  196.             _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));

  197.             GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);

  198.             GrapeCity.ActiveReports.Export.Html.Page.HtmlRenderingExtension _renderingExtension = new GrapeCity.ActiveReports.Export.Html.Page.HtmlRenderingExtension();
  199.             GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider _provider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
  200.             GrapeCity.ActiveReports.Export.Html.Page.Settings s = new GrapeCity.ActiveReports.Export.Html.Page.Settings();
  201.             s.StyleStream = false;
  202.             s.MhtOutput = false;
  203.             s.Fragment = false;
  204.             s.OutputTOC = true;
  205.             s.Mode = GrapeCity.ActiveReports.Export.Html.Page.RenderMode.Paginated;
  206.             _reportRuntime.Render(_renderingExtension, _provider, s);

  207.             Response.ContentType = &quot;text/html&quot;;
  208.             Response.AddHeader(&quot;content-disposition&quot;, Server.UrlPathEncode(&quot;attachment;filename=客户订单.html&quot;));
  209.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  210.             _provider.GetPrimaryStream().OpenStream().CopyTo(ms);
  211.             Response.BinaryWrite(ms.ToArray());
  212.             Response.End();
  213.         }

  214.         protected void btnText_Click(object sender, EventArgs e)
  215.         {
  216.             System.Xml.Linq.XElement xEle;

  217.             if (Cache[&quot;ControlList&quot;] == null)
  218.             {
  219.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  220.                 Cache[&quot;ControlList&quot;] = xEle;
  221.             }
  222.             else
  223.             {
  224.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  225.             }

  226.             string categoryid = Request.QueryString[&quot;category&quot;];
  227.             string actionid = Request.QueryString[&quot;action&quot;];
  228.             string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;

  229.             GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../&quot;) + &quot;Reports/&quot; + report + &quot;.rdlx&quot;));
  230.             _reportDef.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  231.             _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  232.             _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));

  233.             GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);

  234.             GrapeCity.ActiveReports.Export.Xml.Section.TextExport txtExport1 = new GrapeCity.ActiveReports.Export.Xml.Section.TextExport();
  235.             txtExport1.Encoding = Encoding.Unicode;

  236.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  237.             txtExport1.Export(_reportRuntime, ms);

  238.             Response.ContentType = &quot;text/plain&quot;;
  239.             Response.AddHeader(&quot;content-disposition&quot;, Server.UrlPathEncode(&quot;attachment;filename=客户订单.txt&quot;));
  240.             Response.BinaryWrite(ms.ToArray());
  241.             Response.End();
  242.         }

  243.         protected void btnCSV_Click(object sender, EventArgs e)
  244.         {
  245.             System.Xml.Linq.XElement xEle;

  246.             if (Cache[&quot;ControlList&quot;] == null)
  247.             {
  248.                 xEle = System.Xml.Linq.XElement.Load(Server.MapPath(&quot;~/ControlList.xml&quot;));
  249.                 Cache[&quot;ControlList&quot;] = xEle;
  250.             }
  251.             else
  252.             {
  253.                 xEle = (System.Xml.Linq.XElement)Cache[&quot;ControlList&quot;];
  254.             }

  255.             string categoryid = Request.QueryString[&quot;category&quot;];
  256.             string actionid = Request.QueryString[&quot;action&quot;];
  257.             string report = xEle.Elements(&quot;Control&quot;).Where(c =&gt; c.Attribute(&quot;id&quot;).Value == categoryid).First().Elements(&quot;action&quot;).Where(a =&gt; a.Attribute(&quot;id&quot;).Value == actionid).First().Attribute(&quot;report&quot;).Value;

  258.             GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath(&quot;../&quot;) + &quot;Reports/&quot; + report + &quot;.rdlx&quot;));
  259.             _reportDef.Report.DataSources[0].DataSourceReference = &quot;&quot;;
  260.             _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = &quot;OLEDB&quot;;
  261.             _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format(&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};&quot;, Server.MapPath(&quot;../Data/NWind_CHS.mdb&quot;));

  262.             GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);

  263.             GrapeCity.ActiveReports.Export.Xml.Section.TextExport csvExport1 = new GrapeCity.ActiveReports.Export.Xml.Section.TextExport();
  264.             csvExport1.Encoding = Encoding.Unicode;
  265.             csvExport1.TextDelimiter = &quot;\t&quot;;
  266.             csvExport1.SuppressEmptyLines = true;

  267.             System.IO.MemoryStream ms = new System.IO.MemoryStream();
  268.             csvExport1.Export(_reportRuntime, ms);

  269.             Response.ContentType = &quot;text/plain&quot;;
  270.             Response.AddHeader(&quot;content-disposition&quot;, Server.UrlPathEncode(&quot;attachment;filename=客户订单.csv&quot;));
  271.             Response.BinaryWrite(ms.ToArray());
  272.             Response.End();
  273.         }

  274.         protected void btnImage_Click(object sender, EventArgs e)
  275.         {

  276.         }
  277.     }
  278. }
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部