Print in Excel

I'm trying to write a program which will collect the number of changes which occurred between two dates, or as a result of a CR. My question is this: how would I go about sending the number of changes, along with the CR number or the date range, to an Excel spreadsheet? Is there a way to do this?
Thanks!
josiah820 - Mon Aug 13 11:49:37 EDT 2012

Re: Print in Excel
josiah820 - Tue Aug 14 15:16:55 EDT 2012

And if this is not possible, could someone please let me know that too? I only have one more week left in my internship, and need to finish this program before then if it is possible.
Thanks!

Re: Print in Excel
Mathias Mamsch - Tue Aug 14 15:57:14 EDT 2012

josiah820 - Tue Aug 14 15:16:55 EDT 2012
And if this is not possible, could someone please let me know that too? I only have one more week left in my internship, and need to finish this program before then if it is possible.
Thanks!

There are several examples showing how to send data to an excel spreadsheet in the forum. See for example here:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14628604&#14628604

Maybe that helps, regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Print in Excel
josiah820 - Wed Aug 15 12:43:47 EDT 2012

Mathias Mamsch - Tue Aug 14 15:57:14 EDT 2012
There are several examples showing how to send data to an excel spreadsheet in the forum. See for example here:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14628604&#14628604

Maybe that helps, regards, Mathias


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Okay, I think I understand that. However, what if I don't want to do it all at once? Basically, here is the idea behind my program: The user specifies a Change Request, or a date range, and DOORS counts the number of changes made either as a result of the change request or changes made inside the date range. I then want to print the CR number or the date range in column A, and the number of changes in column B. I also want to be able to run the program more than once, while writing to the same file, in different rows. Is there any way to do this?
I attached the code, along with the Ole information, but I can't figure out how to make it print what I want it to print, or to create a new file and always write to the file?
Thanks for all of your help!
Josiah
Attachments

attachment_14875832_Track_Changes.dxl

Re: Print in Excel
Mathias Mamsch - Fri Aug 17 03:41:37 EDT 2012

josiah820 - Wed Aug 15 12:43:47 EDT 2012
Okay, I think I understand that. However, what if I don't want to do it all at once? Basically, here is the idea behind my program: The user specifies a Change Request, or a date range, and DOORS counts the number of changes made either as a result of the change request or changes made inside the date range. I then want to print the CR number or the date range in column A, and the number of changes in column B. I also want to be able to run the program more than once, while writing to the same file, in different rows. Is there any way to do this?
I attached the code, along with the Ole information, but I can't figure out how to make it print what I want it to print, or to create a new file and always write to the file?
Thanks for all of your help!
Josiah

From what I saw in you file you just took the code from the example and inserted it in your file. You need to read the code, that puts stuff to Excel in the examples and apply it, so instead you export whatever you want. If you want to write the same file over and over again, then you need to extend the code by opening the existing excel file, instead of adding a new workbook. Then you would somehow need the information where to start writing in the file (i.e. which row is empty). You could write and read that in a Workbook property or find it in the worksheet.

For all of this you need to call different excel function. All of them are already with examples in the forum. So if you use the search function intensively, I am sure you will come over some code that will help you. Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: Print in Excel
llandale - Fri Aug 17 11:14:28 EDT 2012

josiah820 - Wed Aug 15 12:43:47 EDT 2012
Okay, I think I understand that. However, what if I don't want to do it all at once? Basically, here is the idea behind my program: The user specifies a Change Request, or a date range, and DOORS counts the number of changes made either as a result of the change request or changes made inside the date range. I then want to print the CR number or the date range in column A, and the number of changes in column B. I also want to be able to run the program more than once, while writing to the same file, in different rows. Is there any way to do this?
I attached the code, along with the Ole information, but I can't figure out how to make it print what I want it to print, or to create a new file and always write to the file?
Thanks for all of your help!
Josiah

Not sure this is a good option, but you could have a single *.csv file housing your results, and display that file with Excel. You're program "appends" this text-based file with whatever results you want; and invokes Excel to display it. (As opposed to opening excel, sending it cell information using OLE commands, then commands Excel to save-as the file).

My code finds the "excel.exe" file in an excessively clumsy way, then issues:
  • system("c:/WhereEverItIs/excel.exe c:/ResultsFolder/ResultsFile.csv")

-Louie

I wonder how to find "excel.exe" (and "Winword.exe") gracefully? Find "excel.application" in the Registry? Right now I search many places in the Registry for likely folders housing Office, then check for the existance of the excel.exe file directly.