How to set a variable page size in iReport - ireport

I want to print tickets in a termic printer, but it the information can use 3" or 25" of paper of length. If I set a page size of 25", i waste a lot of paper because is printed the white space.
How can i solve it?

Ok, it was more easy than i thought.
Theres is an option in main element report (first element in Report Inspector window) called Pagination. Just check Ignore Pagination.
Well, that's all.

Related

How to make items in a FMX TListBox bold?

How can I make the items in my FMX TListBox bold? I can't find anything by myself, either in the documentation or the Internet.
You need to set two properties for the tListItem in question. The first line of code below lets you set the font properties for that ListItem rather than having the style dictate the font properties (if you miss this step, the next step will have no affect). The second line sets that ListItem to bold (where, of course, x is the index within the list that should be made bold)
ListBox1.ListItems[x].StyledSettings:=[];
ListBox1.ListItems[x].Font.Style:=[TFontStyle.fsBold];
Thanks to Gregg who gave a working answer for delphi, i'll put a C++Builder version here.
I made a loop over my ListBox with the item count, and it does not affect the loading speed of the ListBox (around 4000 items in my case) so it's a good solution at least for me.
ListBox->ListItems[x]->StyledSettings = ListBox->ListItems[x]->StyledSettings >> TStyledSetting::Style;
ListBox->ListItems[x]->Font->Style = ListBox->ListItems[x]->Font->Style << fsBold;
You can use custom theme for TListBoxItems. Create one by right mouse on ListBox.

How to convey on-scroll loading has reached the end

I have implemented an on-scroll loading which fetches some chunk of data every time the scroll reaches the end of the viewing area. After some point of time when there would be no more new data to be shown, how should I convey to this to the end-user from a UX point of view?
I was thinking of few options such as displaying a tooltip which automatically vanishes after few seconds. Other option would be something similar to rubber banding scrolling from Apple. Any other approach that can be used here?
Without knowledge of what the use-case is (i.e. has user performed a search or just scrolling a list from elsewhere), in general, two good options:
Follow Slack's "You are upto date! + icon" little image on the last
elastic scroll at bottom. Or, for example, "That's all we've got just
yet! Check your email for more or Search for [term] instead".
Use a progress-bar type of indicator like when you read an article on
Medium --> as people scroll down, they'll have a live indicator of
getting to the bottom of the list.
I don't like dead ends in my applications. If the user hits the bottom of your list and is still searching, he probably has the wrong search terms. I'd place a box along the line of "Haven't found what you're looking for? Try a different search term" and link that to the search box.
Even if it's not a search, once the user hits the bottom without successfully finding what they where looking for provide them with an alternative.
Hope this helps you.

Oracle reports builder, printing on last page

I have margin and inside it is a frame that contains a few lines for signatures, but I want it to only be visible on the last page.
So I set it to print on last page, horizontal to variable; but I thought I'd need to add a format trigger on the frame inside the margin. What should I write in pl/sql to achieve this?
If you want a frame to only print on the last page, don't put it in the margin. Instead, put it below all other frames and (as you already have) set it to print only on the last page.
Whatever you put in Margin is always displayed on all pages. Simply move your signature frame to the main layout, below your main group frame. And set it to display on last page only. I assume your signature query is separate query that may or may not be related to other queries... You may keep it inside the main group frame making signature frame variable, for example. It all depends on your design and requirements.
I get it now, there is button in toolbar edit margin, and u can edit everything inside margin. so i put frame inside it and in properties change last page and it worked as i wanted to work. THanks on your replies.

How can I programmatically detect if some text is visible or has overflowed in an InDesign document using ExtendScript?

I am building an InDesign panel with ExtendScript which finds text and shows it to the user. To do this, I use the showText() method of the Character object. The problem is that sometimes the text I'm looking for doesn't appear because, even though the method does show the right page at the right place, the text has overflown and is not visible.
Is there a way to check if the text is visible or not? Ideally, I would like to be able to fall back on the story editor if the text cannot be seen as-is...
To check the situation for an individual character, see the parentTextFrames property, it returns an array with 0 or 1 frames. In rare cases of insertion points whose left side is in one frame while the right side is in the following, you get two frames.
app.selection[0].characters.item(0).parentTextFrames.length
You can also compare the index of your character against the last index in the last text container of the story, e.g.
app.selection[0].parentStory.textContainers.pop().characters.lastItem().index
Of course you should first see whether there is overflow at all ...
app.selection[0].parentStory.overflows
You may call the baseline property for the text in a try/catch statement. If text is visible, baseline will return a value, otherwise it will raise an error.
Loic

Win32 List-View Control SubItem padding for custom-drawn SubItems?

When using custom-draw (NM_CUSTOMDRAW) to draw the entire contents of a ListView SubItem (in Report/Details view), it would be nice to be able to apply the same left and right
padding in my custom paint method that is applied by the control itself for non-custom-drawn items.
Is there a way to programmatically retrieve this padding value? Is it
related to the width of a particular character (" " or "w" or something?) or
is it a fixed value (6px on left and 3px on right or something) or...?
EDIT: To clarify, I want to add the same padding to my NM_CUSTOMDRAWn SubItems that the control adds to items that it draws, and the metric that I'm looking for, for example, is the white space between the beginning of the 2nd column and the word "Siamese" in the following screenshot (Note: screenshot from MSDN added to help explain my question):
(source: microsoft.com)
Note that the word "Siamese" is aligned with the header item ("Breed"). I would like to be able to guarantee the same alignment for custom-drawn items.
use ListView Header message HDM_GETBITMAPMARGIN
see link text
ListView_GetSubItemRect (LVM_GETSUBITEMTECT)
http://msdn.microsoft.com/en-us/library/ms930172.aspx
Despite what the documentation says I suspect LVIR_LABEL returns just the returns the bounding rectangle of the item text, as per ListView_GetItemRect.
(This just kept niggling me as I though I had actually seen an answer somewhere when playing with NM_CUSTOMDRAW).
Edit After Comment 2:
I imagine you have seen NMLVCUSTOMDRAW which if you are willing to use Version 6.0. has rcText. I wouldn't since I use Win2K.
Given what you have found I would go back to the suggestion of using
ListView_GetItemRect to get LVIR_LABEL and compare that with LVIR_BOUNDS and use the difference.
the way for doing this is retrieving the format of the corresponding column with
ListView_GetColumn()
then check the retrieved myLVCOLUMN.mask
LVCOLUMN myLVCOLUMN;
myLVCOLUMN.mask=LVCF_FMT;
ListView_GetColumn(hwnd,nCol,&myLVCOLUMN);
then when we draw the corresponding label belonging to that column
if(myLVCOLUMN.fmt & LVCFMT_CENTER)
DrawText(x,x,x,x, DT_CENTER | DT_WORD_ELLIPSIS );
else if (myLVCOLUMN.fmt & LVCFMT_RIGHT)
DrawText(x,x,x,x, DT_RIGHT | DT_WORD_ELLIPSIS );
else
DrawText(x,x,x,x, DT_LEFT | DT_WORD_ELLIPSIS );
I would assume that GetSystemMetrics() is that you need to look at. I think that SM_CXEDGE and SM_CYEDGE are probably the values you want, but don't quote me on that. ;-)
Can only guess without seeing your output.
A few suggestions: If you are using the DrawTextEx function, have you have experimented with DT_INTERNAL et al?
Are you accidentally putting in a blank image/icon.
Does it look ok in classic screen mode? If so I would look at XP Theme functions to see if some thing is going on.
Late edit after first comment:
I wonder if the size of rectangle matches the space required for the LVN_ENDLABELEDIT edit box around the text so the text doesn't move (or for a focus rectangle)?
I guess you could compare the result of LVM_GETITEMRECT with LVIR_LABEL on the first column and use the difference as your left border.

Categories

Resources