本文将介绍在MonoDevelop中创建Web应用程序并在其中使用在线设计器的方法。除了online designer这样的按钮,如下载报表给designer并将报表保存到本地计算机将位于页面上 让我们创建一个ASP .Net MVC项目:
我们需要在References中为项目添加库: FastReport Mono,FastReport.Web,System.Net.Http。解压缩归档文件并将WebReportDesigner文件夹添加到项目根目录。
我们还需要一个文件夹,我们将在其中保存报表,存储包含数据的文件。将App_Data文件夹添加到项目根目录。我们将使用FastReport.Mono交付的演示报表,因此我们需要nwind.xml数据库。将其添加到App_Data文件夹。
现在可以开始编程了。在Controller文件夹中是HomeController.cs文件,在使用部分,我们需要库:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.UI;
using System.Text;
using System.IO;
using FastReport;
using FastReport.Web;
using FastReport.Utils;
using System.Web.UI.WebControls;
using FastReport.Export.Html;
using FastReport.Data;
using System.Net.Http.Headers;
using FastReport.Export.Image;
using System.Net.Http;
Web方法索引:
private WebReport webReport = new WebReport(); // Web report object
public ActionResult Index()
{
webReport.Width = Unit.Percentage(100);
webRep