How to implement variable height detail band in QuickReports - delphi

Delphi 7 and QuickReports. Does anyone know how to implement a variable height detail band so that the area for a detail band is dynamically adjusted to best fit the loaded data from the query? Is this at all possible with QuickReports? If not, do you know of any product that facilitates this?
EDIT
Components used: TQuickRep, TQRBand, and the particular control that will hold the variable size content is TQRExpr
EDIT
The key piece of info not included in the answer is how to assign the expression to a TQRExprMemo since it doesn't have an expression property like TQRExpr. The answer to that is to enclose the expression in { } (eg. "{expression}") and assign it to the Lines property.
Set RemoveBlankLines to True, AutoStretch to True, AutoSize to False.

I always use a TQRExprMemo. Set AutoSize to True, AutoStretch to True, and IIRC there's a property to delete/suppress blank lines. I've used this frequently to produce mailing labels, address blocks on letters, and so forth.

Related

Word 2007-2013 Content control

I have a word document contains some content control (Rich text, check boxes).
Normally I can call content control:
ActiveDocument.ContentControls.item(1).Range.Text = "something"
ActiveDocument.ContentControls.item(1).Checked = True
But some of the control inside shapes (text box) and they can not be called this way.
How can I use these controls?
Word has a number of different "StoryRanges" (the main body text "Story", various Header/Footer Stories, and so on. In this case the Controls are not in the Main Body story and you need to specify where they are. e.g. in the case you mention I think you will find them in
ActiveDcouemnt.StoryRanges(wdTextFrameStory).ContentControls
but if, for example, the textboxes are in a Header you may need to use a different StoryRange.
Unfortunately, the answer was not that simple. But I managed to solve the problem. The shapes was grouped, that was the main problem. I had to ungroup them and after that
ActiveDocument.Shapes.Item(1).Select
Selection.Range.ContentControls.Item(1).Checked := True
Thank for the help anyway.

How to remove all the grips on a coolbar if I have several coolbands?

If I set mycoolbar.fixedorder to true,only the grip on the first band will be hidden.
Well,If you use Delphi 7 to create an VCL Forms application,then put a coolbar on it and create 3 coolbans to hold other controls,only the grip and the top coolbands can be hidden by setting mycoolbar.fixedorder:=true.
I've uploaded a picture to make things clear.
You probably got a FixedOrder property wrong. The fixed property does not allow bands to be rearranged if set to True.
Setting up property of CoolBar to True keep user from changing the bands order at runtime, but the user can still move and resize the bands. I can actually give you advice what you can do, but the actual solution for your problem, well, you will have to wait for another answer.
My advice is to use three CoolBars in a row and setting their "FixedOrder" property to True and BandBorderStyle to bsNone. That way the grip will be hidden on all of them.
About the property, it's not a bug of IDE, it is the actual preference of the property.

setMargin and setPadding blackberry API

I have been trying some UI stuff on BB devices and I'm a bit confused between setMargin and setPadding functions of the Field class. I know their definitions but I dont get when I'm supposed to use either of one for any field.
Any help, examples would be highly appreciated!
Thanks!!
Difference between setMargin() and setPadding() will be clear by the fig. below
setMargin() sets the margin of one field from the other field as shown in fig.1
and setPadding() increasse the area of the field on which you are setting the padding. As shown in fig.2 the extent of Button2 become increased, while in setMargin(), the extent of field remains same and the spacing between the field become changed.

FastReport page orientation change in Delphi

Does anybody know how to design report in FastReport so that when user changes page orientation all column headers and data autofits new page width? I couldn't find any anchor mechanism there. Maybe I can do that during run-time? But then I need to catch page orientation change event somehow. Can anybody help?
I don't know what the question is: Bands are magnetic to page borders by default, so they fit the new page width.
But if you want the frxMemoview objects to move and resize according to the new page size, you should use the beforeprint event of the report to recalculate and move or size the report components.
If you have a report that can be printed both in portrait or landscape, the easiest way to buid this would be a layout for portrait and one for landscape. You could show a printersetupdailog before loading the report and depending on the orientation load the portrait or landscape layout.
This may not be the cleanest way. Building your report runtime in code is another option and recalculating every component in the report is another. But they involve a lot of coding and what if the user selects "Letter" instead of "A4"?
Regards,
Teo
FR dealer in Holland.
You can :
use the Align property of each
TfrxMemoview...
make it with Script
Sometimes it is necessary to modify report page settings (for example, to modify paper alignment or size) from a code. The TfrxReportPage class contains the following properties, defining the size of the page:
property Orientation: TPrinterOrientation default poPortrait;
property PaperWidth: Extended;
property PaperHeight: Extended;
property PaperSize: Integer;
The «PaperSize» property sets paper format. This is one of the standard values, defined in the Windows.pas (for example, DMPAPER_A4). If a value to this property is assigned, FastReport fills the «PaperWidth» and «PaperHeight» properties automatically (paper size in millimeters). Setting the DMPAPER_USER (or 256) value as a format, would mean that custom paper size is set. In this case, the «PaperWidth» and «PaperHeight» properties should be filled manually.
The following example shows, how to modify parameters of the first page (it is assumed that we already have a report):
Pascal:
var
Page: TfrxReportPage;
{ the first report’s page has [1] index. [0] is the Data page. }
Page := TfrxReportPage(frxReport1.Pages[1]);
{ modify the size }
Page.PaperSize := DMPAPER_A2;
{ modify the paper orientation }
Page.Orientation := poLandscape;
C++:
TfrxReportPage * Page;
// the first report’s page has [1] index. [0] is the Data page.
Page = (TfrxReportPage *)frxReport1.Pages[1];
// modify the size
Page->PaperSize = DMPAPER_A2;
// modify the paper orientation
Page->Orientation = poLandscape;
On BeginDoc i you can acess the properties from it using (frxPrincipal.FindObject('Page1') as TfrxReportPage).PaperSize := DMPAPER_A4;

How to do word wrap in a DevExpress TcxGrid?

I've got a long line of text that would be a lot easier to view if it would just word wrap around multiple lines, but I can't seem to find the option for it. Does anyone know how to enable word-wrap functionality?
Set the OptionsView.CellAutoHeight of the view you're working on?
From the help: "If the widths of the View’s columns are insufficient to display their entire content, then text clipping occurs. Use the CellAutoHeight property to prevent this. If this property value is True, then the cell content is displayed in multiple lines where necessary."

Resources