ISaveAs 保存Grid格式数据

IDataset SaveAs (string Name,IWorkspace Workspace,string Format);

本人亲测经验:保存的路径中不要有中文字符,grid格式遇到中文字符就一个字坑坑坑,之前用给grid格式的数据修改投影也是因为中文字的问题修改失败。

1.参数Name注意事项

1)字符数不能超过13个 

2)可以包含a-z  ,A-Z ,0-9  ,“-”“_”.  (这个都是一样)

3)必须以字母开头

2.传一个输出路径的工作空间即可 (RasterWorkspace)

3.Fromat:

The format strings used for the supported formats are below, and they are case sensitive:

Format NameString Used
Imagine"IMAGINE Image"
TIFF"TIFF"
GRID"GRID"
JPEG"JPG"
JP2000"JP2"
BMP"BMP"
PNG"PNG"
GIF"GIF"
PCI Raster"PIX"
X11 Pixmap"XPM"
PCRaster"MAP"
Memory Raster"MEM"
HDF4"HDF4"
BIL"BIL"
BIP"BIP"
BSQ"BSQ"
Idrisi Raster Format"RST"
ENVI Raster Format"ENVI"
Geodatabase Raster"GDB"
  

Note, SaveAs will return a RasterDataset, to prevent from ISaveAs holding the output, .NET ReleaseCOMObject needs to be called to release the referene to the output raster dataset:

    System.Runtime.InteropServices.Marshal.ReleaseComObject(outRasterDS);

帮助的意思通俗的讲就是:拉完屎记得擦屁股(记得释放掉你生成的Dataset)



在iTextSharp上做了个二次开发,导出PDF更方便,iTextExport.dll是自己做的二次开发库,里面主要有三个类:PdfExport、ExcelExport、ReportPrint,它们分别实现导出Pdf、导出Excel和rdlc报表的直接打印和预览,基本调用方法: 1、PdfExport exp = new PdfExport(fileName, DataTable | DataGridView); exp.ExportTitle = "标题"; exp.[其它属性设置]=; exp.ExecuteExport(); 2、Excel和Pdf类似调用 3、如果要一次导出多个,可以如下: ExportFactory.Instance().ExportList.Add(exp); ExportFactory.Instance().ExportList.Add(exp); ExportFactory.Instance().ExportList.Add(exp); ....... ExportFactory.Instance().DoExport(); 4、多数据源报表打印 ReportPrint rpt = new ReportPrint("报表文件或者嵌入的报表资源名"); //是否是嵌入报表 rpt.IsEmbeddedReport = true; //是否自动调整数据源,对于打印的数据表和报表定义中的字段不同时 rpt.AutoAdjustData = false; //是否报表中含有多个数据源 rpt.IsMultiDataSource = true; rpt.ReportDataSources.Add(new ReportDataSource("T1",dt1)); rpt.ReportDataSources.Add(new ReportDataSource("T2", dt2)); rpt.StartPrint(); rpt.Dispose(); 5、单数据源报表打印 //报表参数 List _paras = new List(); _paras.Add(new ReportParameter("rptLsh", "A1")); _paras.Add(new ReportParameter("rptDjh", "A2")); ReportPrint rpt = new ReportPrint("Test.rdlc", dt); rpt.IsEmbeddedReport = false; rpt.AutoAdjustData = false; rpt.ReportParameters = _paras; rpt.StartPrint();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值