berteh / ScribusGenerator

Create beautiful documents with data. Open source pdf (and Scribus) template and mail-merge alternative.
http://berteh.github.io/ScribusGenerator/
MIT License
243 stars 37 forks source link

Last row duplicates to fill the remaining placeholders in the template when using SG_NEXT-RECORD #227

Closed ignutanz closed 3 weeks ago

ignutanz commented 1 month ago

I have a csv file with a 13 record data. with the last being the total. I create a scribus template having a table of 7 rows with the first column of each row starting with %SG_NEXT-RECORD% to load the data from the csv on the same page on each row. I find that in the generated output, the first page goes correctly with the first 7 records from the csv. the second page has the next 6 records but the last row being repeated.. The last row of the csv is used to fill the remaining rows in the template even after the last record in the CSV is reached. How can i stop filling the data once the last row in the csv is reached.

sersha commented 1 month ago

I have had the same problem, noted in the entry #225 .

berteh commented 3 weeks ago

This behaviour is a expected. The last row data is currently being used to fill all remaining "spots" until all items needed by the current template are replaced.

It made sense from a more "graphical" perspective, as to avoid getting lots of empty slots in a partially filled template... possibly even breaking the result layout if you rely on non-empty data (such as image placeholder, dynamic sizes or others).

That being said I see no problem in changing this default behaviour to replace all exceeding placeholders with an empty value. Having a look at it now, will let you know once done.

sersha commented 3 weeks ago

Thanks! I got your point. I think, it would be great if you publish this information for all.But perhaps, an option to choose one way or another would be great. And again, my heartfelt appreciation for your work!Best regards, Sergey

On Saturday, June 8, 2024 at 01:58:48 PM GMT+3, Berteh ***@***.***> wrote:  

This behaviour is a expected. The last row data is currently being used to fill all remaining "spots" until all items needed by the current template are replaced.

It made sense from a more "graphical" perspective, as to avoid getting lots of empty slots in a partially filled template... possibly even breaking the result layout if you rely on non-empty data (such as image placeholder, dynamic sizes or others).

That being said I see no problem in changing this default behaviour to replace all exceeding placeholders with an empty value. Having a look at it now, will let you know once done.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

berteh commented 3 weeks ago

done. please check. thanks for your feedback.