songxianbin_xxx 发表于 2017-5-19 16:23:35

activereport的预览功能 能支持直接编辑打印嘛,导出文件的自定义名称

activereport的预览功能能支持直接编辑打印嘛。导出文件的自定义名称。

大神求解 很急 谢谢!!!!

Lenka.Guo 发表于 2017-5-19 17:44:40

ActiveReports 预览报表时无法进行编辑,在Web 端打印是要通过调用浏览器的打印页面。

导出文件自定义名称,如果您用的是HTML5Viewer,可参考附件:

songxianbin_xxx 发表于 2017-5-23 17:08:27

Lenka.Guo 发表于 2017-5-19 17:44
ActiveReports 预览报表时无法进行编辑,在Web 端打印是要通过调用浏览器的打印页面。

导出文件自定义名 ...

那打印的次数是否能记录,就是打印的的时候能否执行我们的js

Lenka.Guo 发表于 2017-5-23 18:17:24

打印的次数这些都需要您来编写业务逻辑,AR本身没有这方面的功能。

songxianbin_xxx 发表于 2017-5-23 19:35:24

Lenka.Guo 发表于 2017-5-23 18:17
打印的次数这些都需要您来编写业务逻辑,AR本身没有这方面的功能。

请问有java服务器导出文件到服务器的例子嘛

Lenka.Guo 发表于 2017-5-24 10:33:07

AR主要是.net 平台,所有的运行和部署都依赖与.net 环境,如果您使用Java平台的话,也需要将报表web部署到IIS 服务器上,然后再在Java中调用。

导出到服务器就是常用的代码:// Provide the page report you want to render.
GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);

// Create an output directory.
System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyExcel");
outputDirectory.Create();

// Provide settings for your rendering output.
GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings();
excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xls;
GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = excelSetting;

// Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));

// Overwrite output file if it already exists.
outputProvider.OverwriteOutputFile = true;

reportDocument.Render(excelRenderingExtension, outputProvider, excelSetting.GetSettings());


导出PDF
// Provide the page report you want to render.
System.IO.FileInfo rptPath = new System.IO.FileInfo(@"..\..\PageReport1.rdlx");
GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(rptPath);

// Create an output directory.
System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyPDF");
outputDirectory.Create();

// Provide settings for your rendering output.
GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();

// Reduce the report size and report generation time.
pdfSetting.OptimizeStatic = true;

// Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));

// Overwrite output file if it already exists
outputProvider.OverwriteOutputFile = true;

pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);

导出Word
// Provide the page report you want to render.
GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();
GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);

// Create an output directory.
System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyWord");
outputDirectory.Create();

// Provide settings for your rendering output.
GrapeCity.ActiveReports.Export.Word.Page.Settings wordSetting = new GrapeCity.ActiveReports.Export.Word.Page.Settings();

// Set the FileFormat property to .OOXML.
wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML;

// Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension wordRenderingExtension = new GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));

// Overwrite output file if it already exists.
outputProvider.OverwriteOutputFile = true;

reportDocument.Render(wordRenderingExtension, outputProvider, wordSetting);         

songxianbin_xxx 发表于 2017-5-24 11:10:25

Lenka.Guo 发表于 2017-5-24 10:33
AR主要是.net 平台,所有的运行和部署都依赖与.net 环境,如果您使用Java平台的话,也需要将报表web部署到I ...

我已经在IIS服务上部署了服务,然后在我的JAVA后台进行调用导出,我看你的代理里面 没有获取IIS上的rdlx文件的啊只有pdf中有这个System.IO.FileInfo rptPath = new System.IO.FileInfo(@"..\..\PageReport1.rdlx");

songxianbin_xxx 发表于 2017-5-24 11:10:29

Lenka.Guo 发表于 2017-5-24 10:33
AR主要是.net 平台,所有的运行和部署都依赖与.net 环境,如果您使用Java平台的话,也需要将报表web部署到I ...

我已经在IIS服务上部署了服务,然后在我的JAVA后台进行调用导出,我看你的代理里面 没有获取IIS上的rdlx文件的啊只有pdf中有这个System.IO.FileInfo rptPath = new System.IO.FileInfo(@"..\..\PageReport1.rdlx");

Lenka.Guo 发表于 2017-5-24 11:21:23

获取报表路径下面这一行代码都是,生成要导出的报表文件。

songxianbin_xxx 发表于 2017-6-12 21:13:55

您好,包含这些GrapeCity 相关类的jar包哪里可以下载呢
页: [1] 2
查看完整版本: activereport的预览功能 能支持直接编辑打印嘛,导出文件的自定义名称