changing format of cells in excel via clien_ole2

Hi all
opertating system: windows xp
Forms [32 bit] Version 10.1.2.0.2 (Production)
Database 10g

I use client_ole2 to export the data from the database to excel file and it works fine.

the problem is:-
After exporting the account number, it appears as (5.52E + 12), but the correct format is (5520530000000).

I changed the format of cells in the excel file manually after generation and it worked, but I want to change the format of the cell via coding. If anyone can help me that doing so.

___________________________________________________________________________________________________________________________________________

Here are some parts of the code


declare
-myexcelcontent CLOB.
-l_xml_body CLOB.
Number of the ARG: = 1;
Lev VARCHAR2 (100) ;--Numéro;
old_lev VARCHAR2 (100) ;--Numéro;
number x: = 1;
old_x number: = 1;
number of Temp: = 1;
cost_cent varchar2 (100);
Number of the Bank;
number of old_bank;
hParagraphFormat CLIENT_OLE2. OBJ_TYPE;

i_reporttitle VARCHAR2 (200): = 'my excel. "

COL1 VARCHAR2 (2);
COL2 VARCHAR2 (8);

number of r: = 2;
c number: = 1;
number of max_prl_code1;
i_orientation VARCHAR2 (200): = '1';
i the number: = 1;
V_LEV_NAME VARCHAR2 (100);
number of lev_noo;

/ * definition of commonly used variables and constants and exceptions * /.
ExcelID CLIENT_OLE2.obj_type;
ExcelWorkBooksID CLIENT_OLE2.obj_type;
ExcelWorkBookID CLIENT_OLE2.obj_type;
ExcelWorkSheetsID CLIENT_OLE2.obj_type;
ExcelWorkSheetID CLIENT_OLE2.obj_type;
ExcelCellID CLIENT_OLE2.obj_type;
SHEET CLIENT_OLE2.obj_type;
ExcelFontID CLIENT_OLE2.obj_type;
ExcelPageSetupID CLIENT_OLE2.obj_type;
ExcelArgs CLIENT_OLE2.list_type;
args1 CLIENT_OLE2. LIST_TYPE;
number of z: = 9;
number y: = 1;

range CLIENT_OLE2. OBJ_TYPE;
range_col CLIENT_OLE2. OBJ_TYPE;
-Define ecolors th if they must be used
color CLIENT_OLE2.obj_type;
myBlue CONSTANT number (8): = 16711680; -FF0000
myGreen CONSTANT number (8): = 65280; -00FF00
myRed CONSTANT number (8): = 255; -0000FF
myDkGreen CONSTANT number (8): = 32768; -008000
number (8) CONSTANT myBlack: = 0; -000000
-CLIENT_OLE2.set_property (ExcelFontId, 'Color', myred);

-summition variables
JOB_DESC VARCHAR2 (200);
DEGR_DESC VARCHAR2 (200);
SAL                                   NUMBER;
NUMBER OF V_HOUSE;
NUMBER OF V_EXPENSE;
NUMBER OF V_SOC;
NUMBER OF V_SON;
NUMBER OF V_TRAN;
NUMBER OF V_FUEL;
NUMBER OF V_WORK_NATURAL;
NUMBER OF V_ELECT;
NUMBER OF V_OTH_ADD;
NUMBER OF NET_SAL_PER_EMP;


CURSOR f IS


SELECT ALL PRL_HSAL_MST. PRL_CODE,
PRL_HSAL_MST. SAL_ACT_BSC,
PRL_HSAL_MST. SAL_MST_SRL,
PRL_HSAL_MST. SAL_MON,
PRL_HSAL_MST. SAL_WRK_DS,
PRL_HSAL_MST. SAL_TOT_SAL,
PRL_COSTCENTER. COSTCENTER_ID, PRL_MF. MF_ACCOUNT_NO,
PRL_COSTCENTER.COMPID C1,
PRL_MF. MF_BANK_ID, Bank. BANKARNAME,
PRL_DEPT_NODES. NODE_COMPID,
PRL_DEPT_NODES. NODE_ID,
PRL_MF. MF_LAST_SAL,
PRL_HSAL_MST.COMPID,
PRL_MF. MF_LOC_NOD_ID, PRL_MF. MF_NAME
OF PRL_HSAL_MST, PRL_MF, PRL_DEPT_NODES, PRL_COSTCENTER, PRL_COSTCENTER_DT, BANK

WHERE
-nvl (PRL_MF. MF_NATIONALITY, 0) = 1 AND
PRL_MF. PRL_CODE! = 2663
- AND PRL_MF. MF_JOB_FLAG = 1
and PRL_MF. MF_BANK_ID = Bank. BANKID
AND
PRL_COSTCENTER_DT.COMPID = PRL_COSTCENTER.COMPID AND PRL_COSTCENTER_DT. COSTCENTER_ID = PRL_COSTCENTER. COSTCENTER_ID
AND PRL_COSTCENTER_DT.COMPID = PRL_DEPT_NODES. NODE_COMPID AND PRL_COSTCENTER_DT. DEPT_ID = PRL_DEPT_NODES. NODE_ID
AND TO_NUMBER (TO_CHAR (SAL_MON, 'MM')) =: P_MONTH
AND TO_NUMBER (TO_CHAR (SAL_MON, 'RRRR')) =: P_YEAR
AND (PRL_COSTCENTER_DT. COSTCENTER_ID > =: FROM2 OR: FROM2 IS NULL)
AND (PRL_COSTCENTER_DT. COSTCENTER_ID < =: 2 OR: 2 IS NULL)
AND (MF_BANK_ID > =: DOM OR: DOM IS NULL)
AND (MF_BANK_ID < =: where: A. the NULL value)
AND (PRL_DEPT_NODES. Node_id > =: FROM1 OR: FROM1 IS NULL)
AND (PRL_DEPT_NODES. Node_id < =: TO1 OR: TO1 IS NULL)
AND PRL_HSAL_MST.COMPID =: GLOBAL.COMPID
AND PRL_HSAL_MST. PRL_CODE = PRL_MF. PRL_CODE
AND PRL_HSAL_MST.COMPID = PRL_MF.COMPID

AND - PRL_MF. PRL_CODE = 5 and
PRL_DEPT_NODES. NODE_PARENT IS NULL AND
PRL_MF. MF_LOC_NOD_ID IN)
SELECT T1. NODE_ID
OF PRL_DEPT_NODES T1
WHERE T1. NODE_COMPID =: GLOBAL.COMPID
CONNECT BY PRIOR (NODE_ID) = NODE_PARENT
START BY NODE_ID IN)
SELECT T2. NODE_ID
OF PRL_DEPT_NODES T2
WHERE T2. NODE_PARENT = PRL_DEPT_NODES. NODE_ID
)
)
AND (PRL_MF. MF_EOS_DT IS NULL OR
(PRL_MF. MF_APRV_EOS_DT > LAST_DAY (SAL_MON)) OR
(PRL_MF. MF_EOS_DT > ADD_MONTHS (LAST_DAY (SAL_MON),-1) + 1)
)
AND PRL_DEPT_NODES. NODE_COMPID = PRL_MF.COMPID
ORDER BY the Bank. BANKID, PRL_DEPT_NODES. NODE_ID, PRL_MF. PRL_CODE;
BEGIN
-message (11111111111); message (11111111111);
-OPEN EXCEL SHEET 'SERVICE REQUEST '.
-max_prl_code (max_prl_code1);
ExcelID: = CLIENT_OLE2.create_obj ('Excel.Application');
-message (3333333333); message (333333333333);
ExcelWorkBooksID: = CLIENT_OLE2.get_obj_property (ExcelID, 'Notebooks');
ExcelWorkBookID: = CLIENT_OLE2.invoke_obj (ExcelWorkBooksID, "Add");
ExcelWorkSheetsID: = CLIENT_OLE2.get_obj_property (ExcelWorkBookID, 'Worksheets');
-ExcelWorkSheetsID: = CLIENT_OLE2.get_obj_property (ExcelWorkBookID, 'vvvv');

--++***+
-start in the first sheet
ExcelArgs: = CLIENT_OLE2. CREATE_ARGLIST;
CLIENT_OLE2. ADD_ARG (ExcelArgs, 1);
ExcelWorkSheetID: = CLIENT_OLE2. GET_OBJ_PROPERTY (ExcelWorkSheetsID, 'Item', ExcelArgs);
CLIENT_OLE2. DESTROY_ARGLIST (ExcelArgs);
--++***+
for v_pat in a loop f


_________________________________________________________________

-___account _ number
ExcelArgs: = CLIENT_OLE2.create_arglist;
CLIENT_OLE2.add_arg (ExcelArgs, z);
CLIENT_OLE2.add_arg(ExcelArgs,6);
ExcelCellId: is CLIENT_OLE2.get_obj_property (ExcelWorkSheetId, 'cells', ExcelArgs);.
CLIENT_OLE2.destroy_arglist (ExcelArgs);
CLIENT_OLE2.set_property (ExcelCellId, 'Value', nvl (v_pat. MF_ACCOUNT_NO, 0));
ExcelFontId: is CLIENT_OLE2.get_obj_property (ExcelCellId, 'Police');.
CLIENT_OLE2.set_property (ExcelFontId, 'Bold', 'True');
CLIENT_OLE2.set_property (ExcelFontId, 'Size', ' 10');
CLIENT_OLE2.release_obj (ExcelFontId);
CLIENT_OLE2.release_obj (ExcelCellId);




-THE BANK. BANKID,                                        BANK. BANKARNAME
z: = z + 1;
y: = y + 1;

-Adjustment automatic columns
-auto adjustment coulumns
range: = CLIENT_OLE2. GET_OBJ_PROPERTY (ExcelWorkSheetId, 'UsedRange');
range_col: = CLIENT_OLE2. GET_OBJ_PROPERTY (range, 'Columns');
CLIENT_OLE2. INVOKE (range_col, "Automatic adjustment");
CLIENT_OLE2. RELEASE_OBJ (range);
CLIENT_OLE2. RELEASE_OBJ (range_col);

-If max_prl_code1 = v_pat. PRL_CODE then
CLIENT_OLE2.set_property (ExcelID, 'Visible', 'TRUE');
-end if;
end loop;

------------------------------------------





-CLIENT_OLE2.set_property (ExcelID, 'Visible', 'TRUE');

-... and free allocated resources, because they are no longer used by forms

CLIENT_OLE2.release_obj (ExcelWorkSheetID);
CLIENT_OLE2.release_obj (ExcelWorkSheetsID);
CLIENT_OLE2.release_obj (ExcelWorkBookID);
CLIENT_OLE2.release_obj (ExcelWorkBooksID);

CLIENT_OLE2.release_obj (ExcelID);


END;
EXCEPTION WHEN NO_DATA_FOUND THEN NULL;

For large integers its probably preferable to a text field.

args: = ole2. CREATE_ARGLIST;
OLE2. ADD_ARG (args, 'A');
column: = ole2. GET_OBJ_PROPERTY (spreadsheet calculation, "Columns", args);
OLE2. DESTROY_ARGLIST (args);
OLE2.set_property (column, 'NumberFormat', ' @');
OLE2. RELEASE_OBJ (Column);

You can also try to replace ' @' by '0' to get an integer field, but it will be rounded up problems if the integer is greater than 15.

Tags: Oracle Development

Similar Questions

  • Can we upload text cell via the text file file/excel via FDM to HFM?

    Hi all
    Can we upload text cell in HFM via FDM of text/Excel files? My goal is to have a text file in the text/Excel format cell column and make load in HFM.
    It is possible at all?

    Thank you
    Chrystelle

    Sayantan.Mondal wrote:
    Thank you for your reply SH. Can we get cell text in when you import data from text files?

    Hello

    It is not possible to load the text from the cell with the source file. But we try to do the same thing...
    We decide to map the Description2 FDM fields with the text in the cell in the source file, as in an event (such as aftFileImport) script, to play the field in the table and add text to a field Memo in MDF.
    FDM provide a method to do this: API. ArchiveMgr.fMemoAddItem

    With this method, the memo will be export to HFM as a TxtCase (you must enable in the settings of integration).

    I tried the solution and it works, but we are in the process of implementation.

    Hope this helps.

    Yves

  • Problems with copy and paste cells in Excel 2011 bold (Mac) in Ai CS5

    I have a problem with the copy of cells containing text from Microsoft Excel for Mac 2011 and sticking them in Illustrator CS5. I selects the whole cells of Excel, open a blank document AI, and without anything selected so the format is retained, I paste the cells.

    The question arises with the copy resulting cells in artificial intelligence. The guy who was "BOLD" in Excel's "BOLD" in artificial intelligence... but not really. HERE pastes the text in bold, not bold, but then makes a copy of the same text, put a line on it, then that puts ordinary text, so it seems "BOLD". But now I have two copies of the same word, a regular and a related on it just above the other.

    This normally wouldn't be a problem, but I need to modify this info in here later - and there is a second problem. When I paste the text bold in Excel in artificial intelligence, the word that result is divided into individual blocks of text for each letter. Rather than keep the word in full as an editable text block, I now click on each letter to change.

    There is a catch 22 to these problems: these cells I copy to include bold and normal text and ordinary text pasted in here without any problems (even blocks of text are kept). Therefore, the bold text that is causing problems

    I have a feeling it has to do with how the individual cells are formatted in Excel, but I need to copy the data of many different cells made by several people, so I'm at a loss to know what to do. Help, please!

    I've included a screenshot of what happens with cells after I paste them in artificial intelligence. I moved the exposed '5' to the top, so you can see the '5' on a regular basis below.

    Screen Shot 2013-01-15 at 1.32.07 PM.png

    Can be as simple as the font you're using. MS products can be a fake fat, products Adobe don't like it.

    I am running Windows, use HAVE 5.1 and Excel 2010 however. I have no problems of collage of paintings and retention of the text in the form of text, "BOLD" attributes and everything.

    So try to use a font that is known for having a "BOLD" Variant or something stock applications such as Calibri. If Calibri works, it may be the police. Here again, don't know if the Mac has Calibri.

    Mike

  • How can I make changes on a worksheet Microsoft Excel, which was sent to me?

    How can I make changes to a spreadsheet Excel that was sent to me?

    As long as it's not too exotic, you should be able to open it with numbers, make your changes, and then export as Excel again and send to the sender.

    Maybe a few fonts change notifications when you open an Excel file in a first time (e.g. lack of fonts, then a substitution).

  • How do the cells in a column to reflect the changes in the cells above

    I'm playing with making a tracker that provides essentially future balances of loans, savings, etc., based on an average of how much I pay on them. Right now I have a "Savings" column with each cell in the column, which represents a single pay period. The value of each cell transcribed the current balance of my savings at this time here in the future if I add X amount of dollars to him each paycheck. I also factor if I know I will receive more money than the period which I will devote to savings, as a refund of the tax to pay. Currently if I make an adjustment to a cell (say, $ 50), I manually have to add $50 to each cell below the column, so the estimates all reflect this change. So here's my question: is there a function I can use to automatically calculate and perform this change in the following cells if I make a change in a cell above? Thanks in advance and sorry if this is confusing.

    Hi tigglebitties,.

    I don't know what you want to do. Take a look in the Menu > file > New model selector > personal finance for different models that can give you some ideas.

    Please call with questions.

    Kind regards

    Ian.

  • write data to the cell in excel

    Hello

    I am trying to write data to a cell in excel. When I'm looking in sample program, I felt a bit difficult to understand.

    I have written code to read data from a particular cell that works well. I am facing difficulties in writing data in the cell. pls help someone.

    to read a data cell that works

    status is Excel_RangeGetItem (rangeHandle, NULL, CA_VariantInt (i + 1), CA_VariantInt (j + 1), & MyVariant);.
             
    Get the pointer of SHIPPING
    status = CA_VariantGetDispatch (& MyVariant, & MyDispatch);
               
    Create a Range object pointer for SHIPPING
    status = CA_CreateObjHandleFromIDispatch (MyDispatch, 0, & ExcelSingleCellRangeHandle);
               
    Get the value of the range of simple cells
    status = Excel_GetProperty (ExcelSingleCellRangeHandle, NULL, Excel_RangeValue2, CAVT_VARIANT, & MyVariant);
              
    status = CA_VariantGetCString (& MyVariant, &val);)
    strcpy (CellValue, Val);

    to write data in a cell

    status is Excel_RangeSetItem (rangeHandle, NULL, CA_VariantInt (i + 1), CA_VariantInt (j + 1), MyVariant);.
             
    status = CA_VariantSetDispatch (& MyVariant, & MyDispatch);
               
    status = CA_CreateObjHandleFromIDispatch (MyDispatch, 0, & ExcelSingleCellRangeHandle);
       
    status = Excel_SetProperty (ExcelSingleCellRangeHandle, NULL, Excel_RangeValue2, CAVT_VARIANT, & MyVariant);
             
    status = CA_VariantSetCString (& MyVariant, writedata);

    I know I made a mistake in the code above.

    Thank you very much, Roberto. You have solved my problem.

  • Programmatically change the selected cell/line of control multi-column listbox

    I want to programmatically change the selected cell of a multicolumn list box whose selection Mode is set to highlight the whole line.  I would use this to highlight the line whatever the list box, I chose to.  It would work the same way if the user has clicked on a line to select and highlight that particular line.  Set Active cell does not fulfill this.

    Steve

    Try to use the property value; p

  • When I enter the "Eubacterium' infirmum text in a cell in Excel, he eats the leading". " It's killing later logic based on obtaining all text. How to repair Excel to stop eating "of text strings?

    When I enter the "Eubacterium' infirmum text in a cell in Excel, he eats the leading". "  It's killing later logic based on obtaining all text.  How to repair Excel to stop eating "of text strings?

    In Excel, an apostrophe at the beginning of a text string has a special meaning as a character of text-alignment prefix . To start a string with an apostrophe, type two of them.

  • How to draw a line on Illustrator uses Excel via VBA coordinates

    Void line_viaCoordinates()

    Set appRef = CreateObject ("Illustrator.Application")

    IAPP Dim As New Illustrator.Application

    Dim idoc as Illustrator.Document

    Dim Illustrator.PathItem As isquare

    Define the idoc = iapp. Documents.Add

    Dim lineList (4)

    lineList (0) = Array (50, 50)

    lineList (1) = Array (50, 100)

    lineList (2) = Array (100, 100)

    lineList (3) = Array (150, 80)

    lineList (4) = Array (90, 200)

    "my question is: how to turn this painting (50, 50) in table (LINE B1, RANGEC1)..." So whatever the number, I type this cell to Excel, Illustator it will use as input to draw the line.

    Define isquare idoc =. PathItems.Add

    iSQUARE. SetEntirePath (lineList)

    Isquare = Nothing set

    Define the idoc = Nothing

    Define the iapp = Nothing

    End Sub

    You can use the range or cell objects to get a reference to your range values

    in this example, the data is on the A1 to B5

    Dim lineList(4)
    
    lineList(0) = Array(Cells(1, 1).Value, Cells(1, 2).Value)
    lineList(1) = Array(Cells(2, 1).Value, Cells(2, 2).Value)
    lineList(2) = Array(Cells(3, 1).Value, Cells(3, 2).Value)
    lineList(3) = Array(Cells(4, 1).Value, Cells(4, 2).Value)
    lineList(4) = Array(Cells(5, 1).Value, Cells(5, 2).Value)
    
  • Export to Excel, via a link on the page of action

    I have two questions.

    (1) how can I export to excel, via a link.  For example I have a form, a user clicks submit, and I've got cfoutput data in a table on the same page (action page is identical to the entry page).  Now, once the output data, I'd like a link on this page so that the user can click and it will export the table to Excel.

    I tried:

        <cfheader name="Content-Disposition" value="attachment; filename=test.xls">
        <cfcontent type="application/msexcel">
        <cfoutput query="qTest">
        <table>
        <tr>
        <th>Account</th>
        <th>Amount</th>
        </tr>
        <tr>
        <td>#qTest.ACCOUNT#</td>
        <td>#NumberFormat('#qTest.TotalAmt#', "_(999,999,999.99)")#</td>
        </tr>
        </table>
        </cfoutput>

    But once the page is loaded, he tries to export automatically.  How can I get to export via a link?

    Also, someone suggested wrapping the cfoutput in a < cfsavecontent variable = "xyz" > tag, but once I have it, how do I insert the variable 'xyz' in the tag < cfcontent >?  Or where can I use it?

    Thank you guys

    The variable that contains the output table.  Just put another #session.export # in the appropriate place in your logic will be displayed on the screen using the scenario.

  • Date format changes when you put an Excel file in Indesign

    I have an Excel sheet with the date format DD-MM-YYYY.

    I need to put this Excel file in Indesign - and the link, so I can update the Excel sheet and put it auto updated in Indesign.

    So I put my file management preferences to "create links when placing text years Spreadsheeet Files", go to file > Place and choose my Excel sheet. In the import option, I don't see any option to keep the date format. But when I look at the table in Indesign changed the date format DD/MM/YYYY.

    The same thing happens if I chose 'To format table' or 'Unofrmatted'. That if I copy and paste the table actually the show dates above right. But it's not a solution for me, since I need the linked Excel file!

    So, do I did wrong? Is there some settings in Indesign to preserve the format of Excel date instead of change?

    I use the Mac version and I get different results with the 2011 and older versions. I tested the top down and the values are different. On windows, MS Office is better, so I often work on Mac, but change to Windows, then save again with a new file name, and use it. But not everyone has this opportunity.

    With Excel on Mac is a huge problem that. and exchanged everwhere in its German version. It's ok in numbers, as German and English exchanged. and,

    But with the files exported as CSV, it becomes a huge problem, because Excel separates files CSV Comma, but pointed, and no other application (and neither itsself Excel) will read these files correctly. Excel on Mac is so good for the calculation, but if you go information in another application it is a mess.

  • check-in 3 cells in Excel

    Hello

    I'm trying to measure a physical quantity and save per day in an Excel file and I want to display the data saved with their date and time corresponding to the Excel file in 3 different cells but my program to display the saved data with their correspondents date and time in the 1 cell in the file excel. I was wondering if you can help me please in this way

    Impatient to receive from you

    1. You use characters write file VI. This does not create an Excel file. An Excel workbook is a proprietary format. LabVIEW not in reading/writing Excel workbooks. Read/write Excel workbooks, you can use ActiveX. Search the forum for examples and look for links for the examples in the thread Excel.
    2. You create a file with a .csv extension. This is considered a standard extension to a CSV file. A CSV file is a text file. The default delimiter for columns in the CSV file is a comma, not a tab. When you try to directly open a .csv in Excel file by double-clicking the file on your hard drive, it tries to use a comma as a delimiter for columns. Since there is nothing, he puts everything in the first cell. Change the delimiter of comma or change the .txt extension. If you change the .txt extension and then Excel you can select file-> open and tell him to use a tab as a delimiter. This is normal. It is not a bug.
    3. I have no idea why you're still using characters write file VI in the first place, unless it was code that was written in a previous version of LabVIEW. Using Write to the spreadsheet file will probably be easier. It is polymorphic.
    4. I have no idea why you are using the convert VI of dynamic data to create a table on one float. That's what building table is for.
    5. You have no way to stop the program, unless you click Cancel in the toolbar. Replace the Boolean constant plugged into the socket with a stop button on the control of the loop.
  • Numbers automatically selects the "date format" for cells.

    Numbers automatically format selects 'date' of certain cells.

    I need "numbers."

    I want to calculate simple interest due on the amount, the interest rate and number of days.

    When I input "number" format of the result cell and calculate the amount * rate * number of days divided by 365 always automatically shows something unwanted and the format "date." Furthermore, I'm not able to change the AutoFormat ("date") in "number".  How to bypass this automatic selection?

    Thanks in advance

    UbiUbu

    Maybe you can share what, exactly, you enter in a cell.  A screenshot is also useful.

    Here's a way to do what I think you want:

    Enter amounts in cells B1, B2 and B3

    Select cell B6, and type (or copy and paste it here) the formula:

    =B2*B3*B1/365.25/100

    shortcut for this is:

    B6=B2*B3*B1/365.25/100

  • Read excel cell when excel is already open

    Hello

    I want to read a specific cell of a spreadsheet with excel already open. LabVIEW has only to read the cell and can't open excel.

    I have several examples that show:

    1. Labvview open excel

    2. Select excel file

    3. Select the workbook

    4. Select Sheet

    5. Select the cell

    6. read the cell

    7. close the workbook

    8. close excel

    In my vi I only need 3 to 6 step

    Thanks for your help

    Djamel

    The joint vi (LabVIEW 2012) will return the value in cell "A1" "Sheet1" of the already opened excel workbook "Book1".

    Change the values for your specific names in the workbook and worksheet and of cells needed.

    The value returned is a Variant needs to be converted with 'Variant to data' according to the type of data

    Ken

  • Change all the cells in all Tables

    Hello

    This is my first post, but I have worked with InDesign scripting for a while and I'm pretty fluent in Javascript.

    My scenario is, I have a document with about 1,000 pages. On each page is a table with about 100 cells, 10 rows and 10 columns with a description to the 0-space of each, followed by a floating point number (in the form of a percentage) in all the other cells. What I need to do, is to put the color of the text of each percentage in each line according to its value. For example, in the first row, each percentage less than 80.00% is red, while everything should be green. All I have to do is color based on their value. However, this value changes throughout the 10 different lines.

    I could make a script that would allow me to go over each cell in the row 1 of each table on one page, then iterate over all the other pages in the same way before continuning on line 2. It is a long process, typically leading to a crash in any document more than ~ 30 pages long. Since I want to run it on a document of more than 1000 pages gigantic (granted there are only 1 table per page), it becomes a bit unrealistic...

    I am just curious to know if there is a way to run it in a more realistic way. There must be a quick way to iterate over each line, simply check the values, green or red brand and do with it. My idea was to, perhaps, make each row of the table on one page and then go on the next page, as opposed to the 1st row on the entire document, followed in line 2 and so on and so forth? Maybe this would help?

    The code is FARRR too long to post here, but the rough process I have at the moment is the following:

    1.) configuration variables to define the cells of each row:

    var allTables = app.activeDocument.stories.everyItem ().tables.everyItem ();

    var firstRowCells = allTables.rows [1].cells.everyItem () .getElements ();

    (There must be a way to optimize that?)

    2.) call a bunch of statements for the amount of lines, I need process (10) by table:

    for (var i = 0; i < firstRowCells.length; ++ I)

    {

    var a = parseFloat (firstRowCells [i] .silence);

    If (one < = 80.00)

    {

    firstRowCells [i] .texts .appliedCharacterStyle [0] = "FAILURE Red."

    } ElseIf (a > 80,00) {}

    firstRowCells [i] .texts [0] .appliedCharacterStyle = "Green PASS";

    }

    }

    .. .the all this (about 10 for instructions) translates into a pretty rough fall. Does anyone have a solution? Or at least a tip of optimization?

    Thank you

    -Chris

    It's a bit more stylish

    // by Trevor http://forums.adobe.com/message/4623699#4623699
    app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.ENTIRE_SCRIPT, "Format Table");
    function main()
    {
    var myCellStyle=["80","80","80","40","50","30"],v=myCellStyle.length,
        myTables=app.documents[0].stories.everyItem().tables.everyItem();
    while (v--)
    {
    myTables.rows[v+1].cells.itemByRange(2,5).appliedCellStyle=myCellStyle[v];
    myTables.rows[v+1].cells[7].appliedCellStyle=myCellStyle[v];
    }
    myTables.cells.everyItem().clearCellStyleOverrides (1);
    myTables.rows[1].cells[6].appliedCellStyle="Trend";
    }
    

    Curious to know how long does it to treat 1000 dashboards

    Trevor

Maybe you are looking for

  • I blocked a site but child can always access

    My child has the value "Web filtering: general interest" and I " *.youtube.com/*" on their blocked list, but they still lack access as 'http://www.youtube.com/watch?v=Gv36dogOadw '. I tried to update the setting manually on PC - makes no difference.

  • Can not view my firewall settings

    When I try to view my security setting the parameters of the firewall I get a message that due to an unidentified problem, windows cannot display windows firewallParameters. This has never happened before, what could cause this and how can I solve th

  • Messages to Outlook express does not print

    Suddenly I'm unable to print my e-mail messages in Outlook Express. Only the title is printed. I use Windows XP that is perfectly up to date. I have some Norton software and do not use any other antivirus software.

  • gMail account does not succeed in Outlook 2003

    He used to work. But I had to start all over again and create new e-mail accounts in a new installation of Outlook 2003. Now, they always fail reception. I have the servers named pop3.gmail.com & smtp.gmail.com. Not checked: sign in using SPA. Logon

  • Deleted a file or an app that I think is responsible to connect my ip of the laptop on the web please help

    I accidentally deleted a file called ipweb or window something in the windows folder and now I can not connect my laptop for all the web pages it says I have an internet connection, but it's not compatible with please help me if you have any informat