Writing to multiple XL spreadsheets of the same workbook within same workbook

  • Thom A - Friday, November 30, 2018 4:59 AM

    VoldemarG - Thursday, November 29, 2018 10:21 PM

    How can I do that?      there is only one data source, and one xl destination per data flow /

    Then add a second. Like Tim mention, you can have multiple sources and destinations in the same data flow. You don't even need to have the same number of each (I have numerous packages which have several sources and 1 destination or vice versa).

    But how can i in such case dinamically assign output file names to xl files being written to within a loop?

    The problem I cannot overcome is that my output XL file name is built in the COPY G5 template task, the task that assigns name to output XL  file (and then xl file path on xl conn mgr is set to that variable)  based on a current value obtained within the for each loop.  IF I create a bunch of XL files in the loop like with one dataflow, then another data flow simply does not know what file name to write to (second spreadsheet of each file must be written to from a different query…).
    But if I add another CopyTemplate for the second data flow then the first spreadsheet will be blank (new template copied …)  and the second one normally written to.  How can I overcome that ?   (attached).

    Likes to play Chess

  • Phil Parkin - Friday, November 30, 2018 8:09 AM

    Thom A - Friday, November 30, 2018 7:54 AM

    Phil Parkin - Friday, November 30, 2018 7:40 AM

    Interesting. I've actually corrupted Excel spreadsheets just by attempting to read from them in parallel, so I am very careful about this now.

    Really odd. I have a package that actually reads 5 different sheets (1 of them twice) all at the same time and never had the issue. I feel like this might be something to investigate at some time to see if I can corrupt the file and see what I had to do to do it.

    Maybe it's because, at least in that package, I'm using 5 script tasks to read the file and one Excel Data source... :/

    I was using multiple data sources, as far as I can remember. Take a file copy before you try that out!

    The problem I cannot overcome is that my output XL file name is built in the COPY G5 template task, the task that assigns name to output XL  file (and then xl file path on xl conn mgr is set to that variable)  based on a current value obtained within the for each loop.  IF I create a bunch of XL files in the loop like with one dataflow, then another data flow simply does not know what file name to write to (second spreadsheet of each file must be written to from a different query…).
    But if I add another CopyTemplate for the second data flow then the first spreadsheet will be blank (new template copied …)  and the second one normally written to.  How can I overcome that ?   (attached).

    Likes to play Chess

  • VoldemarG - Sunday, December 2, 2018 6:32 PM

    Phil Parkin - Friday, November 30, 2018 8:09 AM

    Thom A - Friday, November 30, 2018 7:54 AM

    Phil Parkin - Friday, November 30, 2018 7:40 AM

    Interesting. I've actually corrupted Excel spreadsheets just by attempting to read from them in parallel, so I am very careful about this now.

    Really odd. I have a package that actually reads 5 different sheets (1 of them twice) all at the same time and never had the issue. I feel like this might be something to investigate at some time to see if I can corrupt the file and see what I had to do to do it.

    Maybe it's because, at least in that package, I'm using 5 script tasks to read the file and one Excel Data source... :/

    I was using multiple data sources, as far as I can remember. Take a file copy before you try that out!

    The problem I cannot overcome is that my output XL file name is built in the COPY G5 template task, the task that assigns name to output XL  file (and then xl file path on xl conn mgr is set to that variable)  based on a current value obtained within the for each loop.  IF I create a bunch of XL files in the loop like with one dataflow, then another data flow simply does not know what file name to write to (second spreadsheet of each file must be written to from a different query…).
    But if I add another CopyTemplate for the second data flow then the first spreadsheet will be blank (new template copied …)  and the second one normally written to.  How can I overcome that ?   (attached).

    It appears you ignored by comments about adding attachments and added an attachment... I don't mind helping, but I dislike being ignored. Good luck anyway.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply