Динамическое связывание изображений в отчете Crystal - PullRequest
0 голосов
/ 26 декабря 2018

У меня проблемы с привязкой динамического URL в Crystal Reports. Я просто хочу установить URL с виртуальным путем изображения, а не с физическим.

Ниже приведен мой код.

public void ViewImages(int a)  
 {  
    try  
        {  
            string result = " ";  
            string sql = Session["ReportSQL"].ToString();  
            SqlCommand cmd = new SqlCommand(sql, con);  
            SqlDataAdapter da = new SqlDataAdapter(cmd);  
            SystemReport cml = new SystemReport();  

            da.Fill(cml, "DocumentManager");
            con.Close();
            foreach (DataRow row in cml.Tables["DocumentManager"].Rows)
            {                   
                row["Path"] = row["Path"];     
                result = "../images/"+row["Path"].ToString();                   
            }                                            
            ReportDocument cm = new ReportDocument();
            cm.Load(Server.MapPath("~/Reports/ShowImage.rpt"));               
            cm.SetDataSource(cml);   
            Viewer.ReportSource = cm;
            Viewer.DataBind();

        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
...