我现在就是新建个报表,里边直接连msql8就报错,提示找不到驱动;
我现在web服务代码如下
public class ReportWebService : GrapeCity.ActiveReports.Web.ReportService
{
PageReport pageReport;
PageDocument _pageDocument;
string domainName;
[WebMethod]
protected override object OnCreateReportHandler(string reportPath)
{
try
{
if (AppTools.Tools.CheckValue(reportPath))
{
//domainName = HttpContext.Current.Request.Url.Host.Replace(".ar","");
var pname = reportPath;
pageReport = (PageReport)base.OnCreateReportHandler("report/" + pname + ".rdlx");
pageReport.Report.Name = pname;
_pageDocument = new PageDocument(pageReport);
pageReport.Report.DataSources[0].ConnectionProperties.ConnectString = "Driver={MySQL ODBC 8.0.17 UNICODE Driver};Server=192.168.1.1ort=3306;Database=db;User=rootassword=123456;Option=3;";
//pageReport.Document.LocateDataSource += Document_LocateDataSource;
return pageReport;
}
else
{
return null;
}
}
catch (Exception e)
{
AppTools.LogServer.WriteTextLog(AppTools.LogType.Error, "ReportWebService.asmx-OnCreateReportHandler", e.Message, DateTime.Now);
return null;
}
} |