网站首页 > 精选文章 正文
1.怎么输出渲染后的报表?
举个例子,将报表输出为PDF:
C#
StiReport report = new StiReport; report.Load("report.mrt"); report.Render; report.ExportDocument(StiExportFormat.Pdf, "document.pdf");
VB
Dim Report As StiReport = New StiReport Report.Load("report.mrt") Report.Render Report.ExportDocument(StiPdfExportFormat.Pdf, "document.pdf")
2.怎么在不使用对话框的情况下输出报表?
按照下面的方法在不使用对话框的情况下就可以输出报表:
C#
StiReport report = new StiReport; report.Load("report.mrt"); report.Render; //Variant 1 StiPdfExportService pdfExport = new StiPdfExportService; pdfExport.ExportPdf(report, "document.pdf"); //Variant 2 report.ExportDocument(StiExportFormat.Pdf, "document.pdf");
VB
Dim Report As StiReport = New StiReport Report.Load("report.mrt") Report.Render 'Variant 1 Dim PdfExport As StiPdfExportService = New StiPdfExportService PdfExport.ExportPdf(Report, "document.pdf") 'Variant 2 report.ExportDocument(StiExportFormat.Pdf, "document.pdf")
在这个例子中,报表被输出为PDF格式。你也可以使用下面的类将报表输出为其它可用的格式:
- StiCsvExportService——输出为Csv
- StiExcelExportService——输出为Excel
- StiExcelXmlExportService——输出为ExcelXml
- StiExcel2007ExportService——输出为Excel 2007
- StiHtmlExportService——输出为Html
- StiImageExportService——输出为Images
- StiPdfExportService——输出为Pdf
- StiRtfExportService——输出为Rtf
- StiTxtExportService——输出为Txt
- StiXmlExportService——输出为Xml
- ......
3.怎么在预览窗口去掉所有不需要的输出格式?
你需要禁用所有不需要的报表输出组件,同样你也得使用Configurator.exe应用程序禁用服务。
StiConfig.Load; StiServiceContainer services = StiConfig.Services.GetServices(typeof(StiExportService)); foreach (StiService service in services) { if (service is StiBmpExportService)service.ServiceEnabled = false; if (service is StiCsvExportService)service.ServiceEnabled = false; if (service is StiEmfExportService)service.ServiceEnabled = false; if (service is StiGifExportService)service.ServiceEnabled = false; if (service is StiHtmlExportService)service.ServiceEnabled = false; if (service is StiJpegExportService)service.ServiceEnabled = false; if (service is StiPdfExportService)service.ServiceEnabled = false; if (service is StiRtfExportService)service.ServiceEnabled = false; if (service is StiTiffExportService)service.ServiceEnabled = false; if (service is StiTxtExportService)service.ServiceEnabled = false; if (service is StiXmlExportService)service.ServiceEnabled = false; } StiConfig.Save;
4.怎么将报表页面输出为指定大小的位图?
使用StiPage的GetThumbnail方法:
C#
Bitmap bmp = page.GetThumbnail(200, 300);
VB
Dim Bmp As Bitmap = Page.GetThumbnail(200, 300)
5.为什么当报表输出为HTML时,不是所有的交叉组件都被输出?
导出为HTML可以在两种模式下工作:Table和Span。在Table模式中Stimulsoft Reports.Net生成一张大表,并将组件从页面写入到表行中。但在这种模式下页面上的组件将不被交叉。在Span模式中报表引擎为每个组件生成横跨对象。在这种情况下组件就会在页面上交叉。
6.ExcelValue属性
ExcelValue属性是用于将数值输出为Excel。默认情况下StiText组件被输出为Excel的文本格式。 StiText组件的ExcelValue属性的表达式将被输出到Excel单元格,并且格式为数字。
购买最新正版授权!"咨询在线客服"
慧都年终盛典火爆开启,一年仅一次的最强促销,破冰钜惠不容错过!!
本站文章除注明转载外,均为本站原创或翻译
猜你喜欢
- 2025-06-04 Excel制作自定义日历控件,功能实用,实在有用了
- 2025-06-04 VBA基本语法之逻辑运算符、通配符,有什么作用,它们该怎么使用
- 2025-06-04 用VB.NET做关于窗口(用vbs写一个窗口)
- 2025-06-04 ExcelVBA函数:将单元格区域转换为【表】,并格式化为特定主题
- 2025-06-04 超实用!手把手教你制作Excel日程提醒
- 2025-06-04 VB编程(八)常量和变量(vb中的常量有哪几种类型)
- 2025-06-04 VBA日期函数 -> DateDiff计算时间差
- 2025-06-04 基于对象的Excel VBA的分层对象集合及外部对象库
- 2025-06-04 初中生也能学的编程,不走弯路,先用后学
- 2025-06-04 数据库中的数据如何进行批量修改(数据库批量替换)
- 最近发表
- 标签列表
-
- 向日葵无法连接服务器 (32)
- git.exe (33)
- vscode更新 (34)
- dev c (33)
- git ignore命令 (32)
- gitlab提交代码步骤 (37)
- java update (36)
- vue debug (34)
- vue blur (32)
- vscode导入vue项目 (33)
- vue chart (32)
- vue cms (32)
- 大雅数据库 (34)
- 技术迭代 (37)
- 同一局域网 (33)
- github拒绝连接 (33)
- vscode php插件 (32)
- vue注释快捷键 (32)
- linux ssr (33)
- 微端服务器 (35)
- 导航猫 (32)
- 获取当前时间年月日 (33)
- stp软件 (33)
- http下载文件 (33)
- linux bt下载 (33)