Converting Crystal report to PDF

前端 未结 4 1743
梦毁少年i
梦毁少年i 2021-01-17 06:23

is there any facility available in crystal report(c# .net) to change the font to some other language? if no, how to convert crystal report to pdf format?

4条回答
  •  走了就别回头了
    2021-01-17 06:45

    protected void Page_Load(object sender, EventArgs e)
    {
        ExportOptions objExOpt;
    
        CrystalReportViewer1.ReportSource = (object)getReportDocument();
        CrystalReportViewer1.DataBind();
        // Get the report document
           ReportDocument repDoc = getReportDocument();
    
        repDoc.ExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat;
        repDoc.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile;
        DiskFileDestinationOptions objDiskOpt = new DiskFileDestinationOptions();
        objDiskOpt.DiskFileName = @"c:\crystal report\TFA.pdf";
        repDoc.ExportOptions.DestinationOptions = objDiskOpt;
        repDoc.Export();
     }
    
    private ReportDocument getReportDocument()
    {
      // File Path for Crystal Report
      string repFilePath = Server.MapPath("~/CrystalReport1.rpt");
      // Declare a new Crystal Report Document object
      // and the report file into the report document
      ReportDocument repDoc = new ReportDocument();
    
      repDoc.Load(repFilePath);
    
      // Set the datasource by getting the dataset from business
      // layer and
     // In our case business layer is getCustomerData function
     return repDoc;
    }
    

提交回复
热议问题