formatting

How to format tabular data as text in Java?

I would like to produce nicely formatted tabular text from arbitrary dataset object models. Is there a good library to do this in Java? Specifically, I want output that is formatted like command line data management tools such as the CLI for mysql. Example: +---------+--------------+------+-----+---------+-------+ | Field | Type ...

In emacs, how to line up equals signs in a series of initialization statements?

I saw this somewhere, but cannot find it now. Is there a built-in function in emacs, or does someone have elisp, to line up all the equals signs in a series of inititialization statments in cc-mode? Before: int t=9; Graphics g = new Graphics(); List<String> list = new List<String>(); After: int t = 9; Graphics g ...

Formatted output in OOffice/Word with python

I am working on a project(in python) that needs formatted, editable output. Since the end-user isn't going to be technically proficient, the output needs to be in a word processor editable format. The formatting is complex(bullet points, paragraphs, bold face, etc), I'm wondering if there is a way to generate such a report using python. ...

What are the valid Style Format Strings for a Reporting Services [SSRS] Expression?

I am trying to figure out the style string for the Format(Expression as Object, Style as String) function in a Reporting Services expression. I can't find where these style format strings are documented! Specifically I am trying to format a Price field to be always 2 decimal places. ie 1.5 formats to $1.50 ...

Convert a date and time into a MS SQL select query using SelectParameters

Hi all, I have this situation where I have a SqlDatasource control and the select query is like: SELECT col1, col2 FROM table1 WHERE colDate = @date The source of @date is a label with the text: 2009-05-29 12:06:00 I get the following error when I run the query: Conversion failed when converting date and/or time from character ...

How do you save data to a text file in a given format?

I want to save a matrix to a text file, so I can read it by another program. Right now I use: save('output.txt', 'A','-ascii'); But this saves my file as 6.7206983e+000 2.5896414e-001 6.5710723e+000 4.9800797e-00 6.3466334e+000 6.9721116e-001 5.9975062e+000 1.3346614e+000 6.0224439e+000 1.8127490e+000 6.3466334e+000 2.0517928e+...

Format text for STDOUT in Ruby

Hello, I am writting a small Ruby script that will run in a CLI. To improve the interface, I need to would love to add color/boldness to some elements that I output. Is that doable? If so (and I am almost sure this is), how? Thanks a bunch ...

Is there any way to do a Drop Shadow effect in XAML on a TextBlock?

I have a XAML TextBlock that I would like to render as a drop shadow. That is a white layer of text on top of a black layer. I'm doing this to make the text stand. Currently I have two TextBlocks offset to the right and below by two pixels. The top layer is white and the bottom layer is black. Is there a simple way to do this in XAM...

Formatting - at once - all the files in a Visual Studio project

I am interested in formatting all the files in a Visual Studio (ver. 2005) project all at once. Any idea? Currently, there is a way to format a single document by doing something like Edit->Advanced->Format Document. However, I don't see a single command to format all the files of a project all at once. I am hoping there is a macro o...

Formatting of hard to read try..catch..finally blocks?

How are you formatting your try..catch.finally blocks? Especially when only wrapping it around a small amount of code, it blows everything and makes code pretty unreadable and unsightly in my opinion. Such as: try { MyService service = new Service(); service.DoSomething(); return something; } catch (Exception ex) { ...

How to save rich text from a web application and display it in a rich text box

I'm working on an application with a co-worker at the moment - she is writing a web form that allows users to enter and manage text that will be saved to the database and then displayed within a desktop application. I'm using a Rich Text Box to display the text from the database. We want to allow the users to use basic formatting (bold,...

ssrs multi column table data gets spanned accross columns and/or pages incorrectly

In SSRS I built a report where a providers name, address, phone are listed in 3 columns on a page Grouped by State. Example Data: What I'm trying to do is prevent the data from spilling over into the next column or page. I want to just move the provider to the next column/page. Any suggestions? ...

Insert text into textarea with jQuery

Hey, I'm wondering how I can insert text into a text area using jquery, upon the click of an anchor tag. I don't want to replace text already in textarea, I want to append new text to textarea. Thankyou. ...

Intellij reformat on file save

I remember seeing in either IntelliJ or Eclipse the setting to reformat (cleanup) files whenever they are saved. How do I find it (didn't find it in the settings) ...

Prevent a large textbox from getting put on the second page in SSRS.

Greetings. I've got a large textbox in SSRS, with a few textboxes under it. When I view the report in Preview mode, or from the Report Manager it looks fine. But when I actually render it from code (into a PDF), it puts my large textbox on the second page (and leaves what's below on the first page). There's a Connect request here: ...

Nice PHP algorithm to convert 120000000 into '120 mil' ?

I've been struggling to find a nice algorithm to change a number (could be a float or integer) into a nicely formated human readable number showing the units as a string. For example: 100500000 -> '100.5 Mil' 200400 -> '200.4 K' 143000000 -> '143 Mil' 52000000000 -> '52 Bil' etc, you get the idea. Any pointers? ...

How do I get table-like formatting in a textbox or textarea?

I'm using TinyMCE textareas or textboxes for an event logger app, and I need the text to be formatted a certain way. Something like this: I can't figure out how to do this without a table, which I cannot nest in the textarea or textbox. Any suggestions? ...

Ruby: Convert HTML/Redcloth to plain text

Does anybody know how I can convert html to plain text with Ruby. Well really I need to convert RedCloth to plain text, either way would be fine. I'm not talking about just striping out the tags (that is all I've done so far). For example I would like an ordered list to retain the numbers, unordered lists to use an astrix for bullets et...

How can I change the paragraph formatting in the SharePoint RichHtmlField

In SharePoint we have the the richhtmlfield that allows the user to edit the html content of the page. How can I change the css that is applied when they select H1, H2, Normal etc. from the paragraph formatting button? I would also like to change the css applied to the tables added to the richhtmlfield, is this possible? All the best ...

Code cleanup in netbeans

Is there something similar to the Eclipse cleanup rules ((Preferences > Java > Code Style > Clean Up) in NetBeans? The cleanup rules in eclipse will allow you to clean things up like organizing imports, removing unnecessary casts, adding missing override annotations etc. Also can you do that on a whole set of classes/packages instead o...