Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple detail -hidden band overflow page
Message
From
02/11/2020 20:55:49
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01676939
Message ID:
01676967
Views:
29
>Thanks, Rick - somehow after this many years I have forgotten that. Unfortunately, that would mean having to distribute those files with the application, but I'll definitely keep in mind if nothing else works.

They're already there:
* Load data from inside the EXE
lcFrxData = FILETOSTR("report.frx")
lcFrtData = FILETOSTR("report.frt")

* Save out to disk
STRTOFILE(lcFrxData, lcFrx)
STRTOFILE(lcFrtData, lcFrt)
>
>>Steve, the FRX is a regular DBF file. You can copy your FRX and FRT out to temporary files, open them up as DBFs, modify any of the band records you want by examining how they are setup (compare two saved versions, one with a band height of X, one with a band height of Y), and then you'll know what to adjust. Make your changes, close the table, and then use that temporary file for your report. Delete it afterward.
>>
>>In general, something like this (untested, off the top of my head):
>>
>>
lcFrx = SYS(2023) + SYS(2015) + ".frx"
>>lcFrt = FORCEEXT(lcFrx, ".frt")
>>
>>DECLARE INTEGER CopyFile IN WIN32API STRING cExistingName, STRING cNewName, INTEGER lFailIfExists
>>CopyFile("report.frx", lcFrx, 0)
>>CopyFile("report.frt", lcFrt, 0)
>>
>>* Open it as a table
>>SELECT 0
>>USE (lcFrx) ALIAS _frx
>>
>>* Make your changes here
>>
>>* Close when finished
>>USE IN SELECT("_frx")
>>
>>* Use that modified report:
>>REPORT FORM (lcFrx) ...
>>
>>* Clean up
>>DELETE FILE (lcFrx)
>>DELETE FILE (lcFrt)
>>
>>
>>>I'm not sure if that would help as when I do use the band, it will have variable lines to show.
>>>However, you sparked a thought - is there any way to interact with the report object to change the height to near zero or to change the "start detail set on a new page when less than" boxes at runtime? I will know whether I need the band or not at runtime.
>>>
>>>
>>>>Hi,
>>>>
>>>> Did you check/uncheck "Constant band height" for detail band?
>>>>
>>>>MartinaJ
>>>>
>>>>>This one is driving me crazy - I have a work order with multiple detail bands. Depending upon the type of print desired (customer, internal, etc.) different table/bands may be hidden. With all except the last band (detail 5: "totals") if I set everything to hidden in the "print when" field, the information, headers, etc all disappear and the box/band below moves up to take it's space - as expected.
>>>>>
>>>>>However, with detail band 5, it wants to allocate space to the band and spill over to the next page, essentially creating a blank page. I have removed the records from the associated table and it still wants to allocate space for the header/footer of detail band 5. The effect is that some work orders needlessly show 2 pages. I went so far as to try the report in Chen's VFP Advanced and seem to have the same problem there.
>>>>>
>>>>>Does anyone have workaround ideas, short of making two reports for when my final band has no records and I need to hide the specific header/footer? However, it seems then detail band 4 could have the same problem, etc. - how to avoid blank pages?
Previous
Reply
Map
View

Click here to load this message in the networking platform