예제 #1
0
    private MemoryStream PrintVolumeByPort(string refType, string date1, string date2, string port, string userName)
    {
        XtraReport rpt = new XtraReport();

        rpt.LoadLayout(Server.MapPath(@"~\ReportAir\ReportRepx\VolumeByPort.repx"));

        string[] s1 = date1.Split('/');
        string[] s2 = date2.Split('/');
        DateTime d1 = new DateTime(SafeValue.SafeInt(s1[2], 0), SafeValue.SafeInt(s1[1], 0), SafeValue.SafeInt(s1[0], 0));
        DateTime d2 = new DateTime(SafeValue.SafeInt(s2[2], 0), SafeValue.SafeInt(s2[1], 0), SafeValue.SafeInt(s2[0], 0));

        rpt.DataSource = AirFreightRptPrint.dsVolumeByPort(refType, d1, d2, port, userName);
        System.IO.MemoryStream str = new MemoryStream();
        if (docType == "1")
        {
            rpt.ExportToXls(str);
        }
        else
        {
            rpt.ExportToPdf(str);
        }

        return(str);
    }