JTextPane, Columns and Formatting
Hi All,
I have a small problem with creating columns in a JTextPane and setting the text for that desired Column.
I am trying to achieve a layout similar to the following:
Title - Centered
Information set 1 Information set 2
So the idea is that I have the title centered and in a specific style which I can do using the Style class. I am then wishing to format the data so that if both 'Information set 1' and 'Information set 2' contain data they are formated in their repected column.
I have found similar examples to create columns just by formating the data and adding a space, but this isn't quite what i am lookig for. I have aslo looked at the tutorials and some books and they don't really answer my question directly or in a similar way.
Thanks
David
Hi All,
I have a small problem with creating columns in a
JTextPane and setting the text for that desired
Column.
I am trying to achieve a layout similar to the
following:
Title - Centered
Information set 2
I have the title centered and in a specific style
which I can do using the Style class. I am then
wishing to format the data so that if both
'Information set 1' and 'Information set 2' contain
data they are formated in their repected column.
I have found similar examples to create columns just
by formating the data and adding a space, but this
isn't quite what i am lookig for. I have aslo looked
at the tutorials and some books and they don't really
answer my question directly or in a similar way.You need a custom EditorKit, View, etc...
See
http://groups.google.com/group/comp.lang.java.gui/browse_thread/thread/a227de086ccbcb0b/73c64b8cef6811ff?lnk=st&q=EditorKit+View+%22Jim+S.%22&rnum=2&hl=en#73c64b8cef6811ff
and
http://forum.java.sun.com/thread.jspa?forumID=257&threadID=268547
Jim S.
Similar Messages
-
Compare two columns and formate based on condition
I know this dead horse has been beaten and I've read my fair share of threads and manuals to no avail.. I have two list that consist of movie titles, holiday movies to be exact. I'm creating a holiday movie schedule which consist of three(3) columns...A,B and C. Column A is the Date, Sat, November 17 2012 thru Monday, Dec 24, 2012. Column C consist of a movie list divided into 2 sections with three subsections each. Section 1 is animated movies and Section 2 is live action, each subsection, 1.1, 1.2, 1.3, 2.1, 2.2 and 2.3 are lists based on popularity with the kids...low, medium and high respectively. And finally column B is the movie list relative the column A...the schedule.
As I write a movie title in column B, I'd like the cell fill to be light red and the corresponding title in column C change to strike through font type. This way I know I've added the movie title to the schedule...this comes in handy when I ask the kids to help so we have no duplicates in the schedule. I'm assuming this would take a combination of; Conditional Formatting, cell formulas and perhaps an additional blank column for trigger results.
I'm including the table, which include an experimental column I was working on. As an FYI, this has been completed in Excel already, just hoping to get it done in Numbers.
Thanks for any help anyone can give.
Date
Movie Name
Class
Sat, Nov 17, 2012
Animated Christmas Movies
TRUE
Lowest Priority Animation
TRUE
Frosty Returns
TRUE
Sun, Nov 18, 2012
The Nightmare Before Christmas
Rudolph and Frosty's Christmas in July
TRUE
Rudolph the Red-Nosed Reindeer & the Island of Misfit Toys
TRUE
Rudolph's Shiny New Year
TRUE
Mon, Nov 19, 2012
Nothing Like the Holidays
TRUE
Medium Priority Animation
TRUE
Jack Frost Animation
TRUE
Tue, Nov 20, 2012
Home for the Holidays
It's Christmas Time Again, Charlie Brown
TRUE
Christmas in South Park
TRUE
Cartoon Network Christmas Rocks
TRUE
Wed, Nov 21, 2012
Planes, Trains and Automobiles
Cartoon Network Christmas Yuletide Follies
TRUE
Cartoon Network Christmas Vol3
TRUE
Twas the Night Before Christmas
TRUE
Thu, Nov 22, 2012
Planes, Trains and Automobiles
The Little Drummer Boy
TRUE
TRUE
Highest Priority Animation
TRUE
Fri, Nov 23, 2012
Trapped in Paradise
The Simpson's Christmas
TRUE
A Very Special Family Guy Freakin' Christmas
TRUE
Family Guy: Road To The North Pole
TRUE
Sat, Nov 24, 2012
American Dad! The Most Adequate Christmas Ever
TRUE
A Charlie Brown Christmas
TRUE
The Nightmare Before Christmas
FALSE
Sun, Nov 25, 2012
Die Hard
Frosty the Snowman
Die Hard 2
Hooves of Fire
How the Grinch Stole Christmas
Mon, Nov 26, 2012
Gremlins
Santa Claus is Comin' to Town
The Year Without a Santa Claus
Rudolph, the Red-Nosed Reindeer
Tue, Nov 27, 2012
The Ice Harvest
Live Action Christmas Movies
Lowest Priority
Wed, Nov 28, 2012
Reindeer Games
National Lampoon's Christmas Vacation 2: Cousin Eddie's Island Adventure
Chasing Christmas
The Nativity Story
Thu, Nov 29, 2012
Bad Santa
Unaccompanied Minors
Jingle All the Way
Jack Frost Live
Fri, Nov 30, 2012
The Shop Around the Corner
The Santa Clause 3: The Escape Clause
The Santa Clause 2: The Mrs. Clause
Sat, Dec 1, 2012
The Bishop's Wife
Medium Priority
0
Bad Santa
Bad Santa
Mixed Nuts
Mixed Nuts
Sun, Dec 2, 2012
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
Reindeer Games
Reindeer Games
The Ice Harvest
The Ice Harvest
The Shop Around the Corner
The Shop Around the Corner
Mon, Dec 3, 2012
Miracle on 34th Street B&W
The Bishop's Wife
The Bishop's Wife
Christmas in Connecticut
Christmas in Connecticut
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
Tue, Dec 4, 2012
Mixed Nuts
Nothing Like the Holidays
Nothing Like the Holidays
Home for the Holidays
Home for the Holidays
The Family Man
The Family Man
Wed, Dec 5, 2012
Scrooged
Miracle on 34th Street 1994
Miracle on 34th Street 1994
Miracle on 34th Street B&W
Miracle on 34th Street B&W
Just Friends
Just Friends
Thu, Dec 6, 2012
Just Friends
Trapped in Paradise
Trapped in Paradise
0
Highest Priority
0
Fri, Dec 7, 2012
Miracle on 34th Street 1994
Die Hard
Die Hard
Die Hard 2
Die Hard 2
Gremlins
Gremlins
Sat, Dec 8, 2012Hi Stephen,
Both of these are solvable, and the Date solution cold be similar to that used for the 'stock list' in column C. The Movie Title solution is a different case, though.
The stock list is edited only occasionally, so requiring the user to unhide column C, add a title, then rehide the column is workable.
The same is true of the date list, so this too would work with the dates entered into a column that will be hidden, then copied into a visible column with a formula that introduced a detectable difference into the copied version, dependent on the weekday of each date. That difference would be used to trigger the conditional formatting of the cell containing the calculated date as text value. See the example below.
But the (scheduled) Movie Title column doesn't fit nicely into that mode of operation, as it is edited quite often. As editing, usng the model described, requires making the data column visible, editing the entry (or entries) in that column, then rehiding the column, the hassle factor soon becomes insufferable, if nothing else.
The first solution I considered (see earlier reply) is workable only if the the formatted table starts and remains the same size in all details (ie. individual row height) as the main table.Any change in row height in the main table not reflected in the auxiliary table immediately destroys the impression of formatting applying to the correct cells. With cells set to wrap text and varying lengths of movie titles, wrapped lines changing the height of individual rows is pretty much unavoidable.
Best practice here would seem to be to use a separate column to flag the titles already in the "Class" list with a "√" (or flag those not in the list with an "X"), and use conditional formatting to change the background colour of the flagging cell.
Here's a sample, using "W" to flag the weekend dates in the new column B, and "√" to flag the titles that are on the list already in the new column D.
I've added two titles to the weekend date, November 18. One is non-existent (as far as I know), so it doesn't appear in the list and doesn't get flagged; the other is chosen from a visible part of the list to show the highlighting of the title in that list. Column "C" (now column "F" due to the insertion of two new columns) is hidden. G, labelled .Class, is the calculated column (D) from the previous message.
Regards,
Barry -
Format output - set width of column and also two-lined column name
Hi,
I want column EMPLOYEE_ID to be printed also in two lines and also that the width of the column will be 8 like this:
EMPLOYEE
ID
(width 8)
I tried this:
column EMPLOYEE_ID HEADING EMPLOYEE|ID Format a8
but the two-line formatting didn't work (the width really was 8).
How can I combine this 2 options?
ThanksHi Frank,
Which version of SQL*Plus are you using?my version is:
SQL> DEFINE _sqlplus_release;
DEFINE _SQLPLUS_RELEASE = "000000000" (CHAR)
Here is the complete test script that shows the problem:
SQL> column EMPLOYEE_ID HEADING EMPLOYEE|ID Format a12
SQL> column FIRST_NAME HEADING FIRST|NAME Format a10
SQL> column LAST_NAME HEADING FIRST|NAME Format a12
SQL> column EMAIL Format a30
SQL> column PHONE_NUMBER HEADING PHONE|NUMBER Format a12
SQL> column HIRE_DATE HEADING HIRE|DATE Format a12
SQL> column SALARY Format a5
SQL> column JOB_ID HEADING JOB|ID Format a6
SQL> column MANAGER_ID HEADING MANAGER|ID Format a12
SQL> column DEPARTMENT_ID HEADING DEPARTMENT|ID Format a13
SQL> SELECT * FROM employees;
EMPLOYEE_ID FIRST_NAME LAST_NAME EMAIL PHONE_NUMBER HIRE_DATE SALAR JOB_ID MANAGER_ID DEPARTMENT_ID
362 Tracy Freeman [email protected] 0544456377 10/28/2009 8013 879 165 1100
598 Deborah Hutch [email protected] 0522915345 9/11/2009 6027 927 147 2500
282 Steve Weber [email protected] 0582564427 9/17/2012 17825 101 147 2600
710 Shawn Winans [email protected] 0584555378 7/19/2004 7713 879 147 1100
452 Marlon Costa [email protected] 0587903317 10/24/2010 9695 354 158 1500
198 Pamela Dalton pamela.dalton@innovateecommerc 0525647730 11/4/2004 20890 101 171 1100
987 Christma Maxwell [email protected] 0587166637 11/14/2001 18865 198 146 1700
698 Joey Sweet [email protected] 0587757460 1/17/2007 8136 947 198 2100
145 Armin Preston [email protected] 0575161830 3/22/2009 12772 735 839 1600
159 Aida Rourke [email protected] 0574977531 8/24/2010 9779 421 453 2400
165 Natalie Murdock [email protected] 0583019470 2/28/2001 8665 354 402 1700
158 Lynette Kravitz [email protected] 0523285052 1/3/2009 9344 735 734 2700
12 rows selectedThe width works fine, but the two-line column name doesn't work.
Thanks for the help -
Excel tables... columns and row formatting after I update the indesign page
When my excel table gets updated in indesign I lose formatting (hight/wide) for the columns&rows. There are 26 columns and each one is a difference size. Do I have to formatting (hight&wide) each column and row every time the excel table is updated?
We have many publications with statistical tables, which are done in excel. We want to try to do some publications with only tables and do it in-house. The problem is when we place the table in indesign and finish formatting the table. We will get a updated table that needs to be updated in indesign. But when we do we update we lose all of the indesign formatting. Fixing the fonts, type size, etc is easy but how do we get back the all column widths.
-
How to lpad and format a number column
Hi,
I have a requirement to format a number column and then lpad with '*' to 12 characters. For example if the column value is 1234560 then i have to display it as *****1,234,560.00. I tried using <?xdofx:lpad(format-number:AMOUNT;'999G999D99',12,'*')?> and <?xdofx:lpad(to_char(AMOUNT,'999,999,99.99'),12,'*')?>.
Can any1 suggest me how to lpad and format the value.
Thanks in advance.Hi,
Use the following syntax for the lpad function, and use the MS word format mask for the formatting part. <?xdofx:lpad(AMOUNT,12,'*')?> -
I have a numbers spreadsheet for tracking company data. I want to copy the format of the spreadsheet (rows, columns,and formulas) but have all of the data fields be blank for the new year. How do I do that?
click and hold on one cell, then drag to select the range, then release, then type the delete key. Only inlude cells in the range you do not want to keey the contents of the cell. You can remove one-off cells by holding the command key and clicking cells to add or remove as needed.
You can download the Numbers users guide here:
http://support.apple.com/manuals/#productivitysoftware -
List all of the existing column and there column format and data format?
Hello Gurus,
I am new to OBIEE and i have a requirement to verify the column format and data format for all of the existing column while generating a analysis report. Is there any way i can list down all of the columns which are exposed and list there column format and data format?
For checking the individual column properties i know there is an option called 'Column Properties' but want to know all in once go.
Kindly help me and thanks in advance.
ThanksI don't think you have anything in answers to get that, Go to Repository and Utilities -> Generate Metadata Dictionary that will give columns and datatype.
Award points if it helps
~Srix -
Logical column currency format properties at rpd level?
I need to show the currency amount with dollar symbol for a logical column and that should happen at rpd level.
Is there anyway we could do that ?
thank youHi User.
You can have logical column name as 'Amount in $' or 'Amount in Dollar'
this is the best practice..
Then if you want value to be suffixed by $ , you can go for data formatting in column properties.....
this is commonly used....
mark if Correct/helps .
fiaz -
I need to convert PDF to Excel, however, columns and tabs make many merged cells and many blank columns. In addition to not separate the columns correctly, I see many not separate lines together in the same cell. I'm even thinking that Adobe Acrobat Pro DC has limitations. There is no way to define what points in columns to force break column? Nor create many columns that are useless? How does text to column in Excel, fixed size when we import text, and define where the breaks have columns?
Google Tradutor para empresas:Google Toolkit de tradução para appsTradutor de sitesGlobal Market Finder
Desativar tradução instantâneaSobre o Google TradutorCelularComunidadePrivacidade e TermosAjudaEnviar feedbackPDF does not contain columns, rows, formats, styles, or other aspects of word processing or spreadsheet file formats.
This is because PDF is decidedly not a word processing or spreadsheet file format or something "like" one of those.
(see ISO 32000 for what PDF "is")
What can optimize the export of PDF page content is to start with a well-formed tagged PDF (ISO 14289-1, PDF/UA-1 compliant).
Without that export is what it is and one performs whatever content cleanup is needed using the native application for the export file (MS Word or Excel).
Be well... -
ALV display column and row wise
hi experts,
Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
e.g.display format.
PO Type Shipping Date Invoice Num PCS # Po No. Cust Name Terms Open Balance
Current
Total Current
1 - 15
Total 1 - 15
16-30
Total 16-30
31 - 60
Total 31 - 60
61 - 90
Total 61 - 90
> 90
Total > 90
TOTALhi Lakshman,
i want report for customer open invoices that is aging report,
so depens on due days as per ranges shown in my question like 1--15 days,
15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
please send me any proper solution.
Thanks and Regards,
Yogesh -
I am developing an ETL tool which has to create SSIS packages dynamically (and later execute them without being edited in Data Tools). One of my proto type scenarios is a simple data flow from a flat file to a flat file - without anything in between.
However there is a problem with the columns of the flat file destination - it says it doesn't have any.
Saving the package to XML and opening the destination component in the advanced editor (tab "Input and Output Properties") really shows that are no input columns defined. One click on the tab "Column Mappings" however solves the
problem. The columns and the mapping are generated, the package can run.
I already tried to place "ReinitializeMetaData()" calls nearly anywhere in the code, for both components, unfortunately without success:
destinationComponentWrapper.AcquireConnections(null);
destinationComponentWrapper.ReinitializeMetaData();
destinationComponentWrapper.ReleaseConnections();
The actual error during validation is (When the line for column mapping in the code below is commented out):
"0xC020201B - The number of input columns for Flat File Destination.Inputs[Flat File Destination Inputs] cannot be zero"
I am also trying to insert a column mapping - this leads to a com error: 0xC020201B
In this case I am wondering why Data Tools tell me that there are no input columns yet I can iterate over them - they just don't have a valid ID (0x8000004B / -2147483573) which is then causing the 0xC020201B.
See also "PROBLEM HERE" marker in the code below.
How can I make the destination component recognize the columns programmatically, as when I click on the "Column Mappings" tab of the advanced editor of the component in Data Tools?
Here is the complete proto type code:
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dts = Microsoft.SqlServer.Dts;
namespace msdatapipe
class Program
static void Main(string[] args)
Dts.Runtime.Application application = new Dts.Runtime.Application();
Dts.Runtime.Package package = new Dts.Runtime.Package();
package.Name = "Data Commander DTS Package";
// ADD PIPELINE TASK
Dts.Runtime.Executable pipelineExecutable = package.Executables.Add("STOCK:PipelineTask");
Dts.Runtime.TaskHost pipelineTaskHost = (Dts.Runtime.TaskHost)pipelineExecutable;
pipelineTaskHost.Name = "Data Commander Pipeline Task";
Dts.Pipeline.Wrapper.MainPipe pipelineTask = (Dts.Pipeline.Wrapper.MainPipe) pipelineTaskHost.InnerObject;
// ADD SOURCE COMPONENT TO THE PIPELINE TASK
String sourceFilePath = "C:\\cmi\\tmp\\data.csv";
Dts.Runtime.ConnectionManager sourceConnectionManager = package.Connections.Add("FLATFILE");
sourceConnectionManager.ConnectionString = sourceFilePath;
sourceConnectionManager.Name = "Source Connection";
sourceConnectionManager.Description = "Source Connection Manager";
sourceConnectionManager.Properties["ColumnNamesInFirstDataRow"].SetValue(sourceConnectionManager, "True");
sourceConnectionManager.Properties["Format"].SetValue(sourceConnectionManager, "Delimited");
sourceConnectionManager.Properties["TextQualifier"].SetValue(sourceConnectionManager, "\"");
sourceConnectionManager.Properties["CodePage"].SetValue(sourceConnectionManager, "65001");
sourceConnectionManager.DelayValidation = false;
// START --- MANUALLY READ COLUMNS FROM TEXT FILE AND ADD TO SOURCE CONNECTION MANAGER COLUMNS
IDTSConnectionManagerFlatFile100 sourceConnectionInterface = sourceConnectionManager.InnerObject as IDTSConnectionManagerFlatFile100;
using (StreamReader reader = new StreamReader(sourceFilePath))
String firstSourceFileLine = reader.ReadLine();
String[] columnNames = firstSourceFileLine.Split(',');
for (int i = 0; i < columnNames.Length; ++i)
columnNames[i] = columnNames[i].Substring(1, columnNames[i].Length - 2);
IDTSConnectionManagerFlatFileColumns100 sourceColumns = sourceConnectionManager.Properties["Columns"].GetValue(sourceConnectionInterface) as IDTSConnectionManagerFlatFileColumns100;
IDTSConnectionManagerFlatFileColumn100 column = null;
foreach (String columnName in columnNames)
column = sourceColumns.Add();
column.DataType = DataType.DT_TEXT;
column.ColumnDelimiter = ",";
column.TextQualified = true;
(column as IDTSName100).Name = columnName;
Console.WriteLine(columnName);
column.ColumnDelimiter = "\r\n";
// END --- MANUALLY READ COLUMNS FROM TEXT FILE AND ADD TO SOURCE CONNECTION MANAGER COLUMNS
sourceConnectionInterface.RowDelimiter = "\r\n";
Dts.Pipeline.Wrapper.IDTSComponentMetaData100 sourceComponent = pipelineTask.ComponentMetaDataCollection.New();
sourceComponent.Name = "Flat File Source";
sourceComponent.ComponentClassID = "DTSAdapter.FlatFileSource";
sourceComponent.ValidateExternalMetadata = true;
CManagedComponentWrapper sourceComponentWrapper = sourceComponent.Instantiate();
sourceComponentWrapper.ProvideComponentProperties();
// LINK CONNECTION TO THE SOURCE COMPONENT
sourceComponent.RuntimeConnectionCollection[0].ConnectionManager = Dts.Runtime.DtsConvert.GetExtendedInterface(sourceConnectionManager);
sourceComponent.RuntimeConnectionCollection[0].ConnectionManagerID = sourceConnectionManager.ID;
// Connect to the data source, and then update the metadata for the source.
//sourceComponentWrapper.Validate();
//sourceComponentWrapper.ProvideComponentProperties();
sourceComponentWrapper.AcquireConnections(null);
sourceComponentWrapper.ReinitializeMetaData();
sourceComponentWrapper.ReleaseConnections();
// ADD DESTINATION CONNECTION MANAGER
Dts.Runtime.ConnectionManager destinationConnectionManager = package.Connections.Add("FLATFILE");
destinationConnectionManager.ConnectionString = "C:\\cmi\\tmp\\data_out.csv";
destinationConnectionManager.Name = "DatComConOut";
destinationConnectionManager.Description = "Data Commander Connection Manager";
destinationConnectionManager.DelayValidation = false;
destinationConnectionManager.Properties["Format"].SetValue(destinationConnectionManager, "Delimited");
destinationConnectionManager.Properties["TextQualifier"].SetValue(destinationConnectionManager, "\"");
destinationConnectionManager.Properties["CodePage"].SetValue(destinationConnectionManager, "65001");
// ADD DESTINATION COMPONENT
Dts.Pipeline.Wrapper.IDTSComponentMetaData100 destinationComponent = pipelineTask.ComponentMetaDataCollection.New();
destinationComponent.Name = "Flat File Destination";
destinationComponent.ComponentClassID = "DTSAdapter.FlatFileDestination";
destinationComponent.ValidateExternalMetadata = true;
CManagedComponentWrapper destinationComponentWrapper = destinationComponent.Instantiate();
destinationComponentWrapper.ProvideComponentProperties();
destinationComponent.RuntimeConnectionCollection[0].ConnectionManager = Dts.Runtime.DtsConvert.GetExtendedInterface(destinationConnectionManager);
destinationComponent.RuntimeConnectionCollection[0].ConnectionManagerID = destinationConnectionManager.ID;
// CREATE PATH
Dts.Pipeline.Wrapper.IDTSPath100 pipelinePath = pipelineTask.PathCollection.New();
pipelinePath.AttachPathAndPropagateNotifications(sourceComponent.OutputCollection[0], destinationComponent.InputCollection[0]);
// DESTION CONNECTION MANAGER COLUMNS
IDTSConnectionManagerFlatFile100 destinationConnectionInterface = destinationConnectionManager.InnerObject as IDTSConnectionManagerFlatFile100;
IDTSConnectionManagerFlatFileColumns100 destinationColumns = destinationConnectionManager.Properties["Columns"].GetValue(destinationConnectionManager) as IDTSConnectionManagerFlatFileColumns100;
// START --- MANUALLY READ COLUMNS FROM DESTINATION COMPONENT AND ADD THEM TO DESTIONATION CONNECTION MANAGER COLUMNS
foreach (IDTSInput100 input in destinationComponent.InputCollection)
IDTSVirtualInput100 virtualInput = input.GetVirtualInput();
IDTSConnectionManagerFlatFileColumn100 column = null;
foreach (IDTSVirtualInputColumn100 virtualInputColumn in virtualInput.VirtualInputColumnCollection)
column = destinationColumns.Add();
column.DataType = DataType.DT_TEXT;
column.ColumnDelimiter = ",";
column.TextQualified = true;
(column as IDTSName100).Name = virtualInputColumn.Name;
column.ColumnDelimiter = "\r\n";
// END --- MANUALLY READ COLUMNS FROM DESTINATION COMPONENT AND ADD THEM TO DESTIONATION CONNECTION MANAGER COLUMNS
// NEED TO CREATE NEW META DATA AFTER COLUMNS
destinationComponentWrapper.AcquireConnections(null);
destinationComponentWrapper.ReinitializeMetaData();
destinationComponentWrapper.ReleaseConnections();
// MAP INPUT COLUMNS
foreach (IDTSInput100 input in destinationComponent.InputCollection)
IDTSVirtualInput100 virtualInput = input.GetVirtualInput();
foreach (IDTSVirtualInputColumn100 virtualInputColumn in virtualInput.VirtualInputColumnCollection)
Console.WriteLine("VIC " + virtualInputColumn.Name + "(" + virtualInputColumn.ID + ")");
destinationComponentWrapper.SetUsageType(input.ID, virtualInput, virtualInputColumn.LineageID, DTSUsageType.UT_READONLY);
foreach (IDTSExternalMetadataColumn100 metadataColumn in input.ExternalMetadataColumnCollection)
if (virtualInputColumn.Name.Equals(metadataColumn.Name)) {
// PROBLEM HERE:
// An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in msdatapipe.exe
// Additional information: Exception HRESULT: 0xC0047072
// at this point is virtualInputColumn.ID = -2147483573
destinationComponentWrapper.MapInputColumn(input.ID, virtualInputColumn.ID, metadataColumn.ID);
// if the code is commented out and the program rerun there is a package validation error instead: 0xC020201B
// 0xC020201B - The number of input columns for Flat File Destination.Inputs[Flat File Destination Inputs] cannot be zero
// NEED TO CREATE META DATA AFTER COLUMNS HAVE BEEN ADDED TO THE DESTIONATION MANAGER
// AND USAGE TYPE HAS BEEN SET OR WE'LL GET A VS_NEEDSNEWMETADATA
destinationComponentWrapper.AcquireConnections(null);
destinationComponentWrapper.ReinitializeMetaData();
destinationComponentWrapper.ReleaseConnections();
// SAVING DTSX PACKAGE FOR DEBUGGING
application.SaveToXml("C:\\Users\\CMI\\documents\\visual studio 2010\\Projects\\SSIS Tutorial\\SSIS Tutorial\\generated.dtsx", package, null);
Microsoft.SqlServer.Dts.Runtime.DTSExecResult packageResults = package.Execute();
Console.WriteLine("package execution result: " + packageResults.ToString());
// Basic check for errors
foreach (DtsError error in package.Errors)
Console.WriteLine("ErrorCode : 0x{0:X}", error.ErrorCode);
Console.WriteLine(" SubComponent : {0}", error.SubComponent);
Console.WriteLine(" Description : {0}", error.Description);
Console.WriteLine("press the return key hard to continue...");
Console.Read();I suggest you revise your code against examples given in http://blogs.msdn.com/b/mattm/archive/2008/12/30/samples-for-creating-ssis-packages-programmatically.aspx
Arthur My Blog -
Line graph date sorting and formatting
Hi Gurus
We've recently upgraded to 11.1.1.7 and noticed that our Publisher line charts with date on the x-axis are no longer sorting correctly i.e. May comes before March. The reason for this is because in <11.1.1.7 we have a formatted date mask (to_char) in our data model but sorted by the underlying canonical date which worked. Now in 11.1.1.7 it is no longer sorting by the data model sort but by the formatted date string therefore numeric values of 30 April sorted after 1 May.
We have tried a number of options to resolve:
1. using the canonical date and sorting on that corrects the sort problem but the default formatting used in long YYYY-MM-DDT00:00:00-00:00 and not readable as our chart is showing daily totals. Changing to time-series chart can allow you to format the date but see problem 2 next...
2. Time series = yes doesn't display the chart if we have a number of entities in our series i.e. multiple lines and the interactive viewer shows a red error icon. I think this may be due to the fact that our date range is not continuous ie we have a sparse data set.
3. Workaround we used was a bar chart (our users preference is line charts) with time series = false but the date format is still long.
Any advice / suggestions would be helpful.
Thanks
Nick.for #1: numbers does what is called a "stable" sort. Meaning that the previous sort order is preserved. i.e. do your sort in reverse order. Amount, then name, then date. Just did it with sample data and it was perfect. It keeps them in the original order, so if there is a match in name after you sort, you should see the amount still in the proper order.
#2: What in your formula isnt working? I just made a formula that did math on the columns to the left, sorted and it worked. Sorted by static data columns and the formula column. I know it was broken originally, years ago, but it seems to be working correctly now, at least in my quick test. You might have an issue if you are using formulas that refer to data on other rows or tables.
#3: yeah formatting can be a pain. But it is easier to do in the desktop program. No, you cannot get it for windows, sorry. If the formatting the only thing you need to do on the desktop side, then i dont see much tying you to it. I do 90% or more on the ipad and iphone now.
Jason -
In Report Builder 3.0, I have the following custom code entered:
Public Function SafeDivide(Numerator as String, Denominator as String) as String
Try
If Numerator = “” or Denominator = “” then
Return “-“
End if
If Numerator = “-“ or Denominator = “-“ then
Return “-“
End If
If CDbl(Numerator) =0 or CDbl(Denominator) = 0 then
Return “-“
End if
If IsNothing(Numerator) or IsNothing(Denominator) then
Return "-"
End if
Return Val( ( (CDbl(Numerator) / CDbl(Denominator) )*100 ) )
Catch
Return "-"
End Try
End Function
I call the custom code in the cell with the following equation:
=Code.SafeDivide(sum(Fields!TY_UNITS.Value)-sum(Fields!LY_UNITS.Value),sum(Fields!LY_UNITS.Value))
I have the format for the cell set to 0.00%, but it’s not being followed.
I want the result to be formatted as a Percentage, but instead I get values like:
-78.9473684210
80
300
-100
I have the format for the cell set to 0.00%, but it’s not being followed.
How do I do use the custom code and format for a percentage with 2 decimals?Hi AngP,
After testing the issue in my local environment, I can reproduce it. Based on my research, I find this issue is caused by the type of Units_VAR_Percentage cell is string, while the type of CDbl(Parameters!Var_Threshold.Value) is double, so they cannot be
compared.
To fix this issue, we can add a hidden column (Textbox91) next to the Units_VAR_Percentage column, and type =(sum(Fields!TY_UNITS.Value)-sum(Fields!LY_UNITS.Value)) /sum(Fields!LY_UNITS.Value) as the expression. Then use the expression below to control the
BackgroundColor:
=iif(iif(reportitems!Units_VAR_Percentage.Value=CStr(format(reportitems!Textbox91.Value,"0.00%")),reportitems!Textbox91.Value,0)>CDbl(Parameters!Var_Threshold.Value),"Yellow","PaleTurquoise")
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Is it possible to add new columns with format "Text" once a table is linked to a form
Is it possible to add new columns with format "Text" once a table is linked to a form in Numbers for iPhone or is it impossible and thus a serious bug?(Rating stars and numeric vales seem to work.)
Those bugs happen both for new speadsheets as well as existing onces, like the demo. When you are in the form only the numeric keyboard shows up.
Pat from the Apple Store Rosenstrasse/Germany approved that it looks like a Bug during the Numbers Workshop I was in: It is not possible to add new columns with format "Text". I reported the error for Version 1.4 but there is no update nor do I get statement of understanding the issue.Hi Knochenhort,
I see what you are talking about now. Without knowing how the program actually works, I think this is what's going on:
When you add a new column to an already existing table (with already existing formats), the new cells come already formatted like the previous column. So when you add a column to the end of the demo table, the cells are already formatted like stars, and when you add a column to the beginning, they're already formatted like number.
I think this is why it's different when if you add columns to a table with blank (unformatted) columns. In that case, the new cells aren't already "tainted" with a set format, so you can change to text format without issue.
It seems like the problem is that you can't format cells that are already formatted as "number" as "text" format (even if it doesn't look like they are, because they are blank). IMO, this is a bug! This is why you don't see this issue when adding columns to a new table, because the new cells don't already come with a format.
To workaround, you can highlight the body cells after adding the new column, and delete the cells. This will "clear" the formatting, so you can then go in the inspector, format them as text, and the correct keyboard will pop up.
Hope that helps! -
Sorting and formatting in Numbers with iPad 2
I am going to send feedback to Apple about this, but I wanted to let the community help, if I am incorrect and these things are actually possible.
1. I can only sort by one column. I want to be able to create a sort priority. For example, I want to sort four columns first by date, then by person's name, then by $ amount. Not possible on mobile Numbers.
2. I want to choose to sort only specific columns. I have a formula set up in column E that sums the cells to the left in columns C and D. My formulas break every time I sort.
3. When I copy and paste from one Numbers spreadsheet into another, the formatting from the copied sheet gets put into the pasted sheet. I want to be able to "paste format" like you can in Excel. A sort-of workaround for this is to select the cell that has the correct format (this cell has to be directly above the cells that have the wrong formatting), pull the blue select box down the column to include the cells that have the wrong formatting, click the paintbrush at the top right corner, then choose whatever formatting you need--the format that is shown as selected will be the format of the first-selected cell. You have to do this for every individual column, however. And my columns are very long -- hundreds of cells long (I'm keeping a year's worth of data).
Am I correct in that if I buy a Mac computer and Numbers for the computer, I would be able to do these edits on the Mac, and then have them show up on my iPad when it synchs with iCloud? I can't buy Numbers for a PC, can I? Being tied to a computer isn't what I want--I wanted to be able to do everything on my mobile device.
Thanks!for #1: numbers does what is called a "stable" sort. Meaning that the previous sort order is preserved. i.e. do your sort in reverse order. Amount, then name, then date. Just did it with sample data and it was perfect. It keeps them in the original order, so if there is a match in name after you sort, you should see the amount still in the proper order.
#2: What in your formula isnt working? I just made a formula that did math on the columns to the left, sorted and it worked. Sorted by static data columns and the formula column. I know it was broken originally, years ago, but it seems to be working correctly now, at least in my quick test. You might have an issue if you are using formulas that refer to data on other rows or tables.
#3: yeah formatting can be a pain. But it is easier to do in the desktop program. No, you cannot get it for windows, sorry. If the formatting the only thing you need to do on the desktop side, then i dont see much tying you to it. I do 90% or more on the ipad and iphone now.
Jason
Maybe you are looking for
-
What do i need to do for movies?
I have downloaded both videora and quicktime pro, but still cant change the dvd files into readable ipod files. I really need help and would appreciate any useful info!
-
Hi All Can anyone help, being a relative newbie to Apple Macs, I have a question that I hope someone can answer to see if the solution is feasible? I have an Apple Mac G5 Power PC. I am due to start a distance learning course from home and need to to
-
5800 v50 - camera on, but can't take pictures; wor...
a pox on nokia for this shabby excuse of a firmware update may they have hot tar funnelled up their idiot-holes in a road cone right then today's problem with the v50 update is this: the camera stops working and requires the phone to be restarted to
-
Firefox won't detect plugin in home (./mozilla/firefox/plugins)
I'm not a root user and I want to update my flash extension as it's so old that it's crashing. I thought this would be as simple as installing the plugin to the plugins folder in my home, restarting FF and done. Is there anything I need to do? -Forgo
-
I can no longer use my MIDI applications. When launching Garageband 2.0.2, I get the following error message and then the program crashes: Timeout or Timer inactive! Check other applications using Timer or MIDI (Code 0). When launching Reason 3.0.4,