Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1] 2
  Reply  |  Print  
Author Topic: Page Length 0  (Read 28771 times)
Stephen T.
Posts: 114


« on: October 09, 2013, 10:51:26 am »

I vaguley remember that Informix 4gl (and presumably then BDS) allowed page length 0 in a report to mean 'unlimited' page length. The page headers and trailers I think were still fired (so obvioulsy had a length). What is the Genero equivalent in a 'standard' report (ie not GRW) - is it to simply set it to some ludicrously high number?
Gary C.
Posts: 109


« Reply #1 on: October 09, 2013, 12:48:22 pm »

I've never used page length 0 but if it helps I tend to use page length 1 for non pagenated reports. This excludes the use of headers and footers but I have never needed them in a report of unknown page length.

I use this within BDL too.

Reuben B.
Four Js
Posts: 1087


« Reply #2 on: October 10, 2013, 01:38:03 am »

There has been a lot of tidying up in this area over recent years, particularly in relation to the generation of 4375 error at compiletime and runtime

https://4js.com/online_documentation/fjs-fgl-manual-html/User/FglErrors.html

You may find that usage of PAGE LENGTH=0 and PAGE LENGTH =1 that functioned in earlier versions doesn't in more recent versions.

I think the key is to do the maths

(PAGE LENGTH - TOP MARGIN - BOTTOM MARGIN) >= Number of PRINT's per page.




Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Stephen T.
Posts: 114


« Reply #3 on: October 10, 2013, 10:52:42 am »

G/Reuben,
Thanks. I thought though that LENGTH 0 was an Informix 'special' case - in that it produced a first page header (not defined as first, but just triggered on 1st page) and then just the 'stream'. If you use other lengths as the page, do you not get the page header repeating? No great issue to work around - maybe a bit trickier to spot though as it seems the page length is being passed via a variable.

 
Stephen T.
Posts: 114


« Reply #4 on: October 16, 2013, 09:20:28 am »

... I have a report that does have the page length set to a silly length (in this case 65500 - presumably to work within Excel's limits) - and this still fails with a -4375 - BUT if the page length is reduced to 66, it doesn't come up with the same error. The report has a first page header of two lines (date line and headings) and a 'last row' of two lines. 0 margins top and left.
Stephen T.
Posts: 114


« Reply #5 on: October 16, 2013, 09:30:47 am »

... I have a report that does have the page length set to a silly length (in this case 65500 - presumably to work within Excel's limits) - and this still fails with a -4375 - BUT if the page length is reduced to 66, it doesn't come up with the same error. The report has a first page header of two lines (date line and headings) and a 'last row' of two lines. 0 margins top and left.

OK - is the page length a smallint and anything above the magic 32k number treated as negative by any chance?

Reuben B.
Four Js
Posts: 1087


« Reply #6 on: October 16, 2013, 10:32:31 pm »

Don't you end up with lots of blank lines at the end of your report file using PAGE LENGTH set to a "silly length"?

If you are creating a CSV file that can be opened automatically in Excel, why don't use you use base.Channel to write the file.  Something like ...

Code
  1. LET ch = base.Channel.create(filename,"w")
  2. CALL ch.setDelimiter("CSV")
  3. CALL ch.writeLine(heading_line1())
  4. CALL ch.writeLine(heading_line2())
  5. FOREACH data_curs INTO rec.*
  6.   CALL ch.write(rec.*)
  7. END FOREACH
  8. CALL ch.writeLine(footer_line1())
  9. CALL ch.writeLine(footer_line2())
  10. CALL ch.close()


Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Stephen T.
Posts: 114


« Reply #7 on: October 17, 2013, 08:34:14 am »

Reuben,,
Mainly because this is a migration from BDS, and the code for reports hadn't been identified as a migration issue. Page length 0 'works' in BDS as I recall it used to in Informix (but my memory fades - and I don't recall whether page length 0 was an intentional feature or a bug that people manipulated.
I can convert the reports to Channel (and to be honest that was my first thought), but its a bit more work (as I've seen some reports pass the page length to the report and use the report in two 'modes') that hasn't been catered for in a shortish deadline. So i was hoping that 'page length 0' should also work in Genero and that it was maybe a setting that I'd missed!

Steve
Reuben B.
Four Js
Posts: 1087


« Reply #8 on: October 18, 2013, 01:11:37 am »

Quote
Page length 0 'works' in BDS as I recall it used to in Informix (but my memory fades ...

Create an example that shows PAGE LENGTH 0 working as you expect it to using Informix or BDS.  There is a saying I came across once, "nothing spins a geeks propellor like an isolatable reproducible problem".  So if you can create a small program that compiles and runs differently in Informix-4gl, BDS, Genero then that will grab our developers attention.

The problem for us will be if it does A in Informix-4GL, and B in BDS, what do we do in Genero, A or B?, or do we add an FGLPROFILE setting similar to Report.aggregateZero?  In this instance, if what you say is correct, an FGLPROFILE setting that says ignore error 4375 if PAGE LENGTH=0 might be the way forward.

Reuben




Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Stephen T.
Posts: 114


« Reply #9 on: October 18, 2013, 08:45:09 am »

Cheers Reuben
The problem is that the project is a migration that has already been scoped, and PAGE LENGTH 0 wasn't identified as an issue - its not that I want to use PAGE LENGTH 0, I just wanted to know if the 'old' functionality had been migrated in a way that I was unaware of.
If it hasn't then the migration will have to handle it a different way, as I don't think there's time to wait for a fix.

Reuben B.
Four Js
Posts: 1087


« Reply #10 on: October 21, 2013, 05:45:00 am »

Stephen,

I did a search on "PAGE LENGTH 0" in the Issue Tracker https://4js.com/en/support/issue/?id=&product=&stat=&words=%22PAGE+LENGTH+0%22&Search=Search and it lists a very old issue that involved PAGE LENGTH 0.  It has a nice small example and I tried compiling/running that example in a few versions.  It compiles and runs in 2.11, 2.21, 2.30, in 2.40 it compiles but doesn't run, and in 2.50 it fails to compile or run.  Where it fails it lists the -4375 error I mentioned earlier.

Compiling and running on BDS it succeeds, compiling and running on Informix-4gl it has a -4375 compile time error.

In our documentation, we mention this new error -4375 as a migration issue for 2.40 https://4js.com/online_documentation/fjs-fgl-manual-html/User/Mig0006.html#invalid_report_dimensions.  If there was a simple workaround I would expect it to be listed there.

Reuben



Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Stephen T.
Posts: 114


« Reply #11 on: October 21, 2013, 08:49:01 am »

Thanks Reuben - I did see that issue as it appeared on a general 'Page Length 0' serach on google - but it seemed to me to be more focuesd on the array item than the PAGE LENGTH setting. It also appeared on a copule of forums in connection with Informix 4gl and Ace.

But again, all that is largely irrelevant as if there's not 'the same' way in Genero to handle what the BDS prog was doing, then it will have to be coded round anyway.

Thanks again,

Steve
Olivier E.
Four Js
Posts: 201


« Reply #12 on: October 21, 2013, 12:13:33 pm »

Hello Stephen,


   Let see the issue :

https://4js.com/en/support/issue/?id=23068&product=&stat=&words=%22PAGE+LENGTH+0%22&Search=Search

  There is a workaround : Modify your reports with :   BOTTOM MARGIN  0  + PAGE LENGTH 1  - See attachment


Olivier E. - Four Js Support

* reporte.4gl (1.34 KB - downloaded 855 times.)
Stephen T.
Posts: 114


« Reply #13 on: October 21, 2013, 05:42:40 pm »

Olivier,
Thanks for pointing me at that. In 2.40, the 0's in the length,bottom and top margin still cause a failure at runtime and 1 doesn't 'globally' work for the code here - it looks like the calc presented above is the way for the moment - ie to set the page length to the no of lines on every row + any headings + any trailers

Steve
Reuben B.
Four Js
Posts: 1087


« Reply #14 on: October 21, 2013, 11:00:50 pm »

Olivier: In the Bugzilla comments for 23068 there is an entry that says "Erratum in main Description: PAGE LENGTH must be set to 1, not 0". hence I would not expect that to help us here.

What that issue related to was the fact that with the -4375 test, if TOP MARGIN/BOTTOM MARGIN were not defined, then the default of 3 was used.  Hence if you had PAGE LENGTH 1 and hadn't explicitly set TOP MARGIN 0, BOTTOM MARGIN 0 then the -4375 calculation was always going to fail.

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1] 2
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines