Before I get into it I would like to say - I am well aware why this option is disabled through normal UI means on the Ribbon. I agree that the end user should basically never see a query in the first place.
Now as to why I would like to do this - there are a fair amount of Queries I have created that are not tied to a report or form. Creating forms for ~30 queries is a bit too time intensive at the moment just to appease my OCD. I have found out that if you put an Exclamation Mark "!" inside the Format portion of your query field it will convert that to a string format and Left Align it. If you enter in a Question Mark "?" it converts the field to a string as well, but Right Align.
I am aware of most of the issues with converting things to strings, and have already made the changes to convert these fields back to Numerical or Date/Time where needed.
I was wondering if anyone knew or had come across a way to Center Align, I have a few fields that are barely readable with how they all smoosh together, and if I could center align them I would just make their field size bigger so it looks a bit cleaner.
Related
I have a shopping website and I want to print a shipping labels for orders.
The format of the shipping lable need to be like in the picture.
which means, I have this structure, and I need to fill in 4 data fields.
The data is not the problem.
My problem is that I tried to do it, and when I pressed ctrl+p, I didn't have the option of printing the page horizontally.
So my question is how is it possible that I can't choose "horizontally" in the page-layout option??
If I succeed to fix this problem, it will be easier for me to do the rest, but still, I want to ask also if there is a way of writing HTML pages (pages to be print)? Because this is actually my first time that I write a page like this.
At the beginning I tried to write the text when it is rotated 90 degrees, so that when I print the page (vertically - because I can't choose another option...) it will be printed as I want it to be. I found it very difficult to write the data in its right position because I couldn't fit the data to the format (because it is 90 degrees rotated...)
Another important thing is the fact that this is not an online website, it is a website on the computer localhost (which means the URL is: "localhost/.../.../something.php"). I mention this because I have noticed that all the "localhost" pages don't have the option of printing horizontal. I don't know if it is related, it sounds very strange to me.
Does anyone have an idea why I couldn't choose "horizontal" in the printing options?
Or does anyone know what are the "rules" of HTML printing pages?
I have an MVC View where I need to display DATA in a certain format, example below is in alphabetic with a numerical value tied to that letter. It needs to be Top Down, split into 2 different columns. As shown in the image attached it is alphabetic going down, then when half way through it needs to start on the next column, row 1.
This will be in a partial view and be used with several different result sets. Definitely cannot hard code.
I dont have any code right now as I could either use either a table or just some Spans. Open to suggestions.
I've thought of splitting the array in half, then just looping through each array item by item but wondering if there is a better way.
Thanks in advance!!
Depending on your HTML structure (difficult to tell as you haven't shown it), you could possibly use css column-count:
.yourElement
{
column-count:2;
}
Other than that, splitting the array in half is not such a bad idea, i suppose it depends on the length.
My question is not language based or OS based. I guess every system is offering some sort of TextOut(text, x, y) method. I am looking for some guidlines or articles how should I implement selection of outputed text. Could not find any info about this.
The only thing which comes to my mind is like this:
When user clicks some point on the text canvas I know the coordinates of this point. I need to calculate where exactly it will be in my text buffer. So I am traversing from the begining of the buffer and I am applying to each character (or block of text) a style (if it has any). After this, I know that after given style the letter has given size. I am adding its width and height to previously calculated X,Y coordinates. In this way, I am traversing the buffer until the calculated position has not reached the point that has been clicked by the user. After I reach the point within range of some offset I have starting point for the selection.
This is the basic idea. I don't know if this is good, I would like to know how this is done for real like for example in Firefox. I know I could browse the sources and if I won't have a choice I'll do it. But first I am trying to find some article about it...
Selecting text is inherently specific to the control which is containing it and the means it stores that text.
A very simple (though questionably inefficient means) is to run the text flow algorithm you are using when clicking on a point and stopping the algorithm when you have reached what is closest to that point. More advanced controls might cache the text layout to make selections or drawing their content more efficient. Depending on how much you value CPU time or memory there are ways to use caches and special cases to make this “hit test” cheaper.
If you can make any assertions (only one font in the control, so every line has the same height) then it is possible to make these tests cheaper by indexing the font layout by lines and then doing simple arithmetic to find out which line was clicked on. If your text control is also using monospace fonts (every character occupies the same width as well as height) then you are in even more luck, as you can jump straight to the character information via a lookup table and two simple divisions.
Keep in mind that writing a text control from scratch is obscenely difficult. For best practice, you should keep the content of the document separate from the display information. The reason for this is because the text itself will need to be edited quite often, so algorithms such as Ropes or Gap Buffers may be employed on the data side to provide faster insertion around the caret. Every time text is edited it must also be rendered, which involves taking that data and running it through some kind of formatting / flow algorithms to determine how it needs to be displayed to the user. Both of these sides require a lot of algorithms that may be annoying to get right.
Unfortunately using the native TextOut functions will not help you. You will need to use methods which give you the text extents for individual characters, and more advanced (multiline for example) controls often must do their own rendering of characters using this information. Functions like TextOut are not built to deal with blinking insertion carets for example, or performing incremental updates on text layouts. While some TextOut style functions may support word wrap and alignment for you, they also require re-rendering the entire string which becomes more undesirable in proportion to the amount of text you need to work with in your control.
You are thinking at a much lower level than necessary (not an insult. you are thinking that you need to do much more work then you need to). Most (if not all) languages with GUI support will also have some form of selectionRange that gives you either the string that was selected or the start and stop indices in the string.
With a modern language, you should never have to calculate pixels and character widths.
For text selection in Javascript, see this question: Understanding what goes on with textarea selection with JavaScript
I have an Access form displaying a tiny amount of data for a certain type of record. Basically it just prints the name on the left and on the right has a bunch of Rectangle controls whose background color I change in the form's OnLoad() function, according to results from a query performed using that record's ID as parameter.
This all worked fine, got my ID/name on the left and 31 boxes on the right, colored if that day of the month is reserved :) But needless to say that function can be completely arbitrary since it's code.
Then I decided to switch to 'continuous form' as to display as many records/items as possible. But alas, it was not to be -- all boxes were colored according to the query/function performed for the first record only. I figured that might be because it's the OnLoad() but changing it to OnCurrent() did not do much either. As it turns out, or that's what I read, the Rectangle intances are shared over the entire form and if I change the BackColor for one of them it changes for that box for each record.
I want to be able to change this according to a query performed on a per-record basis. Is there any way? Up until now I've only been able to find conditional formatting (the feature that's nor available for rectangles nor seems to cater my exact needs?) and kludgy Access 97 text-box hacks.
Thanks in advance :)
You may be coming from an HTML background, where rectangles would be a natural solution. They aren't in Access. I don't think they'll work for you (in fact, "kludgy" could describe the attempt in my humble opinion).
You can however display an image. You'll keep an image for each status ready to call up. I've made visual displays this way. A little later I may be able to post some code, but I think you'll find this plays out pretty simply even if I don't.
ADDED NOTE: I'm glad this looks like it will work for you. You are concerned about "instanced only once" in your comment below. Yes, that's true for rectangles which are unbound controls (because they are designed for mere ornamentation). But you'll be using an image control which is a bound control (see Remou).
Change each rectangle to a text box, Control Source:
=Iif(myConditionIsMet,"ÛÛÛÛÛ","")
The "Û" is the Full Block character in Arial (asc 219).
All unbound controls in a continuous form will be the same; bound controls can be varied using conditional formatting.
I have an html table that literally has like 30 columns of data, and I'm having a hard time framing it in such a way that it can be visible without massive left/right scrolling.
One thing I was wondering is if anyone has ever seen anything clever with column headers? Some of them just can't be abbreviated down enough, but the column header is something like "Interview" and the value is numeric (lots of wasted space for the header alone). Granted, I could try and name these columns like INT or whatever, but there are lots of similarly named columns that it could become confusing.
Maybe some sort of auto collapsing columns based on mouse movement? Not sure.. I just need some creative suggestions on how to display this data!
Most likely the user will have a devil of a time comprehending 30 columns of data, regardless of scrolling.
I would recommend showing the most fundamental columns (things like name, description, identifying numbers -- core stuff, hopefully there are only 10 of them or less), and then letting the user toggle on or off whatever columns they need. A bit like google squared.
Use Jquery and CSS to accomplish this in a clean fashion. There may also be Javascript UI libraries that do this for you (Jquery UI, YUI, others...)
create images for the column names and rotate the text in the image 90 degrees. you can then have a long name with equally small widths.
Josh
I agree with the answer from ferocious, toggling columns is a good idea. Also, depending on the data, I would recommend only having a few columns displayed, and when the user clicks on the row they are interested in, it moves to a new page dedicated to the data in that record. This will work for some types of data and not for others