Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following report
I export the report aitomatically using the following script
FOR i=0 to Field.Count-1
Doc.Fields("CodeGroupe").Clear
Doc.FIelds(FieldName).SELECT Field.Item(i).Text
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = FALSE
SET xlBook = xlApp.Workbooks.Add
SET xlSheet = xlBook.Worksheets("Feuil1")
XLSFile = "G:\test_"&A.GetContent.STRING&"_"&Field.Item(i).Text&".xls"
Doc.GetApplication.WaitForIdle
Doc.GetSheetObject("CH1002731").CopyTableToClipBoard TRUE
xlApp.ActiveSheet.Paste
xlApp.Worksheets(xlApp.ActiveSheet.Index).Cells.EntireColumn.AutoFit
xlApp.Worksheets(xlApp.ActiveSheet.Index).Cells.EntireRow.AutoFit
strSheetName = Field.Item(i).Text
xlApp.ActiveSheet.Name = strSheetName
xlApp.ActiveWorkbook.Worksheets.Add
xlApp.DisplayAlerts = FALSE
Call Excel_DeleteBlankSheets(xlBook)
xlBook.SaveAs XLSFile, 56
xlBook.Close
XLSFile = ""
next
How could I export stock positif , stock negatif and stock null each one in a separate sheeet ?
Very probably I would use a particular object for each (maybe in a hidden sheet) and export them. For this you would need a condition in your objects, maybe something like this:
if(aggr(YourExpression, [Libelle Article]) < 0, [Libelle Article]) // respectively = 0 or > 0
Of course you could also filter and copy or filter and delete the data within excel but I doubt that it would be easier.
- Marcus
Very probably I would use a particular object for each (maybe in a hidden sheet) and export them. For this you would need a condition in your objects, maybe something like this:
if(aggr(YourExpression, [Libelle Article]) < 0, [Libelle Article]) // respectively = 0 or > 0
Of course you could also filter and copy or filter and delete the data within excel but I doubt that it would be easier.
- Marcus