我在这里有代码示例,我可以直接保存为PDF文件,但我想要做的是显示客户端的第一个pdf文件,并允许用户保存它.我该如何实现这一目标?
ReportDocument rpt = new ReportDocument();
rpt.Load(@"C:\CrystalReport2.rpt");
rpt.SetDataSource(datatablesource);
ExportOptions rptExportOption;
DiskFileDestinationOptions rptFileDestOption = new DiskFileDestinationOptions();
PdfRtfWordFormatOptions rptFormatOption = new PdfRtfWordFormatOptions();
string reportFileName = @"C:\SampleReport.pdf";
rptFileDestOption.DiskFileName = reportFileName;
rptExportOption = rpt.ExportOptions;
{
rptExportOption.ExportDestinationType = ExportDestinationType.DiskFile;
//if we want to generate the report as PDF, change the ExportFormatType as "ExportFormatType.PortableDocFormat"
//if we want to generate the report as Excel, change the ExportFormatType as "ExportFormatType.Excel"
rptExportOption.ExportFormatType = ExportFormatType.PortableDocFormat;
rptExportOption.ExportDestinationOptions = rptFileDestOption;
rptExportOption.ExportFormatOptions = rptFormatOption;
}
rpt.Export();
Run Code Online (Sandbox Code Playgroud) 在Dart中,我试图在div元素中动态添加HTML.
注意:mainContainer元素只是我的HTML代码中的div
import 'dart:html';
main()
{
loadHTML("web/html/test.html");
}
void loadHTML(String fileName)
{
DivElement div = query("#mainContainer");
div.children.clear();
HttpRequest.getString(fileName).then((resp) {
div.appendHtml(resp);
});
}
Run Code Online (Sandbox Code Playgroud)
这是test.html仅用于测试目的
<h1 id="test">test</h1>
Run Code Online (Sandbox Code Playgroud)
问题是,当我想查询#test时,它找不到任何东西
...
main()
{
loadHTML("web/html/test.html");
Element elem = query("#test");
if (elem == null)
{
print("element is null");
}
}
...
Run Code Online (Sandbox Code Playgroud)
是因为HTML没有加载到文档中吗?我不确定这里发生了什么.实际的HTML显示在浏览器中,但无法找到测试.
使用Dart SDK版本0.5.5.0_r22416
我试图从文件名中获取日期,所以我构建了这个reg ex表达式,但我得到了136413而不是6413,我怎么能告诉这个脚本跳过与FY13相关的数字相关的数字.所以我的最终结果应该像642013而不是13642013.
提前致谢.
string input = "X_X_FY13_Template_X_6 4 13_V2.xlsx";
string result = Regex.Replace(input, @"[^\d]", "");
MessageBox.Show(result);
Run Code Online (Sandbox Code Playgroud) 在C#或VB中,如何将listview项集合添加到列表中但不使用循环迭代它?
原因是我想要改进这个:
For Each Item As ListViewItem In ListView.Items
List.Add(Item)
Next
Run Code Online (Sandbox Code Playgroud)
对于像这样的事情:
List.AddRange(DirectCast(ListView.Items, ...))
Run Code Online (Sandbox Code Playgroud)