• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coding Reoccuring Table to work with "Ruling" script

Explorer ,
Oct 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

My current Manual Template has a Parts Table that you Insert, but each time you insert it you have to copy and paste the second header row with "ITEM, PART NUMBER, DESCRIPTION, QTY.". I have a script called "Table Ruling" with denifies the second row of the header and if the second header row has "part" in the text - it sets the proper rulings. (ie. thin line after every second number). If the first colum ("ITEM") is blank it will remove the lines between the (what we call the) parent numbers.

 

I went to format the second row with "Paragraph Formats" and it broke the script code, since it no longer has the "Part" as plain text. Is there a way to change the current script to look for a "Paragraph Format = zCellPN" instead.

Suspected code I need to change:

                                if(dude.indexOf("PART") !== -1) //Checks for a Parts Table.

 

CurrentPartsTable.PNG

Views

201

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Oct 19, 2021 Oct 19, 2021

Fixed.... replaced all "blarg" block of code with 

if (cell.FirstPgf.Name === "zCellPN")

Thank you

Votes

Translate

Translate
Explorer ,
Oct 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

Complete code....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

If you have a Cell object, you can do something like this:

if (cell.FirstPgf.Name === "zCellPN") {
    // Do what you need to do here.
    // ...
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

I've almost got it....

 

{ 
                        topRowCell = row.FirstCellInRow;
                        cell = topRowCell;
                        cell = cell.NextCellInRow;
                        if(cell.ObjectValid())
                        {
                                blarg = cell.GetText(Constants.FTI_String);
                                dude = ""
                                if(blarg.len > 0)
                                {
                                        dude = blarg[0].sdata;
                                }
                                if(dude.indexOf("PART") !== -1) //Checks for a Parts Table.
                                {

 

 

 

I took out the "cell=cell.CellBelowInCol;" and it worked to identify the new table with just one header row.

Now I need to match "blarg = cell.GetText(Constants.FTI_String);" with
         "if(dude.indexOf("PART") !== -1) //Checks for a Parts"

What is the code "blarg = cell.______(Constants.______); that would match your "

if (cell.FirstPgf.Name === "zCellPN")

 Thank you for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2021 Oct 19, 2021

Copy link to clipboard

Copied

LATEST

Fixed.... replaced all "blarg" block of code with 

if (cell.FirstPgf.Name === "zCellPN")

Thank you

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines