I have a question regarding the possibility of Binding Un-type dataset to Un-type rpt file.I have seen some people's code on internet,it seems can be done,but it does not work out at my code,
can you give me any guidance on this subject?I have configured "RptDis1.rpt" with data fields, and open it with ReportDocument object, nevertheless after i use ReportDocument.SetDatasouce method to bound a un-typed dataset to the ReportDocument,neither the reportviewer nor export pdf show any record or data in it. Do you have the same problem before like this?
public void exportPdf(System.Data.DataSet ds)
{
private string _localCrLocation = @"C:\RptDis1.rpt" 
ReportDocument oRD = new ReportDocument(); 
ExportOptions oExo = new ExportOptions(); 
DiskFileDestinationOptions oExDo = new DiskFileDestinationOptions(); oRD.Load(_localCrLocation); 
oRD.SetDataSource(ds.Tables[0]); 
oExDo.DiskFileName = @"c:\erf.pdf"; 
oExo = oRD.ExportOptions; 
oExo.ExportDestinationType =ExportDestinationType.DiskFile; 
oExo.ExportFormatType =ExportFormatType.PortableDocFormat; 
oExo.DestinationOptions = oExDo; 
oRD.Export(); 
oRD.Close(); 
}

解决方案 »

  1.   

    回复人: weisunding(鼎鼎) ( ) 信誉:100  2005-08-25 14:09:00  得分: 0  
     
     
       we've never run into trouble as yours.
    if u guys not showing off ur english words here as fake yankeei think that would be a lot of experienced programmers would help you.
      
     
    Top  
     
     回复人: mathewyang() ( ) 信誉:73  2005-08-25 15:02:00  得分: 0  
     
     
       噢,其实我在bussinessobject.COM那里问过相同的问题,但没有人答复,所以我就顺带抄了过来。
    我过往发的贴都是中文的。英文很多人都会,我没必要逞这样的能。  
     
    Top