Paul,
Thank you, that is very helpful.
Linda
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Paul Bennett
Sent: Thursday, May 21, 2009 9:21 AM
To: [email protected]
Subject: RE: [delphi-en] Jedi Plugin - modified code ignored!
Hi Linda, I use the Excell components from the Servers Tab (D7) and the
following code.procedure TfrmAlltenChild.WriteSpreadsheet;
var
Filename: OleVariant;
LastLine: integer;
nRow, nGlass: integer;
theRowData: TKeyData;
theRow: TDataRecord;
cdsLookup: TClientDataSet;
cdsFile: string;
EStyle: string;
begin
FileName :=fIniFile.ReadString('File Locations', 'Allten Analysis',
'');
If FileName = '' Then Exit;
cdsLookup := TClientDataSet.Create(nil);
cdsFile := ExtractFilePath(FileName) +'WrekinStyles.xml';
cdsLookup.LoadFromFile(cdsFile);
cdsLookup.IndexFieldNames := 'Wrekin';
cdsLookup.Active := True;
CoInitialize(nil);
ExcelApp.Connect;
ExcelApp.Workbooks.Open(FileName,EmptyParam, EmptyParam,
EmptyParam, EmptyParam,
EmptyParam, EmptyParam,
EmptyParam, EmptyParam,
EmptyParam, EmptyParam,
EmptyParam, EmptyParam,
EmptyParam, EmptyParam,
0);
ExcelApp.Visible[0] := True;
ExcelWBook.ConnectTo(ExcelApp.ActiveWorkbook);
ExcelWBook.Worksheets.Item['EastlandsData'];
ExcelWSheet.ConnectTo(ExcelWBook.ActiveSheet as _worksheet);
ExcelWSheet.Activate;
LastLine := Integer(ExcelWSheet.Cells.Item[1, 'A']);
For nRow := 0 to High(fRecordArray) do
begin
theRowData := fRecordArray[nRow];
theRow := fRecordArray[nRow].Data;
if cdsLookup.FindKey([theRowData.Style]) then
EStyle := cdsLookup.Fields.Fields[1].AsString
else
EStyle := 'Unknown';
for nGlass := 0 to Pred(theRow.Panes) do
begin
Inc(LastLine);
ExcelWSheet.Cells.Item[LastLine, 'B'] := theRowData.Comment;
ExcelWSheet.Cells.Item[LastLine, 'D'] := theRowData.Contract;
ExcelWSheet.Cells.Item[LastLine, 'E'] := theRowData.WinNo;
ExcelWSheet.Cells.Item[LastLine, 'F'] := theRowData.Address;
ExcelWSheet.Cells.Item[LastLine, 'G'] := theRowData.Location;
ExcelWSheet.Cells.Item[LastLine, 'H'] := theRowData.Style;
ExcelWSheet.Cells.Item[LastLine, 'I'] := theRowData.FrameW;
ExcelWSheet.Cells.Item[LastLine, 'J'] := theRowData.FrameH;
ExcelWSheet.Cells.Item[LastLine, 'K'] := theRowData.CillSize;
if nGlass= 0 then
begin
ExcelWSheet.Cells.Item[LastLine, 'L'] := theRowData.Price;
ExcelWSheet.Cells.Item[LastLine, 'R'] := theRowData.Extras;
ExcelWSheet.Cells.Item[LastLine, 'M'] := theRowData.Qty;
ExcelWSheet.Cells.Item[LastLine, 'S'] := theRowData.Style;
ExcelWSheet.Cells.Item[LastLine, 'U'] := fExportDate;
ExcelWSheet.Cells.Item[LastLine, 'T'] := EStyle;
end
else
begin
ExcelWSheet.Cells.Item[LastLine, 'L'] := 0;
ExcelWSheet.Cells.Item[LastLine, 'R'] := 0;
ExcelWSheet.Cells.Item[LastLine, 'M'] := 0;
ExcelWSheet.Cells.Item[LastLine, 'S'] := '';
ExcelWSheet.Cells.Item[LastLine, 'U'] := '';
ExcelWSheet.Cells.Item[LastLine, 'T'] := '';
end;
ExcelWSheet.Cells.Item[LastLine, 'N'] := theRow.Glass[nGlass].Glass;
ExcelWSheet.Cells.Item[LastLine, 'O'] := theRow.Glass[nGlass].Width;
ExcelWSheet.Cells.Item[LastLine, 'P'] := theRow.Glass[nGlass].Height;
ExcelWSheet.Cells.Item[LastLine, 'Q'] := theRow.Glass[nGlass].Qty;
ExcelWSheet.Cells.Item[1, 'A'] := LastLine;
end;
end;
ExcelWBook.Save;
cdsLookup.Free;
ExcelApp.Visible[0] := False;
ExcelWSheet.Disconnect;
ExcelWBook.Disconnect;
ExcelApp.Quit;
ExcelApp.Disconnect;
CoUninitialize;
end;
Hope that helps,Paul
----- Original Message -----
From: "Linda Gerloff"
To: delphi...@yahoogrou <mailto:delphi-en%40yahoogroups.com> ps.com
Subject: RE: [delphi-en] Jedi Plugin - modified code ignored!
Date: Wed, 20 May 2009 11:35:49 -0500
Paul,
Sorry, I don't have an answer to your question, but I have a question
for
you.
How do you write to an Excel spreadsheet?
Thanks,
Linda
-----Original Message-----
From: delphi...@yahoogrou <mailto:delphi-en%40yahoogroups.com> ps.com
[mailto:delphi...@yahoogrou <mailto:delphi-en%40yahoogroups.com> ps.com] On
Behalf
Of Paul Bennett
Sent: Wednesday, May 20, 2009 5:37 AM
To: delphi...@yahoogrou <mailto:delphi-en%40yahoogroups.com> ps.com
Subject: [delphi-en] Jedi Plugin - modified code ignored!
Hi All,
I seem to have run into a problem that I just can't get my head
around.
I have an application that uses a number of (Jedi) plugins, each
plugin is self contained and reads data from various (Paradox)
tables, massages it and then writes it to an Excel spreadsheet. This
is all working fine.
Recently the users have asked for additional data to be passed to the
spreadsheet. I have modified the form/datamodule that the plugin
calls and tested it and it behaves as expected, however when I
recompile the plugin the new code is not executed!!!!
I have deleted all of the dcu's and the plugins dll files but I still
don't get the expected result?
anyone have any ideas????
Paul.
[Non-text portions of this message have been removed]
Experience is something you don't get until just after you need it.
--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera. <http://www.opera.com> com
Powered by Outblaze
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]