Max Shamanov wrote: ↑Wed Dec 21, 2022 9:36 am
Hello,
Please send us the sample project that will let us trepoduces the issue.
Thank you.
Hello Max.
I created simple report, it include JSONdataSource, DataTransformation and two dataBands:
- Снимок экрана 2022-12-21 210403.jpg (56.65 KiB) Viewed 643 times
- Снимок экрана 2022-12-21 210323.jpg (24.53 KiB) Viewed 643 times
- Снимок экрана 2022-12-21 210204.jpg (146.74 KiB) Viewed 643 times
And simple .Net project. My project generate random data, attaches this data to dataset and render report.
This operation calling three time. First time, value in transformdataband is correct. Next times this value not changing.
I use StimulSoft dll version 2022.1.1.0
Code: Select all
using Newtonsoft.Json;
using Stimulsoft.Report;
using Stimulsoft.Report.Dictionary;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace TestStimulSoftProject
{
public class DtoTestData
{
public int Ident { get; set; }
public string ParamName { get; set; }
public int value { get; set; }
}
class Program
{
static string CreateDataFile()
{
var FileName = Path.ChangeExtension(Path.GetRandomFileName(), ".json");
var DataList = new List<DtoTestData>();
var random = new Random();
for (var i = 0; i < 5; i++)
{
DataList.Add(new DtoTestData() { Ident = i, ParamName = $"Param #{i}", value = random.Next(0, 100) });
}
var json = JsonConvert.SerializeObject(DataList);
File.WriteAllText(FileName, json);
return FileName;
}
static void Main(string[] args)
{
CreateReport(1);
CreateReport(2);
CreateReport(3);
CreateReport(4);
}
private static void CreateReport(int v)
{
Stimulsoft.Base.StiLicense.Key = "enter key here";
var dataFile = CreateDataFile();
using (var report = new StiReport())
{
report.Load("Report.mrt");
var dataSource = (StiJsonDatabase)report.Dictionary.Databases.Items.FirstOrDefault(x => x.Name.Equals("JSONData"));
dataSource.PathData = dataFile;
report.Compile();
report.Render();
report.ExportDocument(StiExportFormat.ImageJpeg, $"report_{v}.jpeg");
}
}
}
}
- report_1.jpeg (30.52 KiB) Viewed 643 times
- report_2.jpeg (30.53 KiB) Viewed 643 times
- report_3.jpeg (30.53 KiB) Viewed 643 times
- report_4.jpeg (30.54 KiB) Viewed 643 times