005 C ා automatically generate payslip


005 C ා automatically generate payslip

In the movie like you, Gu Shengnan and Lu Jin love each other. Gu Shengnan conquers Lu Jin with delicious food and finally comes together.

005 C ා automatically generate payslip

She once said, everyone has a password, see if my key can unlock your password.

Hey,How are you doing?

I’m a professional code. Nice to meet you.

Once upon a time, I felt that the relationship between C Chen and me was very much like the rough love road between Gu Shengnan and Lu Jin.

C 訙 with strict structure is like Lu Jin with poisonous tongue. Whenever there is a mistake, he will talk about me in various jump frames.

In order to taste delicious food, Lu Jin plunges into Gu Sheng men’s house.

And I’m buried in the coding world for debugging code.

Today, I will show you the realization process of C ා automatically generating payslip.

001 preparatory work

005 C ා automatically generate payslip

  • Excel initialization

Excel instantiation declaration:

Excel._ApplicationEap = newExcel.Application();

Set Excel application visible:

Set excel path:
stringePth=AppDomain.CurrentDomain.BaseDirectory+”Payslip.xls”; “;

Open excel file:

Excel._WorkbookEbk = Eap.Workbooks.Open(ePth);

  • Word initialization

Declare instantiation of word application:

Word._ApplicationWap = newWord.Application();

Set word application visible:

Set word path:
stringPth=AppDomain.CurrentDomain.BaseDirectory+”Payslip. Doc”;

Open word file:
Word._DocumentWdc = Wap.Documents.Open(Pth);

  • Drawing tables, formatting

Set word table maximum row excel valid row-1:

intMxr = Eap.Worksheets[1].UsedRange.CurrentRegion.Rows.Count-1;

Draw table:

Table instantiation, line adding and text centering:
Word.TableWtb = Wdc.Tables[1];

002 start work

005 C ා automatically generate payslip

By S%2==1Control, using WTB.Cell(s,j).Range.Text=Eap.Worksheets[1].Cells(1,j).valueWrite the title to an odd number of lines.

005 C ා automatically generate payslip

By S=2,s+=2;i=2, I + + control, using EAP.Worksheets[1].Cells(i,j).value.ToString()Write data to even rows.

Where. ToString (“yyyy mm”)Implement date formatting.

Where. ToString (“0.00”)Format the number.

003 finishing work

005 C ා automatically generate payslip

utilizeEapsht.Kill(Eap),callKill()Method to complete the terminationExcelProcess.

005 C ා automatically generate payslip

Finally, post the code and replySource codeTo get the code source file.

005 C ා automatically generate payslip

Lu Jin said, Xie Shengnan, you are not the most beautiful, nor the ugliest.

No matter what kind of language you are learning, the best thing is what suits you.

005 C ා automatically generate payslip

I hope you can also be like love every day, even if sometimes not happy, but also adhere to life.

Maybe one day, you can also like Lu Jin, Xie Shengnan, because of efforts and embrace a better future!

———— The End ————

Recommended Today

Comparison and analysis of Py = > redis and python operation redis syntax

preface R: For redis cli P: Redis for Python get ready pip install redis pool = redis.ConnectionPool(host=’′, port=6379, db=1) redis = redis.Redis(connection_pool=pool) Redis. All commands I have omitted all the following commands. If there are conflicts with Python built-in functions, I will add redis Global command Dbsize (number of returned keys) R: dbsize P: print(redis.dbsize()) […]