View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033263 | Lazarus | Packages | public | 2018-02-27 23:05 | 2018-02-28 17:37 |
Reporter | Stephano | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Product Version | 1.9 (SVN) | ||||
Fixed in Version | 1.9 (SVN) | ||||
Summary | 0033263: FPReport designer: TFPJSONReport can't load a report saved by the standalone designer | ||||
Description | - Create and save a report using the standalone designer - Write code that loads the report: FPJSONReport1.LoadFromFile(MySavedReport) Project project1 raised exception class 'External: SIGSEGV'. In file 'fpreport.pp' at line 9848:lOffset := FRTPage.RTLayout.Top + FRTPage.RTLayout.Height - FPageFooterYPos; This error looks similar to the non created fonts issue, but for FRTPage. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | |||||
Attached Files |
|
related to | 0033268 | closed | Michael Van Canneyt | FPReport designer: Saving a report adds data pages |
|
If your file contained run-time data, then it is normal that you get an error. I loaded it with a file that contains only design-time data, and that worked just fine. I suspect this is related to 33268, and that you tried to load a file that had run-time data in it. |
|
I attached a saved report with no runtime data. Same issue. - I gather that runtime data gets incorporated in the report when the preview toolbutton is pressed. So how can a report be saved without the runtime data short of stripping it manually? - In any case, TFPJSONReport.LoadFromFile should exit gracefully instead of crash with a SIGSEGV |
|
|
|
I can perfectly load this report. Please test again with the latest changes, also make sure you have updated FPC. |
|
Lazarus trunk and fpc trunk are uptodate. But there was some old fpreport source files in that specific test folder. I will test more and report. This is the code snippet i use: procedure TForm1.Button2Click(Sender: TObject); var FPJSONReport2: TFPJSONReport; begin FPJSONReport2 := TFPJSONReport.Create(Self); if PaperManager.PaperCount = 0 then PaperManager.RegisterStandardSizes; FPJSONReport2.LoadFromFile('simplereport-in.json'); gTTFontCache.SearchPath.Add('fonts/'); gTTFontCache.BuildFontCache; FPJSONReport2.RunReport; FPJSONReport2.SaveToFile('simplereport-out.json'); FPJSONReport2.RenderReport(FPReportExportfpImage1); FPJSONReport2.RenderReport(FPReportExportHTML1); end; |
|
Because you said 'Load', my test report code stops after the 'LoadFromFile'... The rest is already 'Render' :) It seems there is a fpjsonreport.pp in the components/fpreport directory checked in; make sure you remove it. (I need to check this still why this is checked in). |
|
My test used to crash at LoadFromFile. But as i pointed out in my edited comment, the cause was old fpreport source files in that specific test folder. Now LoadFromFile succeeds, but i get no output from RenderReport. |
|
I don't know if this is related or some other bug: I compared the SaveToFile output to the original file (check above snippet). There are differences which i doubt should exist (Data definition is gone). simplereport-in.json and simplereport-out.json are attached |
|
|
|
|
|
That is normal. This probably requires some explanation: Some facts : 1. The datasets are not considered part of the report. 2. The report streamer ignores any properties it does not know. The report designer uses these facts to save the data definitions in a separate structure 'DesignData', which is not part of the actual report's JSON. It is the task of the loading code to create the necessary datasets, based on the definitions found in this data structure. See LoadDesignFromFile, there you see how this is done around line 1370 I will create an event for this in TFPJSONReport, to make this easier. This also should probably go in the WIKI. |
|
Thanks for the explanation! Pls add a very simple code example to the wiki to show how to create the datasets because the code in CreateReportDataSets is not straightforward to use externally. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-02-27 23:05 | Stephano | New Issue | |
2018-02-27 23:21 | Maxim Ganetsky | Assigned To | => Michael Van Canneyt |
2018-02-27 23:21 | Maxim Ganetsky | Status | new => assigned |
2018-02-28 09:38 | Michael Van Canneyt | Note Added: 0106724 | |
2018-02-28 09:38 | Michael Van Canneyt | Status | assigned => resolved |
2018-02-28 09:38 | Michael Van Canneyt | Fixed in Version | => 1.9 (SVN) |
2018-02-28 09:38 | Michael Van Canneyt | Resolution | open => unable to reproduce |
2018-02-28 09:38 | Michael Van Canneyt | Relationship added | related to 0033268 |
2018-02-28 10:13 | Stephano | Note Added: 0106727 | |
2018-02-28 10:13 | Stephano | Status | resolved => assigned |
2018-02-28 10:13 | Stephano | Resolution | unable to reproduce => reopened |
2018-02-28 10:13 | Stephano | File Added: simplereport.json | |
2018-02-28 10:53 | Michael Van Canneyt | Note Added: 0106733 | |
2018-02-28 10:53 | Michael Van Canneyt | Status | assigned => resolved |
2018-02-28 10:53 | Michael Van Canneyt | Resolution | reopened => unable to reproduce |
2018-02-28 11:46 | Stephano | Note Added: 0106740 | |
2018-02-28 11:47 | Stephano | Status | resolved => feedback |
2018-02-28 11:51 | Stephano | Note Edited: 0106740 | View Revisions |
2018-02-28 11:56 | Michael Van Canneyt | Note Added: 0106741 | |
2018-02-28 11:58 | Stephano | Note Edited: 0106740 | View Revisions |
2018-02-28 11:59 | Stephano | Note Edited: 0106740 | View Revisions |
2018-02-28 12:01 | Stephano | Note Added: 0106742 | |
2018-02-28 12:01 | Stephano | Status | feedback => assigned |
2018-02-28 12:06 | Stephano | Note Added: 0106743 | |
2018-02-28 12:07 | Stephano | File Added: simplereport-in.json | |
2018-02-28 12:07 | Stephano | File Added: simplereport-out.json | |
2018-02-28 12:08 | Stephano | Note Edited: 0106743 | View Revisions |
2018-02-28 12:08 | Stephano | Note Edited: 0106740 | View Revisions |
2018-02-28 12:42 | Michael Van Canneyt | Note Added: 0106744 | |
2018-02-28 12:42 | Michael Van Canneyt | Status | assigned => resolved |
2018-02-28 12:53 | Stephano | Note Added: 0106745 | |
2018-02-28 17:37 | Stephano | Status | resolved => closed |