Closed Qulava closed 6 months ago
In addition. I tried to include the source code projects to my project for catch place where error occure. Error occure in DataConnectionBase class from FastReport.Data when adapter.Fill(table) method call (820 line)
Same problem here with a simple report with 2 text parameters. Have you found any solution or workaround?
Same problem here with a simple report with 2 text parameters. Have you found any solution or workaround?
Problem was gone after some retry. Probably package updates was help, becouse didnt do any specific movements.
Current Packages
Work example. created in 2023.2.0 version of designer. CatalogLayout.zip
Controller call
[HttpGet("catalog/create/{id}")]
public IActionResult CatalogCreate([Required] Guid id)
{
var uri = _configuration.GetSection("ImageBaseUri").Value;
var parameters = new Dictionary<string, string>
{
{ "company_id", $"{id}" },
{ "image_base_uri", $"{uri}" }
};
var filePath = $"Reports/CatalogLayout.frx";
var pdf = _reportService.MakeReportStream(filePath, parameters);
return File(pdf, "application/pdf");
}
service example
internal sealed class FastReportService : IReportService
{
private readonly IConfiguration _configuration;
public FastReportService(IConfiguration configuration)
{
_configuration = configuration;
}
public Stream MakeReportStream(string fileName, Dictionary<string, string> parameters)
{
using var report = new FastReport.Report();
report.Load(fileName);
report.Dictionary.Connections[0].ConnectionString = _configuration.GetConnectionString("PostgreSQL");
foreach (var parameter in parameters)
{
report.SetParameterValue(parameter.Key, parameter.Value);
}
report.Prepare();
using var pdfExport = new PDFSimpleExport();
var stream = new MemoryStream();
pdfExport.Export(report, stream);
stream.Position = 0;
return stream;
}
}
I hope it helps.
I have the same problem but the with another message.
Writing values of 'FastReport.Variant' is not supported for parameters having NpgsqlDbType 'Bigint'.
Hello. Can you help me with my problem. I'm trying use my report from c# code, but i get some error "Can't write CLR type FastReport.Variant with handler type TextHandler". When i use it in designer, it works fine, but i cant understand what i do wrong using it in code. I tried to ask google, and found similar questions, but they were left unanswered. If I missed an existing issue, please give a link.
Im using .net 7 and PostgreSQL 12
Packages
Report exmaple:
Adding FastReportService
Call report
Error description
Query from report