FastReport icon indicating copy to clipboard operation
FastReport copied to clipboard

how to replace design jsondatasource when print report?

Open neozhu opened this issue 3 years ago • 2 comments

my code.

// create report instance
            Report report = new Report();
            // load the existing report
            report.Load($@"{inFolder}\report.frx");
            // register the data list
            report.RegisterData(data,"JSON");
            // prepare the report
            report.Prepare();

image image

when print report, report data not change. how to right assignment json data when print or preview?

neozhu avatar Jun 17 '21 01:06 neozhu

use dictionary

ilivecoding avatar May 06 '22 07:05 ilivecoding

@ilivecoding do you have a example of this?

renerlemes avatar Aug 05 '22 18:08 renerlemes

SORRY, NO.

ilivecoding avatar Oct 15 '22 06:10 ilivecoding

Hello!

Try doing it like this:

var builder = new JsonDataSourceConnectionStringBuilder();
builder.Json = "[]";

JsonDataSourceConnection conn = new JsonDataSourceConnection();
conn.ConnectionString = builder.ToString();
report.Dictionary.Connections.Add(conn);
conn.CreateAllTables();

Best regards Marat

MaratAlaev avatar Mar 31 '23 09:03 MaratAlaev