Search code examples
asp.net-core-mvcstimulsoft

How set postion and size image variables Stimulsoft Core?


I am using stimulsoft for ASP.NET Core MVC. I want to get image variables and set setting properties for image. This my code:

public ActionResult GetReportSnapshot(string sort)
{
        StiReport report = new StiReport();
        report.Load(Server.MapPath("~/Reports/Jobs.mrt"));

        report["@PrjectId"] = 1;
        report["@OrderBy"] = sort;
      
        // this is the problem:
        report.Dictionary.Variables["image"].width=5
    
        report.Render();
}

Solution

  • I solved the problem like this:

      StiReport report = new StiReport();
      var image = report.GetComponentByName("Image1") as StiImage;
      image.CanGrow =false ;