小编com*_*171的帖子

使用水晶报告导出为pdf文件

我在这里有代码示例,我可以直接保存为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)

c# asp.net crystal-reports

4
推荐指数
2
解决办法
4万
查看次数

无法查询动态添加的元素

在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

dart dart-html

2
推荐指数
1
解决办法
125
查看次数

从文件名中获取Numbers

我试图从文件名中获取日期,所以我构建了这个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# regex ssis

2
推荐指数
1
解决办法
1243
查看次数

Listview项目列表(Of string)

在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)

.net c# vb.net listview casting

1
推荐指数
1
解决办法
1990
查看次数

标签 统计

c# ×3

.net ×1

asp.net ×1

casting ×1

crystal-reports ×1

dart ×1

dart-html ×1

listview ×1

regex ×1

ssis ×1

vb.net ×1